Unverified Commit 8d7d2132 authored by Leo Gao's avatar Leo Gao Committed by GitHub
Browse files

Put gpt2 in eval mode

parent 0d291df6
......@@ -9,6 +9,7 @@ class GPT2LM(LM):
def __init__(self, device="cpu"):
self.device = torch.device(device)
self.gpt2 = transformers.GPT2LMHeadModel.from_pretrained('gpt2').to(self.device)
self.gpt2.eval()
self.tokenizer = transformers.GPT2Tokenizer.from_pretrained('gpt2')
@classmethod
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment