6
6
from vllm .model_executor .guided_decoding .guided_fields import (
7
7
GuidedDecodingRequest )
8
8
from vllm .sampling_params import LogitsProcessor
9
- from vllm .transformers_utils .tokenizer import MistralTokenizer
10
9
11
10
12
11
async def get_guided_decoding_logits_processor (
@@ -16,23 +15,12 @@ async def get_guided_decoding_logits_processor(
16
15
request = _adapt_request_for_tool_use (request )
17
16
18
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." )
24
18
# NOTE: lazy import outlines to avoid https://github.com/vllm-project/vllm/issues/4193
25
19
from vllm .model_executor .guided_decoding .outlines_decoding import ( # noqa
26
20
get_outlines_guided_decoding_logits_processor )
27
21
return await get_outlines_guided_decoding_logits_processor (
28
22
request , tokenizer )
29
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." )
36
24
from vllm .model_executor .guided_decoding .lm_format_enforcer_decoding import ( # noqa
37
25
get_lm_format_enforcer_guided_decoding_logits_processor )
38
26
return await get_lm_format_enforcer_guided_decoding_logits_processor (
@@ -49,23 +37,12 @@ def get_local_guided_decoding_logits_processor(
49
37
# request = _adapt_request_for_tool_use(request)
50
38
51
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." )
57
40
# NOTE: lazy import outlines to avoid https://github.com/vllm-project/vllm/issues/4193
58
41
from vllm .model_executor .guided_decoding .outlines_decoding import ( # noqa
59
42
get_local_outlines_guided_decoding_logits_processor )
60
43
return get_local_outlines_guided_decoding_logits_processor (
61
44
guided_options , tokenizer )
62
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." )
69
46
from vllm .model_executor .guided_decoding .lm_format_enforcer_decoding import ( # noqa
70
47
get_local_lm_format_enforcer_guided_decoding_logits_processor )
71
48
return get_local_lm_format_enforcer_guided_decoding_logits_processor (
0 commit comments