anna1au commited on
Commit
53e1500
·
verified ·
1 Parent(s): 6081287

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -13
app.py CHANGED
@@ -80,23 +80,15 @@ def get_top_chunks(query, chunk_embeddings, text_chunks):
80
  # Return the list of most relevant chunks
81
  return top_chunks
82
 
83
- client = InferenceClient("microsoft/phi-4")
84
-
85
- def respond (message, history):
86
- information = get_top_chunks(message,chunk_embeddings,cleaned_chunks)
87
-
88
- messages = [{"role": "system", "content":"You are a friendly chatbot."}]
89
 
 
 
90
  if history:
91
  messages.extend(history)
92
-
93
  messages.append({"role": "user", "content": message})
94
-
95
- response = client.chat_completion(
96
- messages, max_tokens = 150, temperature = 0.2
97
- )
98
-
99
- return response
100
 
101
  chatBot = gr.ChatInterface(respond, type = "messages")
102
  chatBot.launch()
 
80
  # Return the list of most relevant chunks
81
  return top_chunks
82
 
83
+ client = InferenceClient("Qwen/Qwen2.5-7B-Instruct-1M")
 
 
 
 
 
84
 
85
+ def respond(message, history):
86
+ messages = [{"role":"system", "content": "You are a friendly chatbot."}]
87
  if history:
88
  messages.extend(history)
 
89
  messages.append({"role": "user", "content": message})
90
+ response = client.chat_completion(messages,max_tokens=100)
91
+ return response["choices"][0]["message"]["content"].strip()
 
 
 
 
92
 
93
  chatBot = gr.ChatInterface(respond, type = "messages")
94
  chatBot.launch()