Spaces:
Runtime error
Runtime error
Commit
·
16af54d
1
Parent(s):
20c0e12
Update app.py
Browse files
app.py
CHANGED
@@ -15,17 +15,6 @@ If a question does not make any sense, or is not factually coherent, explain why
|
|
15 |
# Define the conversation history
|
16 |
conversation_history = []
|
17 |
|
18 |
-
# Create a Gradio interface
|
19 |
-
gr.Interface(
|
20 |
-
fn=None,
|
21 |
-
inputs=gr.Textbox(placeholder="Type a message..."),
|
22 |
-
outputs=gr.Textbox(""),
|
23 |
-
live=True,
|
24 |
-
layout="vertical",
|
25 |
-
title="MISTGPT",
|
26 |
-
theme="huggingface",
|
27 |
-
).launch()
|
28 |
-
|
29 |
|
30 |
def generate_response(input_text):
|
31 |
global conversation_history
|
@@ -36,3 +25,13 @@ def generate_response(input_text):
|
|
36 |
conversation_history.append({"role": "assistant", "content": response_text})
|
37 |
|
38 |
return response_text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
# Define the conversation history
|
16 |
conversation_history = []
|
17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
|
19 |
def generate_response(input_text):
|
20 |
global conversation_history
|
|
|
25 |
conversation_history.append({"role": "assistant", "content": response_text})
|
26 |
|
27 |
return response_text
|
28 |
+
# Create a Gradio interface
|
29 |
+
gr.Interface(
|
30 |
+
fn=generate_response,
|
31 |
+
inputs=gr.Textbox(placeholder="Type a message..."),
|
32 |
+
outputs=gr.Textbox(" "),
|
33 |
+
live=True,
|
34 |
+
layout="vertical",
|
35 |
+
title="MISTGPT",
|
36 |
+
theme="huggingface",
|
37 |
+
).launch()
|