frostymelonade commited on
Commit
18057d4
Β·
1 Parent(s): 695c722

Changed app to use Block to add label names

Browse files
Files changed (1) hide show
  1. app.py +10 -1
app.py CHANGED
@@ -20,4 +20,13 @@ def classify_pun(text):
20
  label = "Pun" if predictions[0][0][0] < predictions[0][0][1] else "Not a pun"
21
  return label, str(predictions[0][0])
22
 
23
- gr.Interface(fn=classify_pun, inputs=["text"], outputs=["text", "text"]).launch()
 
 
 
 
 
 
 
 
 
 
20
  label = "Pun" if predictions[0][0][0] < predictions[0][0][1] else "Not a pun"
21
  return label, str(predictions[0][0])
22
 
23
+ #gr.Interface(fn=classify_pun, inputs=["text"], outputs=["text", "text"]).launch()
24
+ with gr.Blocks() as demo:
25
+ text = gr.Textbox(label="Text")
26
+ output = gr.Textbox(label="Classification")
27
+ output2 = gr.Textbox(label="Probabilities")
28
+ greet_btn = gr.Button("Submit")
29
+ greet_btn.click(fn=classify_pun, inputs=name, outputs=[output, output2], api_name="classify_pun")
30
+
31
+
32
+ demo.launch()