Spaces:
Running
Running
New: Add proper input form
Browse files
app.py
CHANGED
|
@@ -1,7 +1,20 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
-
def
|
| 4 |
-
return
|
| 5 |
|
| 6 |
-
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
+
def predict(review: str, display_mode: str):
|
| 4 |
+
return review + " | " + display_mode
|
| 5 |
|
| 6 |
+
iface = gr.Interface(
|
| 7 |
+
fn=predict,
|
| 8 |
+
inputs=[
|
| 9 |
+
gr.Textbox(label="Whisky Review", lines=8, placeholder="Nose: peat smoke, sherry and vanilla..."),
|
| 10 |
+
gr.Dropdown(label="Display mode", choices=["table", "JSON"], value="table"),
|
| 11 |
+
],
|
| 12 |
+
outputs=[
|
| 13 |
+
gr.HTML(label="Table"),
|
| 14 |
+
gr.JSON(label="JSON"),
|
| 15 |
+
],
|
| 16 |
+
title="Submit Whisky Review for Classification",
|
| 17 |
+
description="Paste an English whisky review, choose display mode, then submit.",
|
| 18 |
+
)
|
| 19 |
+
|
| 20 |
+
iface.launch()
|