Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -35,6 +35,17 @@ from transformers import (
|
|
35 |
# Medical knowledge validation
|
36 |
import re
|
37 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
# Configure logging
|
39 |
logging.basicConfig(
|
40 |
level=logging.INFO,
|
@@ -843,6 +854,9 @@ def create_optimized_gradio_interface():
|
|
843 |
variant="secondary",
|
844 |
scale=1
|
845 |
)
|
|
|
|
|
|
|
846 |
|
847 |
with gr.Column(scale=1):
|
848 |
# Quick Access
|
|
|
35 |
# Medical knowledge validation
|
36 |
import re
|
37 |
|
38 |
+
import subprocess
|
39 |
+
import gradio as gr
|
40 |
+
|
41 |
+
def train_model():
|
42 |
+
result = subprocess.run(["python", "train_flan_t5.py"], capture_output=True, text=True)
|
43 |
+
if result.returncode == 0:
|
44 |
+
return "✅ Model training complete!"
|
45 |
+
else:
|
46 |
+
return f"❌ Training failed:\n{result.stderr}"
|
47 |
+
|
48 |
+
|
49 |
# Configure logging
|
50 |
logging.basicConfig(
|
51 |
level=logging.INFO,
|
|
|
854 |
variant="secondary",
|
855 |
scale=1
|
856 |
)
|
857 |
+
train_btn = gr.Button("Train")
|
858 |
+
train_output = gr.Textbox(label="Training Status", lines=10)
|
859 |
+
train_btn.click(train_model, outputs=train_output)
|
860 |
|
861 |
with gr.Column(scale=1):
|
862 |
# Quick Access
|