mgetz commited on
Commit
50db1d8
·
verified ·
1 Parent(s): b23a0cc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -107,8 +107,9 @@ def get_top_chunks(query, chunk_embeddings, text_chunks):
107
  client = InferenceClient("Qwen/Qwen2.5-7B-Instruct-1M")
108
 
109
  def respond(message, history):
110
-
111
- messages = [{"role": "system", "content": "You are a friendly chatbot."}]
 
112
 
113
  if history:
114
  messages.extend(history)
@@ -129,10 +130,7 @@ def yes_no(message, history):
129
  chatbot = gr.ChatInterface(respond, type="messages")
130
 
131
  # Call the get_top_chunks function with the original query
132
- top_results = get_top_chunks(message, chunk_embeddings, cleaned_chunks)
133
 
134
- # Print the top results
135
- print(top_results)
136
 
137
 
138
 
 
107
  client = InferenceClient("Qwen/Qwen2.5-7B-Instruct-1M")
108
 
109
  def respond(message, history):
110
+ top_results = get_top_chunks(message, chunk_embeddings, cleaned_chunks)
111
+ print(top_results)
112
+ messages = [{"role": "system", "content": f"You are a friendly chatbot. You give people advice about brushing their teeth. Base your response on the following information {top_results}"}]
113
 
114
  if history:
115
  messages.extend(history)
 
130
  chatbot = gr.ChatInterface(respond, type="messages")
131
 
132
  # Call the get_top_chunks function with the original query
 
133
 
 
 
134
 
135
 
136