"vscode:/vscode.git/clone" did not exist on "eaaf891ccbddfd3589df8cde1092d3bffef04d90"
Commit 1b604e16 authored by Nikhil Pinnaparaju's avatar Nikhil Pinnaparaju
Browse files

Use EOS token as PAD token to get rid of huggingface model warning

parent dd9fb896
...@@ -112,8 +112,7 @@ class HFLM(BaseLM): ...@@ -112,8 +112,7 @@ class HFLM(BaseLM):
generation_kwargs = {'do_sample': False, 'max_length': max_length} generation_kwargs = {'do_sample': False, 'max_length': max_length}
if eos_token_id is not None: if eos_token_id is not None:
generation_kwargs['eos_token_id'] = eos_token_id generation_kwargs['eos_token_id'] = eos_token_id
return self.gpt2.generate(context, **generation_kwargs) return self.gpt2.generate(context, pad_token_id=eos_token_id, **generation_kwargs)
# for backwards compatibility # for backwards compatibility
GPT2LM = HFLM GPT2LM = HFLM
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