Skip to content

Commit

Permalink
actually use the config passed in to the token_enforcer
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshC8C7 committed Nov 28, 2024
1 parent 764e05c commit b6abea1
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lmformatenforcer/tokenenforcer.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ def __init__(self, tokenizer_data: TokenEnforcerTokenizerData, parser: Character
if decoded == '"':
self.allowed_token_cache["superfast"] = [token_idx]

config = CharacterLevelParserConfig(alphabet=tokenizer_data.tokenizer_alphabet)
parser.config = config
parser.config.alphabet = tokenizer_data.tokenizer_alphabet

def get_allowed_tokens(self, token_sequence: List[int]) -> List[int]:
"""
Expand Down

0 comments on commit b6abea1

Please sign in to comment.