Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -3,13 +3,13 @@ from huggingface_hub.utils import HfHubHTTPError
|
|
3 |
|
4 |
def predict(message, history):
|
5 |
try:
|
6 |
-
# Create the Interface object
|
7 |
chat_interface = gr.ChatInterface.load("models/meta-llama/Meta-Llama-3.1-8B")
|
8 |
|
9 |
-
#
|
10 |
-
|
11 |
-
fn = iface.predict
|
12 |
|
|
|
13 |
response = fn(message, history)
|
14 |
history.append((message, response))
|
15 |
return "", history
|
@@ -27,4 +27,4 @@ with gr.Blocks() as demo:
|
|
27 |
|
28 |
msg.submit(predict, [msg, chatbot], [msg, chatbot])
|
29 |
|
30 |
-
demo.launch()
|
|
|
3 |
|
4 |
def predict(message, history):
|
5 |
try:
|
6 |
+
# Create the Interface object directly
|
7 |
chat_interface = gr.ChatInterface.load("models/meta-llama/Meta-Llama-3.1-8B")
|
8 |
|
9 |
+
# Get the prediction function
|
10 |
+
fn = chat_interface.predict
|
|
|
11 |
|
12 |
+
# Call the prediction function
|
13 |
response = fn(message, history)
|
14 |
history.append((message, response))
|
15 |
return "", history
|
|
|
27 |
|
28 |
msg.submit(predict, [msg, chatbot], [msg, chatbot])
|
29 |
|
30 |
+
demo.launch()
|