Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,14 +1,14 @@
|
|
1 |
import gradio as gr
|
2 |
|
3 |
-
|
4 |
-
#
|
5 |
-
#
|
6 |
-
# return [[chatbot_response1], [chatbot_response2]], history
|
7 |
|
8 |
# Create the Gradio interface
|
9 |
interface = gr.Interface(
|
10 |
-
|
11 |
-
|
|
|
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()
|
|