neuralworm commited on
Commit
810d58b
·
verified ·
1 Parent(s): a5ad114

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -3,9 +3,10 @@ from huggingface_hub.utils import HfHubHTTPError
3
 
4
  def predict(message, history):
5
  try:
6
- response = gr.Interface.load(
7
- "models/meta-llama/Meta-Llama-3.1-8B"
8
- ).predict(message, history)
 
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: