Cyantist8208 commited on
Commit
0c3749b
·
1 Parent(s): 8f9cb9f
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -105,7 +105,7 @@ def answer(question: str, user_id="demo", history="None"):
105
  try:
106
  if not question.strip():
107
  return "Please ask a question."
108
- if history and not kb[user_id]["texts"]:
109
  return "No reference passage yet. Add one first."
110
 
111
  context = ""
@@ -120,6 +120,8 @@ def answer(question: str, user_id="demo", history="None"):
120
  elif history == "All":
121
  store = kb[user_id]
122
  context = "\n".join(store["texts"])
 
 
123
 
124
  # 2. Build a Qwen-chat prompt (helper defined earlier)
125
  prompt = build_qwen_prompt(context, question)
 
105
  try:
106
  if not question.strip():
107
  return "Please ask a question."
108
+ if history != "None" and not kb[user_id]["texts"]:
109
  return "No reference passage yet. Add one first."
110
 
111
  context = ""
 
120
  elif history == "All":
121
  store = kb[user_id]
122
  context = "\n".join(store["texts"])
123
+
124
+ print(f"history: {history}\ncontext: {context}")
125
 
126
  # 2. Build a Qwen-chat prompt (helper defined earlier)
127
  prompt = build_qwen_prompt(context, question)