mirror of
https://github.com/wassname/vllm.git
synced 2026-08-05 13:30:14 +08:00
Add model_utils
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import torch.nn as nn
|
||||
|
||||
from cacheflow.worker.models.opt import OPTForCausalLM
|
||||
|
||||
MODEL_CLASSES = {
|
||||
'opt': OPTForCausalLM,
|
||||
}
|
||||
|
||||
|
||||
def get_model(model_name: str) -> nn.Module:
|
||||
if model_name not in MODEL_CLASSES:
|
||||
raise ValueError(f'Invalid model name: {model_name}')
|
||||
return MODEL_CLASSES[model_name].from_pretrained(model_name)
|
||||
Reference in New Issue
Block a user