reduce prompt context length

This commit is contained in:
nash_su
2024-04-05 20:46:54 +08:00
parent f9a0553b27
commit 4df9559a78
2 changed files with 3 additions and 1 deletions
Binary file not shown.
+3 -1
View File
@@ -167,7 +167,9 @@ def chat(prompt, stream=True, debug=False):
def ask_internet(query:str, debug=False):
content_list = search_web_ref(query,debug=debug)
prompt = gen_prompt(query,content_list,context_length_limit=8000,debug=debug)
if debug:
print(content_list)
prompt = gen_prompt(query,content_list,context_length_limit=7000,debug=debug)
total_token = ""
for token in chat(prompt=prompt):