Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
|
| 3 |
+
with gr.Blocks() as demo:
|
| 4 |
+
gr.Markdown("# Train a Text Classifier with Synthetic Data")
|
| 5 |
+
labels = gr.Dropdown(choices=[], value=[], label="Classes", allow_custom_value=True, multiselect=True)
|
| 6 |
+
|
| 7 |
+
@gr.render(inputs=[labels])
|
| 8 |
+
def show_textbox(labels_):
|
| 9 |
+
with gr.Row():
|
| 10 |
+
for label in labels_:
|
| 11 |
+
gr.TextArea(label=f"Samples for class: {label}")
|
| 12 |
+
if len(labels_)>=2:
|
| 13 |
+
with gr.Row():
|
| 14 |
+
gr.Button("TRAIN!", variant="primary")
|
| 15 |
+
|
| 16 |
+
demo.launch()
|