Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
"""
|
| 2 |
-
HF Space App for V38.2-PRO-
|
| 3 |
Supports running 3 ablation experiment modes: A, B, C
|
| 4 |
"""
|
| 5 |
import gradio as gr
|
|
@@ -25,7 +25,7 @@ def run_training(modes_str):
|
|
| 25 |
training_running = False
|
| 26 |
return "Error: invalid modes"
|
| 27 |
|
| 28 |
-
training_log.append(f"Starting
|
| 29 |
|
| 30 |
for mode in valid_modes:
|
| 31 |
current_mode = mode
|
|
@@ -38,7 +38,7 @@ def run_training(modes_str):
|
|
| 38 |
|
| 39 |
try:
|
| 40 |
process = subprocess.Popen(
|
| 41 |
-
['python', '
|
| 42 |
stdout=subprocess.PIPE,
|
| 43 |
stderr=subprocess.STDOUT,
|
| 44 |
text=True,
|
|
@@ -70,7 +70,7 @@ def run_training(modes_str):
|
|
| 70 |
training_log.append(f"{'='*60}")
|
| 71 |
|
| 72 |
for mode in valid_modes:
|
| 73 |
-
result_file = f'output/
|
| 74 |
if os.path.exists(result_file):
|
| 75 |
with open(result_file) as f:
|
| 76 |
r = json.load(f)
|
|
@@ -105,7 +105,7 @@ def check_status():
|
|
| 105 |
def view_results():
|
| 106 |
results = {}
|
| 107 |
for mode in ['A', 'B', 'C']:
|
| 108 |
-
result_file = f'output/
|
| 109 |
if os.path.exists(result_file):
|
| 110 |
with open(result_file) as f:
|
| 111 |
results[f'Mode_{mode}'] = json.load(f)
|
|
@@ -114,8 +114,8 @@ def view_results():
|
|
| 114 |
return "No results found yet."
|
| 115 |
return json.dumps(results, indent=2)
|
| 116 |
|
| 117 |
-
with gr.Blocks(title="V38.2-PRO-
|
| 118 |
-
gr.Markdown("# V38.2-PRO-
|
| 119 |
gr.Markdown("""
|
| 120 |
**Experiment Modes:**
|
| 121 |
- **A**: Full model with all features (keep act_bert_pca)
|
|
|
|
| 1 |
"""
|
| 2 |
+
HF Space App for V38.2-PRO-V12.1 Training
|
| 3 |
Supports running 3 ablation experiment modes: A, B, C
|
| 4 |
"""
|
| 5 |
import gradio as gr
|
|
|
|
| 25 |
training_running = False
|
| 26 |
return "Error: invalid modes"
|
| 27 |
|
| 28 |
+
training_log.append(f"Starting V12.1 training for modes: {valid_modes}")
|
| 29 |
|
| 30 |
for mode in valid_modes:
|
| 31 |
current_mode = mode
|
|
|
|
| 38 |
|
| 39 |
try:
|
| 40 |
process = subprocess.Popen(
|
| 41 |
+
['python', 'train_v38_2_pro_v12_1.py'],
|
| 42 |
stdout=subprocess.PIPE,
|
| 43 |
stderr=subprocess.STDOUT,
|
| 44 |
text=True,
|
|
|
|
| 70 |
training_log.append(f"{'='*60}")
|
| 71 |
|
| 72 |
for mode in valid_modes:
|
| 73 |
+
result_file = f'output/v38_2_pro_v12_1_mode_{mode}_results.json'
|
| 74 |
if os.path.exists(result_file):
|
| 75 |
with open(result_file) as f:
|
| 76 |
r = json.load(f)
|
|
|
|
| 105 |
def view_results():
|
| 106 |
results = {}
|
| 107 |
for mode in ['A', 'B', 'C']:
|
| 108 |
+
result_file = f'output/v38_2_pro_v12_1_mode_{mode}_results.json'
|
| 109 |
if os.path.exists(result_file):
|
| 110 |
with open(result_file) as f:
|
| 111 |
results[f'Mode_{mode}'] = json.load(f)
|
|
|
|
| 114 |
return "No results found yet."
|
| 115 |
return json.dumps(results, indent=2)
|
| 116 |
|
| 117 |
+
with gr.Blocks(title="V38.2-PRO-V12.1 Training") as demo:
|
| 118 |
+
gr.Markdown("# V38.2-PRO-V12.1: Expanded Supp + PS V5 + Activity Labels")
|
| 119 |
gr.Markdown("""
|
| 120 |
**Experiment Modes:**
|
| 121 |
- **A**: Full model with all features (keep act_bert_pca)
|