Unverified Commit 082d6db3 authored by Stella Biderman's avatar Stella Biderman Committed by GitHub
Browse files

Merge pull request #448 from nikhilpinnaparaju/issue-439

Set PAD token to EOS token
parents 14043a0f bdc1af90
...@@ -119,6 +119,7 @@ class HFLM(BaseLM): ...@@ -119,6 +119,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
generation_kwargs['pad_token_id'] = eos_token_id # setting eos_token_id as pad token
return self.gpt2.generate(context, **generation_kwargs) return self.gpt2.generate(context, **generation_kwargs)
......
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