@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / bdd6b4c8bc
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 17, 08:00 UTC

Add LLM.set_tokenizer (#283)

Jishnu Ray Chowdhury committed Jun 28, 2023 at 02:28 UTC bdd6b4c8bc3e5ac93553436514171ffad5926f0c
1 file changed +6
vllm/entrypoints/llm.py
+6
@@ -60,6 +60,12 @@ class LLM:
60 ) -> Union[PreTrainedTokenizer, PreTrainedTokenizerFast]:
61 return self.llm_engine.tokenizer
62
63 + def set_tokenizer(
64 + self,
65 + tokenizer: Union[PreTrainedTokenizer, PreTrainedTokenizerFast],
66 + ) -> None:
67 + self.llm_engine.tokenizer = tokenizer
68 +
69 def generate(
70 self,
71 prompts: Optional[Union[str, List[str]]] = None,