Skip to content

Commit

Permalink
More gen param tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
minimaxir committed May 17, 2020
1 parent 74f54a5 commit 1df1211
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion aitextgen/aitextgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ def generate(
self,
n: int = 1,
prompt: str = None,
max_length: int = 200,
max_length: int = 1024,
temperature: float = 0.7,
do_sample: bool = True,
return_as_list: bool = False,
Expand Down
5 changes: 4 additions & 1 deletion aitextgen/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,10 @@ def generate_sample_text(self, trainer, pl_module):
gen_length = min(pl_module.model.config.n_positions, 256)

outputs = pl_module.model.generate(
max_length=gen_length, do_sample=True, num_return_sequences=self.n_generate
max_length=gen_length,
do_sample=True,
num_return_sequences=self.n_generate,
temperature=0.7,
)
gen_texts = [
pl_module.tokenizer.decode(output, skip_special_tokens=True)
Expand Down

0 comments on commit 1df1211

Please sign in to comment.