Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Update appStore/rag_utils.py
Browse files- appStore/rag_utils.py +1 -1
appStore/rag_utils.py
CHANGED
@@ -101,7 +101,7 @@ def get_rag_answer(query, top_results, endpoint, token):
|
|
101 |
# Build the context
|
102 |
from appStore.rag_utils import truncate_to_tokens, build_context_for_result, compute_title
|
103 |
context = "\n\n".join([build_context_for_result(res, compute_title) for res in top_results])
|
104 |
-
context = truncate_to_tokens(context,
|
105 |
|
106 |
# Construct the prompt
|
107 |
prompt = (
|
|
|
101 |
# Build the context
|
102 |
from appStore.rag_utils import truncate_to_tokens, build_context_for_result, compute_title
|
103 |
context = "\n\n".join([build_context_for_result(res, compute_title) for res in top_results])
|
104 |
+
context = truncate_to_tokens(context,11500) # Truncate to ~11.5k tokens
|
105 |
|
106 |
# Construct the prompt
|
107 |
prompt = (
|