Skip to content
This repository has been archived by the owner on Feb 22, 2020. It is now read-only.

Commit

Permalink
fix(transformer): add model eval
Browse files Browse the repository at this point in the history
  • Loading branch information
jemmyshin committed Sep 6, 2019
1 parent 2066beb commit fbfa1e4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gnes/encoder/text/transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def post_init(self):
(RobertaModel, RobertaTokenizer, 'roberta-base')]}[self.model_name]

def load_model_tokenizer(x):
return model_class.from_pretrained(x), tokenizer_class.from_pretrained(x)
return model_class.from_pretrained(x).eval(), tokenizer_class.from_pretrained(x)

try:
self.model, self.tokenizer = load_model_tokenizer(self.work_dir)
Expand Down

0 comments on commit fbfa1e4

Please sign in to comment.