John Smith commited on
Commit
bcaf4b9
·
1 Parent(s): a4fcc7e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -4
app.py CHANGED
@@ -1,7 +1,16 @@
1
  import gradio as gr
2
 
3
- def greet(name):
4
- return "Hello " + name + "!!"
 
 
 
5
 
6
- iface = gr.Interface(fn=greet, inputs="text", outputs="text")
7
- iface.launch()
 
 
 
 
 
 
 
1
  import gradio as gr
2
 
3
+ # Define your model prediction function
4
+ def predict(selected_option):
5
+ # Implement your model prediction logic here based on the selected_option
6
+ result = f"You selected: {selected_option}"
7
+ return result
8
 
9
+ # Create a Dropdown input component
10
+ input_dropdown = gr.inputs.Dropdown(choices=["Option 1", "Option 2", "Option 3"])
11
+
12
+ # Create the Gradio interface
13
+ iface = gr.Interface(fn=predict, inputs=input_dropdown, outputs="text")
14
+
15
+ # Launch the interface
16
+ iface.launch()