annikwag commited on
Commit
fc9c340
·
verified ·
1 Parent(s): ea0e82a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -87,7 +87,7 @@ def get_rag_answer(query, top_results):
87
  # Build context from each top result using title, objectives, and description.
88
  context = "\n\n".join([build_context_for_result(res) for res in top_results])
89
  # Truncate context to 11500 tokens (approximation)
90
- context = truncate_to_tokens(context, 11500)
91
  # Improved prompt with role instruction and formatting instruction.
92
  prompt = (
93
  "You are a project portfolio adviser at the development cooperation GIZ. "
@@ -351,7 +351,7 @@ if show_exact_matches:
351
  top_results = filtered_lexical_no_dupe[:10]
352
  rag_answer = get_rag_answer(var, top_results)
353
  # Use the query as heading; increase size and center it.
354
- st.markdown(f"<h2 style='text-align:center; font-size:2.5em;'>Query: {var}</h2>", unsafe_allow_html=True)
355
  st.write(rag_answer)
356
  st.divider()
357
  for res in top_results:
 
87
  # Build context from each top result using title, objectives, and description.
88
  context = "\n\n".join([build_context_for_result(res) for res in top_results])
89
  # Truncate context to 11500 tokens (approximation)
90
+ context = truncate_to_tokens(context, 3700)
91
  # Improved prompt with role instruction and formatting instruction.
92
  prompt = (
93
  "You are a project portfolio adviser at the development cooperation GIZ. "
 
351
  top_results = filtered_lexical_no_dupe[:10]
352
  rag_answer = get_rag_answer(var, top_results)
353
  # Use the query as heading; increase size and center it.
354
+ st.markdown(f"<h2 style='text-align:center; font-size:1.5em;'>{var}</h2>", unsafe_allow_html=True)
355
  st.write(rag_answer)
356
  st.divider()
357
  for res in top_results: