quivr icon indicating copy to clipboard operation
quivr copied to clipboard

Prompt word invalid

Open canw1nter opened this issue 1 year ago • 3 comments

When i use verbose mode,the logs:

Use the following pieces of context to answer the question at the end. If you don't know the answer, just say that you don't know, don't try to make up an answer.

....

Question: ....
Helpful Answer:

My prompt doesn't include at the end, maybe the prompt in LANGUAGE_PROMPT.py doesn't override the default prompt in Langchain.

My prompt: Use the following pieces of context to answer the question in Chinese. If you don't know the answer, just say that you don't know, don't try to make up an answer.

canw1nter avatar May 25 '23 08:05 canw1nter

How can i solve it? Or it's because I didn't use it correctly?

canw1nter avatar May 26 '23 10:05 canw1nter

#Try this backend/llm/qa.py

from llm import LANGUAGE_PROMPT from llm.LANGUAGE_PROMPT import CONDENSE_QUESTION_PROMPT, QA_PROMPT

ChatOpenAI( model_name=chat_message.model, openai_api_key=openai_api_key, temperature=chat_message.temperature, max_tokens=chat_message.max_tokens), vector_store.as_retriever(), memory=memory, verbose=True, max_tokens_limit=1024, combine_docs_chain_kwargs={'prompt': QA_PROMPT}, condense_question_prompt=CONDENSE_QUESTION_PROMPT)

whoaisk avatar Jun 08 '23 09:06 whoaisk

@whoaisk That solution seems to have worked for me. Thank you so much!

@canw1nter did it not work for you?

JarrodWoodard avatar Jun 08 '23 17:06 JarrodWoodard

@whoaisk That solution seems to have worked for me. Thank you so much!

@canw1nter did it not work for you?

it's worked, thank you!

canw1nter avatar Jun 19 '23 08:06 canw1nter