Skip to content

Commit

Permalink
use AutoProcessor with use_fast=False since there's a bug with use_fa…
Browse files Browse the repository at this point in the history
…st=True where whitespace is removed on single token decodes
  • Loading branch information
AlexCheema committed Jul 30, 2024
1 parent 0ec77e1 commit 2d20000
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions exo/api/chatgpt_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ def resolve_tinygrad_tokenizer(model_id: str):

async def resolve_tokenizer(model_id: str):
try:
if DEBUG >= 2: print(f"Trying to AutoProcessor for {model_id}")
processor = AutoProcessor.from_pretrained(model_id)
if DEBUG >= 2: print(f"Trying AutoProcessor for {model_id}")
processor = AutoProcessor.from_pretrained(model_id, use_fast=False)
processor.eos_token_id = processor.tokenizer.eos_token_id
processor.encode = processor.tokenizer.encode
return processor
Expand Down

0 comments on commit 2d20000

Please sign in to comment.