[Bugfix] Add fix for JSON whitespace (#4189)
Co-authored-by: Ubuntu <ubuntu@ip-172-31-13-147.ec2.internal>
This commit is contained in:
parent
bc9df1571b
commit
138485a82d
@ -754,6 +754,7 @@ async def test_guided_choice_chat_logprobs(server, client: openai.AsyncOpenAI,
|
|||||||
|
|
||||||
|
|
||||||
async def test_response_format_json_object(server, client: openai.AsyncOpenAI):
|
async def test_response_format_json_object(server, client: openai.AsyncOpenAI):
|
||||||
|
for _ in range(2):
|
||||||
resp = await client.chat.completions.create(
|
resp = await client.chat.completions.create(
|
||||||
model=MODEL_NAME,
|
model=MODEL_NAME,
|
||||||
messages=[{
|
messages=[{
|
||||||
|
|||||||
@ -131,6 +131,11 @@ class CFGLogitsProcessor(BaseLogitsProcessor):
|
|||||||
fsm = CFGFSM(cfg, tokenizer)
|
fsm = CFGFSM(cfg, tokenizer)
|
||||||
self.fsm = fsm
|
self.fsm = fsm
|
||||||
|
|
||||||
|
def init_state(self):
|
||||||
|
"""Initialize state with a CFGFSM copy."""
|
||||||
|
super().init_state()
|
||||||
|
self.fsm = self.fsm.copy()
|
||||||
|
|
||||||
|
|
||||||
@lru_cache
|
@lru_cache
|
||||||
def _adapt_tokenizer(tokenizer: PreTrainedTokenizerBase):
|
def _adapt_tokenizer(tokenizer: PreTrainedTokenizerBase):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user