Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -206,10 +206,11 @@ class DocumentRAG:
|
|
206 |
if not self.qa_chain:
|
207 |
return history + [("System", "Please process the documents first.")]
|
208 |
try:
|
209 |
-
preface =
|
210 |
-
Instruction: Respond in {language}. Be professional and concise,
|
211 |
-
If you cannot provide an answer, say: "
|
212 |
-
""
|
|
|
213 |
query = f"{preface}\nQuery: {question}"
|
214 |
|
215 |
result = self.qa_chain({
|
|
|
206 |
if not self.qa_chain:
|
207 |
return history + [("System", "Please process the documents first.")]
|
208 |
try:
|
209 |
+
preface = (
|
210 |
+
f"Instruction: Respond in {language}. Be professional and concise, "
|
211 |
+
f"keeping the response under 300 words. If you cannot provide an answer, say: "
|
212 |
+
f'"I am not sure about this question. Please try asking something else."'
|
213 |
+
)
|
214 |
query = f"{preface}\nQuery: {question}"
|
215 |
|
216 |
result = self.qa_chain({
|