File tree 1 file changed +20
-1
lines changed
1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change 79
79
),
80
80
)
81
81
82
- MODEL_OPTION = click .argument ("model_path" , type = str , default = "default" )
82
+ MODEL_ARG = click .argument ("model" , type = str , default = None , required = False )
83
+ MODEL_OPTION = click .option (
84
+ "--model_path" ,
85
+ type = str ,
86
+ default = "default" ,
87
+ help = (
88
+ "The path to a model.onnx file, a model folder containing the model.onnx "
89
+ "and supporting files, or a SparseZoo model stub. "
90
+ "If not specified, the default model for the task is used."
91
+ ),
92
+ )
83
93
84
94
BATCH_OPTION = click .option (
85
95
"--batch_size" ,
143
153
@PORT_OPTION
144
154
@LOG_LEVEL_OPTION
145
155
@HOT_RELOAD_OPTION
156
+ @MODEL_ARG
146
157
@MODEL_OPTION
147
158
@BATCH_OPTION
148
159
@CORES_OPTION
@@ -158,6 +169,7 @@ def main(
158
169
log_level : str ,
159
170
hot_reload_config : bool ,
160
171
model_path : str ,
172
+ model : str ,
161
173
batch_size : int ,
162
174
num_cores : int ,
163
175
num_workers : int ,
@@ -207,6 +219,13 @@ def main(
207
219
...
208
220
```
209
221
"""
222
+ # the server cli can take a model argument or --model_path option
223
+ # if the --model_path option is provided, use that
224
+ # otherwise if the argument is given and --model_path is not used, use the
225
+ # argument instead
226
+ if model and model_path == "default" :
227
+ model_path = model
228
+
210
229
if integration == INTEGRATION_OPENAI :
211
230
if task is None or task != "text_generation" :
212
231
task = "text_generation"
You can’t perform that action at this time.
0 commit comments