Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -221,7 +221,7 @@ def ask_question(question, temperature, top_p, repetition_penalty, web_search):
|
|
| 221 |
context_str = "\n".join([doc.page_content for doc in relevant_docs])
|
| 222 |
|
| 223 |
prompt_val = ChatPromptTemplate.from_template(prompt)
|
| 224 |
-
formatted_prompt = prompt_val.format(history=history_str, context=context_str, question=question)
|
| 225 |
|
| 226 |
answer = generate_chunked_response(model, formatted_prompt)
|
| 227 |
answer = re.split(r'Question:|Current Question:', answer)[-1].strip()
|
|
|
|
| 221 |
context_str = "\n".join([doc.page_content for doc in relevant_docs])
|
| 222 |
|
| 223 |
prompt_val = ChatPromptTemplate.from_template(prompt)
|
| 224 |
+
formatted_prompt = prompt_val.format(history=history_str, context=context_str if not web_search else "", question=question)
|
| 225 |
|
| 226 |
answer = generate_chunked_response(model, formatted_prompt)
|
| 227 |
answer = re.split(r'Question:|Current Question:', answer)[-1].strip()
|