Skip to content

Commit

Permalink
Fix error when using type="float" on OpenAI model
Browse files Browse the repository at this point in the history
Resolves #211
  • Loading branch information
mondaychen authored and rlouf committed Aug 10, 2023
1 parent de8c2e5 commit 3aefe07
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion outlines/models/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ def create_float_mask(encoder):

# TODO: This is a hack because OpenAI's API does not
# allow more than 300 entries for `logit_bias`
special_tokens = encoder._special_tokens.values()
special_tokens = encoder._special_tokens
mask = {special_tokens["<|endoftext|>"]: 100}
mask.update({int_token_ids[i]: 100 for i in range(300 - len(special_tokens))})

Expand Down

0 comments on commit 3aefe07

Please sign in to comment.