Skip to content

Commit

Permalink
Add type ignores
Browse files Browse the repository at this point in the history
  • Loading branch information
irenedea committed Oct 30, 2023
1 parent 5e688e7 commit 2e94cae
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions llmfoundry/tokenizers/tiktoken.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,18 @@ def __init__(self,
import copyreg
import functools

def pickle_Encoding(enc: tiktoken.Encoding):
return (functools.partial(tiktoken.Encoding,
def pickle_Encoding(enc: tiktoken.Encoding): # type: ignore (thirdParty)
return (functools.partial(tiktoken.Encoding, # type: ignore (thirdParty)
enc.name,
pat_str=enc._pat_str,
mergeable_ranks=enc._mergeable_ranks,
special_tokens=enc._special_tokens), ())

copyreg.pickle(tiktoken.Encoding, pickle_Encoding)
copyreg.pickle(tiktoken.Encoding, pickle_Encoding) # type: ignore (thirdParty)

if model_name is not None and encoding_name is not None:
raise ValueError(
'You need to specify either model_name or encoding_name, not both.'
'You need to specify either model_name or encoding_name, not both.' # type: ignore (thirdParty)
)

self.model_name = model_name
Expand Down

0 comments on commit 2e94cae

Please sign in to comment.