Spaces:
Running
Running
Commit
·
98b668c
1
Parent(s):
d620a8f
Add progress indicators during evaluation
Browse files- Add gr.Progress() parameter to run_evaluation function
- Display progress messages: "Evaluating with Qwen3...", "Evaluating with RWKV7...", "Generating visualization..."
- Show progress bar with percentage (10%, 50%, 90%)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
app.py
CHANGED
|
@@ -182,7 +182,7 @@ def wrap_html_in_iframe(html: str) -> str:
|
|
| 182 |
'''
|
| 183 |
|
| 184 |
|
| 185 |
-
def run_evaluation(text: str):
|
| 186 |
"""Run evaluation on both models and generate visualization."""
|
| 187 |
from core.evaluator import evaluate_hf_single_sample, evaluate_rwkv7_single_sample
|
| 188 |
from visualization.html_generator import generate_comparison_html
|
|
@@ -199,7 +199,7 @@ def run_evaluation(text: str):
|
|
| 199 |
|
| 200 |
try:
|
| 201 |
# Step 1: Evaluate Qwen (using cached model)
|
| 202 |
-
|
| 203 |
result_qwen = evaluate_hf_single_sample(
|
| 204 |
_qwen_model,
|
| 205 |
_qwen_tokenizer,
|
|
@@ -208,7 +208,7 @@ def run_evaluation(text: str):
|
|
| 208 |
)
|
| 209 |
|
| 210 |
# Step 2: Evaluate RWKV7 (using cached model)
|
| 211 |
-
|
| 212 |
result_rwkv = evaluate_rwkv7_single_sample(
|
| 213 |
_rwkv_model,
|
| 214 |
_rwkv_tokenizer,
|
|
@@ -216,7 +216,7 @@ def run_evaluation(text: str):
|
|
| 216 |
)
|
| 217 |
|
| 218 |
# Step 3: Generate visualization
|
| 219 |
-
|
| 220 |
html = generate_comparison_html(
|
| 221 |
text=text,
|
| 222 |
byte_losses_a=result_qwen["byte_wise_losses"],
|
|
|
|
| 182 |
'''
|
| 183 |
|
| 184 |
|
| 185 |
+
def run_evaluation(text: str, progress=gr.Progress()):
|
| 186 |
"""Run evaluation on both models and generate visualization."""
|
| 187 |
from core.evaluator import evaluate_hf_single_sample, evaluate_rwkv7_single_sample
|
| 188 |
from visualization.html_generator import generate_comparison_html
|
|
|
|
| 199 |
|
| 200 |
try:
|
| 201 |
# Step 1: Evaluate Qwen (using cached model)
|
| 202 |
+
progress(0.1, desc="Evaluating with Qwen3...")
|
| 203 |
result_qwen = evaluate_hf_single_sample(
|
| 204 |
_qwen_model,
|
| 205 |
_qwen_tokenizer,
|
|
|
|
| 208 |
)
|
| 209 |
|
| 210 |
# Step 2: Evaluate RWKV7 (using cached model)
|
| 211 |
+
progress(0.5, desc="Evaluating with RWKV7...")
|
| 212 |
result_rwkv = evaluate_rwkv7_single_sample(
|
| 213 |
_rwkv_model,
|
| 214 |
_rwkv_tokenizer,
|
|
|
|
| 216 |
)
|
| 217 |
|
| 218 |
# Step 3: Generate visualization
|
| 219 |
+
progress(0.9, desc="Generating visualization...")
|
| 220 |
html = generate_comparison_html(
|
| 221 |
text=text,
|
| 222 |
byte_losses_a=result_qwen["byte_wise_losses"],
|