Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -7,14 +7,14 @@ def predict(message, history):
|
|
7 |
# Create the Interface object directly
|
8 |
iface = gr.Interface(
|
9 |
fn=gr.ChatInterface.load("models/meta-llama/Meta-Llama-3.1-8B"),
|
10 |
-
|
11 |
-
|
12 |
)
|
13 |
|
14 |
# Launch the interface and get the prediction function
|
15 |
with iface:
|
16 |
fn = iface.predict
|
17 |
-
|
18 |
response = fn(message, history)
|
19 |
history.append((message, response))
|
20 |
return "", history
|
@@ -26,7 +26,9 @@ def predict(message, history):
|
|
26 |
raise e
|
27 |
|
28 |
|
29 |
-
|
|
|
|
|
30 |
chatbot = gr.Chatbot()
|
31 |
msg = gr.Textbox()
|
32 |
clear = gr.ClearButton([msg, chatbot])
|
|
|
7 |
# Create the Interface object directly
|
8 |
iface = gr.Interface(
|
9 |
fn=gr.ChatInterface.load("models/meta-llama/Meta-Llama-3.1-8B"),
|
10 |
+
chatbot=gr.Chatbot(), # Use gr.Chatbot() directly
|
11 |
+
textbox=gr.Textbox(),
|
12 |
)
|
13 |
|
14 |
# Launch the interface and get the prediction function
|
15 |
with iface:
|
16 |
fn = iface.predict
|
17 |
+
|
18 |
response = fn(message, history)
|
19 |
history.append((message, response))
|
20 |
return "", history
|
|
|
26 |
raise e
|
27 |
|
28 |
|
29 |
+
demo = gr.Blocks()
|
30 |
+
|
31 |
+
with demo:
|
32 |
chatbot = gr.Chatbot()
|
33 |
msg = gr.Textbox()
|
34 |
clear = gr.ClearButton([msg, chatbot])
|