neuralworm commited on
Commit
22cbf8a
·
verified ·
1 Parent(s): fdae6e7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -7,14 +7,14 @@ def predict(message, history):
7
  # Create the Interface object directly
8
  iface = gr.Interface(
9
  fn=gr.ChatInterface.load("models/meta-llama/Meta-Llama-3.1-8B"),
10
- inputs="textbox",
11
- outputs="textbox",
12
  )
13
 
14
  # Launch the interface and get the prediction function
15
  with iface:
16
  fn = iface.predict
17
-
18
  response = fn(message, history)
19
  history.append((message, response))
20
  return "", history
@@ -26,7 +26,9 @@ def predict(message, history):
26
  raise e
27
 
28
 
29
- with gr.Blocks() as demo:
 
 
30
  chatbot = gr.Chatbot()
31
  msg = gr.Textbox()
32
  clear = gr.ClearButton([msg, chatbot])
 
7
  # Create the Interface object directly
8
  iface = gr.Interface(
9
  fn=gr.ChatInterface.load("models/meta-llama/Meta-Llama-3.1-8B"),
10
+ chatbot=gr.Chatbot(), # Use gr.Chatbot() directly
11
+ textbox=gr.Textbox(),
12
  )
13
 
14
  # Launch the interface and get the prediction function
15
  with iface:
16
  fn = iface.predict
17
+
18
  response = fn(message, history)
19
  history.append((message, response))
20
  return "", history
 
26
  raise e
27
 
28
 
29
+ demo = gr.Blocks()
30
+
31
+ with demo:
32
  chatbot = gr.Chatbot()
33
  msg = gr.Textbox()
34
  clear = gr.ClearButton([msg, chatbot])