persadian commited on
Commit
5b1c8cd
·
verified ·
1 Parent(s): 15d5208

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +49 -18
app.py CHANGED
@@ -1,29 +1,60 @@
 
 
 
1
  import gradio as gr
2
 
3
- from components.overview import overview_ui
4
- from components.spec import spec_ui
5
- from components.evaluation import eval_ui
6
- from components.runtime import runtime_ui
7
- from components.registry import registry_ui
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
 
9
- with gr.Blocks(title="DFQS v1.0 Standard") as demo:
10
 
11
- gr.Markdown("# DFQS v1.0 — DeepSeek Flash Quantization Standard")
12
- gr.Markdown("Ultra-Low-Bit MoE Deployment Specification Hub")
13
 
14
- with gr.Tab("Overview"):
15
- overview_ui()
16
 
17
- with gr.Tab("Specification"):
18
- spec_ui()
 
 
 
19
 
20
- with gr.Tab("Evaluation"):
21
- eval_ui()
22
 
23
- with gr.Tab("Runtime"):
24
- runtime_ui()
 
 
 
25
 
26
  with gr.Tab("Registry"):
27
- registry_ui()
28
 
29
- demo.launch()
 
1
+ # FILE: app.py
2
+ # TYPE: Main Gradio Application (Entry Point)
3
+
4
  import gradio as gr
5
 
6
+ from validator import validate_dfqs
7
+ from benchmarks import run_benchmarks
8
+ from registry import save_model, list_models
9
+
10
+
11
+ def evaluate_model(name, architecture, size, runtime, cpu_flag):
12
+
13
+ model_info = {
14
+ "name": name,
15
+ "architecture": architecture,
16
+ "size_gb": float(size),
17
+ "runtime": runtime,
18
+ "cpu_feasible": cpu_flag
19
+ }
20
+
21
+ validation = validate_dfqs(model_info)
22
+ benchmarks = run_benchmarks(name)
23
+
24
+ result = {
25
+ "model": model_info,
26
+ "validation": validation,
27
+ "benchmarks": benchmarks
28
+ }
29
+
30
+ if validation["compliant"]:
31
+ save_model(result)
32
+
33
+ return result
34
+
35
 
36
+ with gr.Blocks(title="DFQS v1.0 Standard Engine") as app:
37
 
38
+ gr.Markdown("# DFQS Standard Engine")
 
39
 
40
+ with gr.Tab("Validator"):
 
41
 
42
+ name = gr.Textbox(label="Model Name")
43
+ arch = gr.Textbox(label="Architecture")
44
+ size = gr.Number(label="Size (GB)")
45
+ runtime = gr.Dropdown(["llama.cpp", "gguf", "other"])
46
+ cpu = gr.Checkbox(label="CPU Feasible")
47
 
48
+ btn = gr.Button("Evaluate DFQS Compliance")
49
+ out = gr.JSON()
50
 
51
+ btn.click(
52
+ evaluate_model,
53
+ inputs=[name, arch, size, runtime, cpu],
54
+ outputs=out
55
+ )
56
 
57
  with gr.Tab("Registry"):
58
+ gr.JSON(list_models())
59
 
60
+ app.launch()