Skip to content

Commit

Permalink
usse setattr for config assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
minimaxir committed Dec 24, 2020
1 parent b8630a3 commit fe1a0b9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions aitextgen/aitextgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,13 @@ def __init__(
)

if gradient_checkpointing:
self.model.config["gradient_checkpointing"] = True
setattr(self.model.config, "gradient_checkpointing", True)

if schema_tokens:
self.model.config["schema_tokens"] = schema_tokens
setattr(self.model.config, "schema_tokens", schema_tokens)

if schema_tokens:
self.model.config["schema_return"] = schema_return
setattr(self.model.config, "schema_return", schema_return)

if self.tokenizer is None:
# Update tokenizer settings (if not set already)
Expand Down

0 comments on commit fe1a0b9

Please sign in to comment.