Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
norm
vllm
Commits
ee944251
Commit
ee944251
authored
Feb 13, 2023
by
Woosuk Kwon
Browse files
Fix get_model
parent
531e1c74
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
cacheflow/worker/models/model_utils.py
cacheflow/worker/models/model_utils.py
+4
-3
No files found.
cacheflow/worker/models/model_utils.py
View file @
ee944251
...
...
@@ -8,6 +8,7 @@ MODEL_CLASSES = {
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
)
for
model_class
,
model
in
MODEL_CLASSES
.
items
():
if
model_class
in
model_name
:
return
model
.
from_pretrained
(
model_name
)
raise
ValueError
(
f
'Invalid model name:
{
model_name
}
'
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment