YassoCodes commited on
Commit
4f68941
·
verified ·
1 Parent(s): 937b07c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -7
app.py CHANGED
@@ -1,14 +1,14 @@
1
  import gradio as gr
2
 
3
- # Alternatively, for multiple responses:
4
- # chatbot_response1 = "First Gemma response."
5
- # chatbot_response2 = "Second Gemma response."
6
- # return [[chatbot_response1], [chatbot_response2]], history
7
 
8
  # Create the Gradio interface
9
  interface = gr.Interface(
10
- inputs=["textbox"], # "state" input can be removed if not used
11
- outputs=["chatbot"] # Remove "state" output if history is not used
 
12
  )
13
 
14
  # Load the model within the Gradio interface context
@@ -19,4 +19,3 @@ except Exception as e:
19
 
20
  # Launch the Gradio interface
21
  interface.launch()
22
-
 
1
  import gradio as gr
2
 
3
+ def predict(input, history=[]):
4
+ # ... (your predict function logic here)
5
+ return chatbot_response, history # Replace with your actual return values
 
6
 
7
  # Create the Gradio interface
8
  interface = gr.Interface(
9
+ fn=predict, # Pass the predict function here
10
+ inputs=["textbox", "state"], # "state" input can be removed if not used
11
+ outputs=["chatbot", "state"] # Remove "state" output if history is not used
12
  )
13
 
14
  # Load the model within the Gradio interface context
 
19
 
20
  # Launch the Gradio interface
21
  interface.launch()