Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -192,6 +192,15 @@ def create_interface():
|
|
| 192 |
value=check_gpu_status(),
|
| 193 |
interactive=False,
|
| 194 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 195 |
num_epochs = gr.Slider(1, 3, value=1, step=1, label="Epochs")
|
| 196 |
batch_size = gr.Slider(1, 4, value=2, step=1, label="Batch Size")
|
| 197 |
learning_rate = gr.Number(value=5e-5, label="Learning Rate")
|
|
@@ -205,15 +214,14 @@ def create_interface():
|
|
| 205 |
value="Click 'Start Fine-tuning' to train on the Gita dataset and upload to your model repo.",
|
| 206 |
)
|
| 207 |
|
|
|
|
| 208 |
train_btn.click(
|
| 209 |
fn=train_model,
|
| 210 |
-
inputs=[
|
| 211 |
outputs=output,
|
| 212 |
)
|
| 213 |
|
| 214 |
return demo
|
| 215 |
-
|
| 216 |
-
|
| 217 |
if __name__ == "__main__":
|
| 218 |
demo = create_interface()
|
| 219 |
demo.launch()
|
|
|
|
| 192 |
value=check_gpu_status(),
|
| 193 |
interactive=False,
|
| 194 |
)
|
| 195 |
+
|
| 196 |
+
# hidden constant input for model name
|
| 197 |
+
model_name = gr.Textbox(
|
| 198 |
+
value="Qwen/Qwen2.5-0.5B",
|
| 199 |
+
label="Base Model",
|
| 200 |
+
interactive=False,
|
| 201 |
+
visible=False
|
| 202 |
+
)
|
| 203 |
+
|
| 204 |
num_epochs = gr.Slider(1, 3, value=1, step=1, label="Epochs")
|
| 205 |
batch_size = gr.Slider(1, 4, value=2, step=1, label="Batch Size")
|
| 206 |
learning_rate = gr.Number(value=5e-5, label="Learning Rate")
|
|
|
|
| 214 |
value="Click 'Start Fine-tuning' to train on the Gita dataset and upload to your model repo.",
|
| 215 |
)
|
| 216 |
|
| 217 |
+
# ✅ Fixed: pass components, not strings
|
| 218 |
train_btn.click(
|
| 219 |
fn=train_model,
|
| 220 |
+
inputs=[model_name, num_epochs, batch_size, learning_rate],
|
| 221 |
outputs=output,
|
| 222 |
)
|
| 223 |
|
| 224 |
return demo
|
|
|
|
|
|
|
| 225 |
if __name__ == "__main__":
|
| 226 |
demo = create_interface()
|
| 227 |
demo.launch()
|