Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
24154f86
Unverified
Commit
24154f86
authored
Aug 12, 2024
by
Cyrus Leung
Committed by
GitHub
Aug 12, 2024
Browse files
[Frontend] Disallow passing `model` as both argument and option (#7347)
parent
e6e42e4b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
2 deletions
+9
-2
vllm/engine/arg_utils.py
vllm/engine/arg_utils.py
+2
-2
vllm/scripts.py
vllm/scripts.py
+7
-0
No files found.
vllm/engine/arg_utils.py
View file @
24154f86
...
...
@@ -32,7 +32,7 @@ def nullable_str(val: str):
@
dataclass
class
EngineArgs
:
"""Arguments for vLLM engine."""
model
:
str
model
:
str
=
'facebook/opt-125m'
served_model_name
:
Optional
[
Union
[
List
[
str
]]]
=
None
tokenizer
:
Optional
[
str
]
=
None
skip_tokenizer_init
:
bool
=
False
...
...
@@ -133,7 +133,7 @@ class EngineArgs:
parser
.
add_argument
(
'--model'
,
type
=
str
,
default
=
'facebook/opt-125m'
,
default
=
EngineArgs
.
model
,
help
=
'Name or path of the huggingface model to use.'
)
parser
.
add_argument
(
'--tokenizer'
,
...
...
vllm/scripts.py
View file @
24154f86
...
...
@@ -9,6 +9,7 @@ from typing import List, Optional
from
openai
import
OpenAI
from
openai.types.chat
import
ChatCompletionMessageParam
from
vllm.engine.arg_utils
import
EngineArgs
from
vllm.entrypoints.openai.api_server
import
run_server
from
vllm.entrypoints.openai.cli_args
import
make_arg_parser
from
vllm.utils
import
FlexibleArgumentParser
...
...
@@ -24,6 +25,12 @@ def register_signal_handlers():
def
serve
(
args
:
argparse
.
Namespace
)
->
None
:
# The default value of `--model`
if
args
.
model
!=
EngineArgs
.
model
:
raise
ValueError
(
"With `vllm serve`, you should provide the model as a "
"positional argument instead of via the `--model` option."
)
# EngineArgs expects the model name to be passed as --model.
args
.
model
=
args
.
model_tag
...
...
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