A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 16, 15:45 UTC
Revert "[Misc][Bugfix] Disable guided decoding for mistral tokenizer" (#8593)
Roger Wang committed
Sep 18, 2024 at 21:14 UTC
02c9afa2d04a85269faa2760e9af30527a61d7f6
1 file changed
-23
vllm/model_executor/guided_decoding/__init__.py
-23
@@ -6,7 +6,6 @@ from vllm.entrypoints.openai.protocol import (
6
from vllm.model_executor.guided_decoding.guided_fields import (
7
GuidedDecodingRequest)
8
from vllm.sampling_params import LogitsProcessor
9
-from vllm.transformers_utils.tokenizer import MistralTokenizer
9
10
11
async def get_guided_decoding_logits_processor(
@@ -16,23 +15,12 @@ async def get_guided_decoding_logits_processor(
15
request = _adapt_request_for_tool_use(request)
16
17
if guided_decoding_backend == 'outlines':
19
- if isinstance(tokenizer, MistralTokenizer):
20
- raise NotImplementedError(
21
- "Guided decoding with 'outlines' is currently not supported "
22
- "for Mistral tokenizer. Please consider contributing to the "
23
- "'outlines' project if you are interested in this feature.")
18
# NOTE: lazy import outlines to avoid https://github.com/vllm-project/vllm/issues/4193
19
from vllm.model_executor.guided_decoding.outlines_decoding import ( # noqa
20
get_outlines_guided_decoding_logits_processor)
21
return await get_outlines_guided_decoding_logits_processor(
22
request, tokenizer)
23
if guided_decoding_backend == 'lm-format-enforcer':
30
- if isinstance(tokenizer, MistralTokenizer):
31
- raise NotImplementedError(
32
- "Guided decoding with 'lm-format-enforcer' is currently not "
33
- "supported for Mistral tokenizer. Please consider contributing "
34
- "to the 'lm-format-enforcer' project if you are interested "
35
- "in this feature.")
24
from vllm.model_executor.guided_decoding.lm_format_enforcer_decoding import ( # noqa
25
get_lm_format_enforcer_guided_decoding_logits_processor)
26
return await get_lm_format_enforcer_guided_decoding_logits_processor(
@@ -49,23 +37,12 @@ def get_local_guided_decoding_logits_processor(
37
# request = _adapt_request_for_tool_use(request)
38
39
if guided_decoding_backend == 'outlines':
52
- if isinstance(tokenizer, MistralTokenizer):
53
- raise NotImplementedError(
54
- "Guided decoding with 'outlines' is currently not supported "
55
- "for Mistral tokenizer. Please consider contributing to the "
56
- "'outlines' project if you are interested in this feature.")
40
# NOTE: lazy import outlines to avoid https://github.com/vllm-project/vllm/issues/4193
41
from vllm.model_executor.guided_decoding.outlines_decoding import ( # noqa
42
get_local_outlines_guided_decoding_logits_processor)
43
return get_local_outlines_guided_decoding_logits_processor(
44
guided_options, tokenizer)
45
if guided_decoding_backend == 'lm-format-enforcer':
63
- if isinstance(tokenizer, MistralTokenizer):
64
- raise NotImplementedError(
65
- "Guided decoding with 'lm-format-enforcer' is currently not "
66
- "supported for Mistral tokenizer. Please consider contributing "
67
- "to the 'lm-format-enforcer' project if you are interested "
68
- "in this feature.")
46
from vllm.model_executor.guided_decoding.lm_format_enforcer_decoding import ( # noqa
47
get_local_lm_format_enforcer_guided_decoding_logits_processor)
48
return get_local_lm_format_enforcer_guided_decoding_logits_processor(