Spaces:
Sleeping
Sleeping
Commit
•
0425d1c
1
Parent(s):
4db7f9b
update
Browse files- base_config.yaml → configs/base_config.yaml +0 -0
- run.py +11 -10
base_config.yaml → configs/base_config.yaml
RENAMED
File without changes
|
run.py
CHANGED
@@ -32,7 +32,7 @@ def run_benchmark(kwargs):
|
|
32 |
arguments = [
|
33 |
"optimum-benchmark",
|
34 |
"--config-dir",
|
35 |
-
"./",
|
36 |
"--config-name",
|
37 |
"base_config",
|
38 |
f"task={task}",
|
@@ -53,8 +53,9 @@ def run_benchmark(kwargs):
|
|
53 |
else:
|
54 |
arguments.append(f"{label}={value}")
|
55 |
|
56 |
-
command = "
|
57 |
-
|
|
|
58 |
|
59 |
# stream subprocess output
|
60 |
process = subprocess.Popen(
|
@@ -86,11 +87,11 @@ def run_benchmark(kwargs):
|
|
86 |
# stream html output to gradio
|
87 |
yield gr.update(value=html_text), gr.update(interactive=False), gr.update(visible=False)
|
88 |
|
89 |
-
|
|
|
|
|
|
|
|
|
90 |
|
91 |
-
|
92 |
-
|
93 |
-
print(table.to_dict("records"))
|
94 |
-
yield gr.update(value=html_text), gr.update(interactive=True), gr.Dataframe.update(
|
95 |
-
visible=True, value={"headers": list(table.columns), "data": table.values.tolist()}
|
96 |
-
)
|
|
|
32 |
arguments = [
|
33 |
"optimum-benchmark",
|
34 |
"--config-dir",
|
35 |
+
"./configs",
|
36 |
"--config-name",
|
37 |
"base_config",
|
38 |
f"task={task}",
|
|
|
53 |
else:
|
54 |
arguments.append(f"{label}={value}")
|
55 |
|
56 |
+
command = "<br>".join(arguments)
|
57 |
+
html_text = f"<h3>Running command:</h3>{command}"
|
58 |
+
yield gr.update(value=html_text), gr.update(interactive=False), gr.update(visible=False)
|
59 |
|
60 |
# stream subprocess output
|
61 |
process = subprocess.Popen(
|
|
|
87 |
# stream html output to gradio
|
88 |
yield gr.update(value=html_text), gr.update(interactive=False), gr.update(visible=False)
|
89 |
|
90 |
+
if process.returncode != 0:
|
91 |
+
table = pd.read_csv(f"runs/{experiment_name}/{benchmark}_results.csv", index_col=0)
|
92 |
+
table_update = gr.update(visible=True, value={"headers": list(table.columns), "data": table.values.tolist()})
|
93 |
+
else:
|
94 |
+
table_update = gr.update(visible=False)
|
95 |
|
96 |
+
yield gr.update(value=html_text), gr.update(interactive=True), table_update
|
97 |
+
return
|
|
|
|
|
|
|
|