Aishu-7 commited on
Commit
71362cd
·
verified ·
1 Parent(s): 13df604

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -73,8 +73,9 @@ cleaned_chunks = preprocess_text(knowledge_base)
73
  client = InferenceClient("Qwen/Qwen2.5-7B-Instruct")
74
 
75
  def respond(message, history):
76
-
77
- messages = [{"role": "system", "content": "You are a friendly chatbot."}]
 
78
 
79
  if history:
80
  messages.extend(history)
 
73
  client = InferenceClient("Qwen/Qwen2.5-7B-Instruct")
74
 
75
  def respond(message, history):
76
+ top_chunks = get_top_chunks(message, chunk_embeddings, cleaned_chunks)
77
+ context = "\n".join(top_chunks)
78
+ messages = [{"role": "system","content": f"You are a friendly chatbot. Use this context to answer:\n{context}"
79
 
80
  if history:
81
  messages.extend(history)