@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / ee9442518d
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, 09:15 UTC

Fix get_model

Woosuk Kwon committed Feb 13, 2023 at 22:51 UTC ee9442518d88925e96c36f1a039d61893d224e78
1 file changed +4 -3
cacheflow/worker/models/model_utils.py
+4 -3
@@ -8,6 +8,7 @@ MODEL_CLASSES = {
8
9
10 def get_model(model_name: str) -> nn.Module:
11 - if model_name not in MODEL_CLASSES:
12 - raise ValueError(f'Invalid model name: {model_name}')
13 - return MODEL_CLASSES[model_name].from_pretrained(model_name)
11 + for model_class, model in MODEL_CLASSES.items():
12 + if model_class in model_name:
13 + return model.from_pretrained(model_name)
14 + raise ValueError(f'Invalid model name: {model_name}')