SatyamSinghal commited on
Commit
5a9105e
·
verified ·
1 Parent(s): 2046ab7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -27,11 +27,8 @@ pipe = pipeline(
27
 
28
  def respond(message, history):
29
  messages = []
30
- for user_msg, assistant_msg in history:
31
- if user_msg:
32
- messages.append({"role": "user", "content": user_msg})
33
- if assistant_msg:
34
- messages.append({"role": "assistant", "content": assistant_msg})
35
 
36
  messages.append({"role": "user", "content": message})
37
 
@@ -50,6 +47,7 @@ def respond(message, history):
50
 
51
  demo = gr.ChatInterface(
52
  fn=respond,
 
53
  title="TaskMind Interface",
54
  description="Chat with the TaskMind LoRA model.",
55
  examples=[
 
27
 
28
  def respond(message, history):
29
  messages = []
30
+ for item in history:
31
+ messages.append({"role": item["role"], "content": item["content"]})
 
 
 
32
 
33
  messages.append({"role": "user", "content": message})
34
 
 
47
 
48
  demo = gr.ChatInterface(
49
  fn=respond,
50
+ type="messages",
51
  title="TaskMind Interface",
52
  description="Chat with the TaskMind LoRA model.",
53
  examples=[