Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -3,9 +3,10 @@ from huggingface_hub.utils import HfHubHTTPError
|
|
3 |
|
4 |
def predict(message, history):
|
5 |
try:
|
6 |
-
|
7 |
-
|
8 |
-
|
|
|
9 |
history.append((message, response))
|
10 |
return "", history
|
11 |
except HfHubHTTPError as e:
|
|
|
3 |
|
4 |
def predict(message, history):
|
5 |
try:
|
6 |
+
# Load the model and create a prediction function
|
7 |
+
iface = gr.Interface.load("models/meta-llama/Meta-Llama-3.1-8B")
|
8 |
+
fn = iface.launch(share=False,prevent_thread_lock=True)
|
9 |
+
response = fn(message) # Get the prediction using the function
|
10 |
history.append((message, response))
|
11 |
return "", history
|
12 |
except HfHubHTTPError as e:
|