Skip to content

Commit

Permalink
add wikitext eval
Browse files Browse the repository at this point in the history
  • Loading branch information
ConnorJL committed Nov 21, 2020
1 parent 4cb5221 commit a2b731b
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions data/encoders.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,8 @@ def fetch_encoder(params):


# GPT2Tokenizer and Tokenizer have different ways of fetching token ids
def encode(encoder, text, gpt=True):
if gpt:
result = encoder.encode(text, max_length=None)
else:
result = encoder.encode(text)
def encode(encoder, text):
result = encoder.encode(text)
if isinstance(result, list):
return result
return result.ids

0 comments on commit a2b731b

Please sign in to comment.