Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -26,12 +26,12 @@ WRITE_ACCESS_TOKEN = st.secrets["Llama_3_1"]
|
|
26 |
|
27 |
def get_rag_answer(query, top_results):
|
28 |
context = "\n\n".join([res.payload["page_content"] for res in top_results])
|
29 |
-
max_context_chars =
|
30 |
if len(context) > max_context_chars:
|
31 |
context = context[:max_context_chars]
|
32 |
prompt = (
|
33 |
"You are a project portfolio adviser at the development cooperation GIZ. "
|
34 |
-
"Using the following context, answer the question precisely. "
|
35 |
"Only output the final answer below, without repeating the context or question.\n\n"
|
36 |
f"Context:\n{context}\n\n"
|
37 |
f"Question: {query}\n\n"
|
|
|
26 |
|
27 |
def get_rag_answer(query, top_results):
|
28 |
context = "\n\n".join([res.payload["page_content"] for res in top_results])
|
29 |
+
max_context_chars = 23500
|
30 |
if len(context) > max_context_chars:
|
31 |
context = context[:max_context_chars]
|
32 |
prompt = (
|
33 |
"You are a project portfolio adviser at the development cooperation GIZ. "
|
34 |
+
"Using the following context, answer the question in english precisely. "
|
35 |
"Only output the final answer below, without repeating the context or question.\n\n"
|
36 |
f"Context:\n{context}\n\n"
|
37 |
f"Question: {query}\n\n"
|