mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-09-25 19:44:59 +00:00
update:prompt length
This commit is contained in:
@@ -256,8 +256,7 @@ def http_bot(state, mode, sql_mode, db_selector, temperature, max_new_tokens, re
|
|||||||
prompt = state.get_prompt()
|
prompt = state.get_prompt()
|
||||||
if len(prompt) > 4000:
|
if len(prompt) > 4000:
|
||||||
logger.info("prompt length greater than 4000, rebuild")
|
logger.info("prompt length greater than 4000, rebuild")
|
||||||
docs = knowledge_embedding_client.similar_search(query, 5)
|
context = context[:2000]
|
||||||
context = [d.page_content for d in docs]
|
|
||||||
prompt_template = PromptTemplate(
|
prompt_template = PromptTemplate(
|
||||||
template=conv_qa_prompt_template,
|
template=conv_qa_prompt_template,
|
||||||
input_variables=["context", "question"]
|
input_variables=["context", "question"]
|
||||||
|
Reference in New Issue
Block a user