Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -3,11 +3,11 @@ from huggingface_hub.utils import HfHubHTTPError
|
|
3 |
|
4 |
def predict(message, history):
|
5 |
try:
|
6 |
-
#
|
7 |
-
chat_interface = gr.
|
8 |
|
9 |
-
#
|
10 |
-
response = chat_interface(message
|
11 |
history.append((message, response))
|
12 |
return "", history
|
13 |
|
@@ -23,5 +23,3 @@ with gr.Blocks() as demo:
|
|
23 |
clear = gr.ClearButton([msg, chatbot])
|
24 |
|
25 |
msg.submit(predict, [msg, chatbot], [msg, chatbot])
|
26 |
-
|
27 |
-
demo.launch()
|
|
|
3 |
|
4 |
def predict(message, history):
|
5 |
try:
|
6 |
+
# Load the model interface directly using the load method
|
7 |
+
chat_interface = gr.Interface.load("models/meta-llama/Meta-Llama-3.1-8B")
|
8 |
|
9 |
+
# Get the prediction using the correct method call
|
10 |
+
response = chat_interface.predict(message)
|
11 |
history.append((message, response))
|
12 |
return "", history
|
13 |
|
|
|
23 |
clear = gr.ClearButton([msg, chatbot])
|
24 |
|
25 |
msg.submit(predict, [msg, chatbot], [msg, chatbot])
|
|
|
|