neuralworm commited on
Commit
ee0b947
·
verified ·
1 Parent(s): e4278da

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -6
app.py CHANGED
@@ -3,14 +3,11 @@ from huggingface_hub.utils import HfHubHTTPError
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
16
 
 
3
 
4
  def predict(message, history):
5
  try:
6
+ # Define the model interface directly using the load method
7
  chat_interface = gr.ChatInterface.load("models/meta-llama/Meta-Llama-3.1-8B")
 
 
 
8
 
9
+ # Use the interface to get predictions
10
+ response = chat_interface(message, history)
11
  history.append((message, response))
12
  return "", history
13