Skip to content

Commit

Permalink
update get_tokenizer to pass CI test
Browse files Browse the repository at this point in the history
  • Loading branch information
zw615 authored and rwightman committed Oct 6, 2023
1 parent 13464e8 commit fa38faf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/open_clip/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,9 @@ def get_tokenizer(model_name):
tokenizer = block_mask_tokenize
else:
tokenizer = tokenize
context_length = get_model_config(model_name)['text_cfg']['context_length']
tokenizer = partial(tokenizer, context_length=context_length)
if 'context_length' in config['text_cfg'].keys():
context_length = config['text_cfg']['context_length']
tokenizer = partial(tokenizer, context_length=context_length)
return tokenizer


Expand Down

0 comments on commit fa38faf

Please sign in to comment.