Skip to content

Commit

Permalink
Add transformer import to count_occurrences.py
Browse files Browse the repository at this point in the history
  • Loading branch information
carlini committed Mar 11, 2022
1 parent 50b25c4 commit 67351ad
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scripts/count_occurrences.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@

if args.tokenize:
if args.tokenizer == 'gpt2':
from transformers import GPT2Tokenizer
tokenizer = GPT2Tokenizer.from_pretrained('gpt2')
elif args.tokenizer == 't5':
from transformers import T5Tokenizer
tokenizer = T5Tokenizer.from_pretrained('t5-small')
else:
raise
Expand Down

0 comments on commit 67351ad

Please sign in to comment.