Skip to content

Commit

Permalink
allow optional schema_return
Browse files Browse the repository at this point in the history
  • Loading branch information
minimaxir committed May 7, 2021
1 parent c648e20 commit 0c0a099
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion aitextgen/aitextgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ def generate(
# Schema token handling
if schema:
schema_tokens = getattr(self.model.config, "schema_tokens")
schema_return = getattr(self.model.config, "schema_return")
schema_return = getattr(self.model.config, "schema_return", None)
schema_tokens_enc = self.tokenizer(text=schema_tokens)["input_ids"]

nonalphanum_pattern = re.compile(r"[\W_]+", re.UNICODE)
Expand Down

0 comments on commit 0c0a099

Please sign in to comment.