Demote BYOM tab to CLI docs
Browse files
app.py
CHANGED
|
@@ -409,48 +409,22 @@ def build_ui() -> gr.Blocks:
|
|
| 409 |
|
| 410 |
with gr.TabItem("Benchmark your model"):
|
| 411 |
gr.Markdown(
|
| 412 |
-
"
|
| 413 |
-
"
|
| 414 |
-
"
|
| 415 |
-
"
|
| 416 |
-
"
|
| 417 |
-
"
|
| 418 |
-
"
|
| 419 |
-
"
|
| 420 |
-
"
|
| 421 |
-
"
|
| 422 |
-
"
|
| 423 |
-
"
|
| 424 |
-
"
|
| 425 |
-
"
|
| 426 |
-
"
|
| 427 |
-
"
|
| 428 |
-
"automatically.\n"
|
| 429 |
-
)
|
| 430 |
-
with gr.Row():
|
| 431 |
-
with gr.Column():
|
| 432 |
-
model_py = gr.File(label="Model definition (.py)")
|
| 433 |
-
weights = gr.File(label="Weights (.pt, optional)")
|
| 434 |
-
class_name = gr.Textbox(label="Class name",
|
| 435 |
-
value="Model")
|
| 436 |
-
output_kind = gr.Radio(
|
| 437 |
-
["watts", "shares"],
|
| 438 |
-
value="watts",
|
| 439 |
-
label="Output kind (watts = per-category power; "
|
| 440 |
-
"shares = renormalise + scale by aggregate)")
|
| 441 |
-
max_frames = gr.Slider(50, 60000, value=500, step=50,
|
| 442 |
-
label="Frames to score "
|
| 443 |
-
"(free CPU: 500 ≈ 1–2 min)")
|
| 444 |
-
batch_size = gr.Slider(1, 64, value=16, step=1,
|
| 445 |
-
label="Batch size")
|
| 446 |
-
run_btn = gr.Button("Run benchmark", variant="primary")
|
| 447 |
-
with gr.Column():
|
| 448 |
-
report_md = gr.Markdown()
|
| 449 |
-
score_file = gr.File(label="Download score.json")
|
| 450 |
-
run_btn.click(
|
| 451 |
-
run_benchmark_upload,
|
| 452 |
-
[model_py, weights, class_name, output_kind, max_frames, batch_size],
|
| 453 |
-
[report_md, score_file],
|
| 454 |
)
|
| 455 |
return demo
|
| 456 |
|
|
|
|
| 409 |
|
| 410 |
with gr.TabItem("Benchmark your model"):
|
| 411 |
gr.Markdown(
|
| 412 |
+
"Full benchmark scoring is run via the CLI on your "
|
| 413 |
+
"machine (uses up to 5 GB of UK-DALE 16 kHz V/I data "
|
| 414 |
+
"and tens of minutes on CPU):\n\n"
|
| 415 |
+
"```bash\n"
|
| 416 |
+
"pip install git+https://github.com/Saharmgh/NILMbench\n"
|
| 417 |
+
"nilmbench benchmark \\\n"
|
| 418 |
+
" --module my_model:MyModel \\\n"
|
| 419 |
+
" --weights ./my_checkpoint.pt \\\n"
|
| 420 |
+
" --data hf:Pybunny/nilmbench-ukdale \\\n"
|
| 421 |
+
" --out ./report/\n"
|
| 422 |
+
"```\n\n"
|
| 423 |
+
"See "
|
| 424 |
+
"[examples/byom_template.py](https://github.com/Saharmgh/NILMbench/blob/main/examples/byom_template.py) "
|
| 425 |
+
"and "
|
| 426 |
+
"[docs/TESTING_GUIDE.md](https://github.com/Saharmgh/NILMbench/blob/main/docs/TESTING_GUIDE.md) "
|
| 427 |
+
"for the model contract and a step-by-step recipe."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 428 |
)
|
| 429 |
return demo
|
| 430 |
|