Add LLM.set_tokenizer (#283)

This commit is contained in:
Jishnu Ray Chowdhury 2023-06-28 02:28:29 -05:00 committed by GitHub
parent 2b7d3aca2e
commit bdd6b4c8bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -60,6 +60,12 @@ class LLM:
) -> Union[PreTrainedTokenizer, PreTrainedTokenizerFast]:
return self.llm_engine.tokenizer
def set_tokenizer(
self,
tokenizer: Union[PreTrainedTokenizer, PreTrainedTokenizerFast],
) -> None:
self.llm_engine.tokenizer = tokenizer
def generate(
self,
prompts: Optional[Union[str, List[str]]] = None,