Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Smartappli authored Aug 2, 2024
1 parent 27dbd64 commit e211d7b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions llama_cpp/llama_tokenizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import abc
from typing import (
Any,
List,
Optional,
Any,
)

import llama_cpp
Expand Down Expand Up @@ -62,7 +62,7 @@ def decode(self, tokens: List[int]) -> str:
return self.detokenize(tokens).decode("utf-8", errors="ignore")

@classmethod
def from_ggml_file(cls, path: str) -> "LlamaTokenizer":
def from_ggml_file(cls, path: str) -> LlamaTokenizer:
return cls(llama_cpp.Llama(model_path=path, vocab_only=True))


Expand Down Expand Up @@ -92,7 +92,7 @@ def detokenize(
return self.hf_tokenizer.decode(tokens).encode("utf-8", errors="ignore")

@classmethod
def from_pretrained(cls, pretrained_model_name_or_path: str) -> "LlamaHFTokenizer":
def from_pretrained(cls, pretrained_model_name_or_path: str) -> LlamaHFTokenizer:
try:
from transformers import AutoTokenizer
except ImportError:
Expand Down

0 comments on commit e211d7b

Please sign in to comment.