Spaces:
Sleeping
Sleeping
Update gradio_interface.py
Browse files- gradio_interface.py +5 -3
gradio_interface.py
CHANGED
@@ -21,10 +21,12 @@ def save_to_file(text, predicted_labels):
|
|
21 |
|
22 |
# Gradio Interface
|
23 |
inputs = [
|
24 |
-
gr.Textbox(lines=7, label="Enter your text"),
|
25 |
-
gr.File(label="Upload a file")
|
26 |
]
|
27 |
|
|
|
|
|
28 |
def classify_and_save(input_text, input_file):
|
29 |
if input_text:
|
30 |
text = input_text
|
@@ -37,5 +39,5 @@ def classify_and_save(input_text, input_file):
|
|
37 |
save_to_file(text, predicted_labels)
|
38 |
return predicted_labels
|
39 |
|
40 |
-
iface = gr.Interface(fn=classify_and_save, inputs=inputs, title="Text Classifier")
|
41 |
iface.launch(share=True)
|
|
|
21 |
|
22 |
# Gradio Interface
|
23 |
inputs = [
|
24 |
+
gr.inputs.Textbox(lines=7, label="Enter your text"),
|
25 |
+
gr.inputs.File(label="Upload a file")
|
26 |
]
|
27 |
|
28 |
+
output = gr.outputs.Dataframe()
|
29 |
+
|
30 |
def classify_and_save(input_text, input_file):
|
31 |
if input_text:
|
32 |
text = input_text
|
|
|
39 |
save_to_file(text, predicted_labels)
|
40 |
return predicted_labels
|
41 |
|
42 |
+
iface = gr.Interface(fn=classify_and_save, inputs=inputs, outputs=output, title="Text Classifier")
|
43 |
iface.launch(share=True)
|