Spaces:
Sleeping
Sleeping
Kevin Fink
commited on
Commit
·
affb25b
1
Parent(s):
f7961d6
gradio fix
Browse files
app.py
CHANGED
@@ -62,21 +62,25 @@ def predict(text):
|
|
62 |
return "Positive" if predictions.item() == 1 else "Negative"
|
63 |
'''
|
64 |
# Create Gradio interface
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
|
|
|
|
|
|
|
|
80 |
|
81 |
# Launch the interface
|
82 |
iface.launch()
|
|
|
62 |
return "Positive" if predictions.item() == 1 else "Negative"
|
63 |
'''
|
64 |
# Create Gradio interface
|
65 |
+
try:
|
66 |
+
|
67 |
+
iface = gr.Interface(
|
68 |
+
fine_tune_model,
|
69 |
+
inputs=[
|
70 |
+
gr.inputs.Textbox(label="Model Name (e.g., 'google/t5-efficient-tiny-nh8')"),
|
71 |
+
gr.inputs.Textbox(label="Dataset Name (e.g., 'imdb')"),
|
72 |
+
gr.inputs.Textbox(label="HF hub to push to after training"),
|
73 |
+
gr.inputs.Slider(minimum=1, maximum=10, default=3, label="Number of Epochs"),
|
74 |
+
gr.inputs.Slider(minimum=1, maximum=16, default=4, label="Batch Size"),
|
75 |
+
gr.inputs.Slider(minimum=1, maximum=1000, default=50, label="Learning Rate (e-6)"),
|
76 |
+
gr.inputs.Slider(minimum=1, maximum=100, default=1, label="Gradient accumulation (e-1)"),
|
77 |
+
],
|
78 |
+
outputs="text",
|
79 |
+
title="Fine-Tune Hugging Face Model",
|
80 |
+
description="This interface allows you to fine-tune a Hugging Face model on a specified dataset."
|
81 |
+
)
|
82 |
+
except Exception as e:
|
83 |
+
print(f"An error occurred: {str(e)}, TB: {traceback.format_exc()}")
|
84 |
|
85 |
# Launch the interface
|
86 |
iface.launch()
|