Skip to content

Commit

Permalink
ancient translation test
Browse files Browse the repository at this point in the history
  • Loading branch information
920232796 committed Apr 20, 2021
1 parent a933c37 commit 7c418cf
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
Binary file modified .DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion examples/gpt2_ancient_translation_train.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def iteration(self, epoch, dataloader, train=True):
if __name__ == '__main__':

trainer = Trainer()
train_epoches = 10
train_epoches = 100
for epoch in range(train_epoches):
# 训练一个epoch
trainer.train(epoch)
2 changes: 1 addition & 1 deletion test/gpt_ancient_translation_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
model.set_device(device)
model.load_all_params(model_path)

print(model.sample_generate("自昔羲后,因以物命官,事简人淳,唯以道化,上无求欲於下,下无干进於上,百姓自足,海内乂安,不是贤而非愚,不沽名而尚行,推择之典,无所闻焉。", out_max_length=300, add_eos=True))
print(model.sample_generate("余忆童稚时,能张目对日。", out_max_length=300, add_eos=True))

0 comments on commit 7c418cf

Please sign in to comment.