Amii2410 commited on
Commit
e1bacaf
·
verified ·
1 Parent(s): 2f94f4c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -73,7 +73,11 @@ with gr.Blocks() as demo:
73
 
74
  with gr.Row():
75
  txt = gr.Textbox(lines=3, label="Complaint text", value="Pothole on main road causing damage.")
76
- cat = gr.Textbox(lines=1, label="Category (water, electricity, gas, road, garbage)", value="road")
 
 
 
 
77
 
78
  with gr.Row():
79
  complaints_in = gr.Number(value=1, label="Number of distinct complaints (integer)")
@@ -86,7 +90,7 @@ with gr.Blocks() as demo:
86
  inputs=[txt, cat, complaints_in, upvotes_in],
87
  outputs=output)
88
 
89
- # Move demo.load INSIDE the Blocks context
90
  demo.load(
91
  lambda: handle_complaint(
92
  "Water pipeline leakage near market area.",
 
73
 
74
  with gr.Row():
75
  txt = gr.Textbox(lines=3, label="Complaint text", value="Pothole on main road causing damage.")
76
+ cat = gr.Dropdown(
77
+ choices=["water", "electricity", "gas", "road", "garbage"],
78
+ value="road",
79
+ label="Category"
80
+ )
81
 
82
  with gr.Row():
83
  complaints_in = gr.Number(value=1, label="Number of distinct complaints (integer)")
 
90
  inputs=[txt, cat, complaints_in, upvotes_in],
91
  outputs=output)
92
 
93
+ # Example load
94
  demo.load(
95
  lambda: handle_complaint(
96
  "Water pipeline leakage near market area.",