Commit
·
449a109
1
Parent(s):
f6dcb7a
fix
Browse files- app.py +2 -2
- config_store.py +10 -5
- pre-requirements.txt +1 -1
app.py
CHANGED
|
@@ -72,14 +72,14 @@ def parse_configs(inputs):
|
|
| 72 |
task=task,
|
| 73 |
model=model,
|
| 74 |
device=DEVICE,
|
| 75 |
-
**configs["pytorch"],
|
| 76 |
)
|
| 77 |
|
| 78 |
configs["openvino"] = OVConfig(
|
| 79 |
task=task,
|
| 80 |
model=openvino_label or model,
|
| 81 |
device=DEVICE,
|
| 82 |
-
**configs["openvino"],
|
| 83 |
)
|
| 84 |
|
| 85 |
return configs
|
|
|
|
| 72 |
task=task,
|
| 73 |
model=model,
|
| 74 |
device=DEVICE,
|
| 75 |
+
**{k: v for k, v in configs["pytorch"] if v},
|
| 76 |
)
|
| 77 |
|
| 78 |
configs["openvino"] = OVConfig(
|
| 79 |
task=task,
|
| 80 |
model=openvino_label or model,
|
| 81 |
device=DEVICE,
|
| 82 |
+
**{k: v for k, v in configs["openvino"] if v},
|
| 83 |
)
|
| 84 |
|
| 85 |
return configs
|
config_store.py
CHANGED
|
@@ -78,21 +78,26 @@ def get_pytorch_config():
|
|
| 78 |
|
| 79 |
def get_openvino_config():
|
| 80 |
return {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 81 |
"openvino.reshape": gr.Checkbox(
|
| 82 |
value=False,
|
| 83 |
label="openvino.reshape",
|
| 84 |
info="Reshapes the model to the input shape",
|
| 85 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 86 |
"openvino.compile": gr.Checkbox(
|
| 87 |
value=False,
|
| 88 |
label="openvino.compile",
|
| 89 |
info="Compiles model for the current device",
|
| 90 |
),
|
| 91 |
-
"openvino.half": gr.Checkbox(
|
| 92 |
-
value=False,
|
| 93 |
-
label="openvino.half",
|
| 94 |
-
info="Converts model to half precision",
|
| 95 |
-
),
|
| 96 |
"openvino.load_in_8bit": gr.Checkbox(
|
| 97 |
value=False,
|
| 98 |
label="openvino.load_in_8bit",
|
|
|
|
| 78 |
|
| 79 |
def get_openvino_config():
|
| 80 |
return {
|
| 81 |
+
"openvino.half": gr.Checkbox(
|
| 82 |
+
value=False,
|
| 83 |
+
label="openvino.half",
|
| 84 |
+
info="Converts model to half precision",
|
| 85 |
+
),
|
| 86 |
"openvino.reshape": gr.Checkbox(
|
| 87 |
value=False,
|
| 88 |
label="openvino.reshape",
|
| 89 |
info="Reshapes the model to the input shape",
|
| 90 |
),
|
| 91 |
+
"openvino.reshape_kwargs": gr.Textbox(
|
| 92 |
+
label="openvino.reshape_kwargs",
|
| 93 |
+
value="{'batch_size': 2, 'sequence_length': 16}",
|
| 94 |
+
info="Additional python dict of kwargs to pass to the reshape function",
|
| 95 |
+
),
|
| 96 |
"openvino.compile": gr.Checkbox(
|
| 97 |
value=False,
|
| 98 |
label="openvino.compile",
|
| 99 |
info="Compiles model for the current device",
|
| 100 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 101 |
"openvino.load_in_8bit": gr.Checkbox(
|
| 102 |
value=False,
|
| 103 |
label="openvino.load_in_8bit",
|
pre-requirements.txt
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
|
|
| 1 |
--index-url https://download.pytorch.org/whl/cpu
|
| 2 |
torch
|
| 3 |
--index-url https://download.pytorch.org/whl/cpu
|
| 4 |
torchvision
|
| 5 |
--index-url https://download.pytorch.org/whl/cpu
|
| 6 |
torchaudio
|
| 7 |
-
pip==24.3.1
|
|
|
|
| 1 |
+
pip==24.3.1
|
| 2 |
--index-url https://download.pytorch.org/whl/cpu
|
| 3 |
torch
|
| 4 |
--index-url https://download.pytorch.org/whl/cpu
|
| 5 |
torchvision
|
| 6 |
--index-url https://download.pytorch.org/whl/cpu
|
| 7 |
torchaudio
|
|
|