Spaces:
Running
Running
update
Browse files
app.py
CHANGED
@@ -15,14 +15,12 @@ def classify(text):
|
|
15 |
predicted_class = torch.argmax(logits, dim=1).item()
|
16 |
return str(predicted_class)
|
17 |
|
18 |
-
#
|
19 |
with gr.Blocks() as demo:
|
20 |
txt_in = gr.Textbox(label="Enter text")
|
21 |
txt_out = gr.Textbox(label="Prediction")
|
22 |
btn = gr.Button("Classify")
|
23 |
btn.click(classify, txt_in, txt_out)
|
24 |
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
demo.launch()
|
|
|
15 |
predicted_class = torch.argmax(logits, dim=1).item()
|
16 |
return str(predicted_class)
|
17 |
|
18 |
+
# Create Gradio interface
|
19 |
with gr.Blocks() as demo:
|
20 |
txt_in = gr.Textbox(label="Enter text")
|
21 |
txt_out = gr.Textbox(label="Prediction")
|
22 |
btn = gr.Button("Classify")
|
23 |
btn.click(classify, txt_in, txt_out)
|
24 |
|
25 |
+
# Launch with API enabled
|
26 |
+
demo.launch()
|
|
|
|