alejandro-ao / langchain-ask-pdf

An AI-app that allows you to upload a PDF and ask questions about it. It uses OpenAI's LLMs to generate a response.
584 stars 308 forks source link

Get a longer answer #16

Open thvi opened 1 year ago

thvi commented 1 year ago

Hello,

Is it possible to get longer answers? Because the answers are too vague.

Question: is Langchain to have a larger database so that it can provide more relevant answers? Let me explain: I'd like him to go beyond a simple summary of the content, but to provide his understanding so that his answer can guide us in understanding the document. Of course, LLMs can have hallucinations, so we need to be aware of this.

Thanks.

almahdibakkali96 commented 1 year ago

I believe you should ask your question the other way around: Are LLMs able to take large databases? Yes, thanks to Langchain as a tool, and because OpenAI LLM can now ingest up to tens of thousands of tokens, the answer is yes. Also, you can tell the LLM to be less random with your prompt. A low temperature will also help (many examples I saw use 0.2)

Edit: I hope this helps

eyesuk commented 10 months ago

if you are using LLAMA2 you can pass it the -n flag and it will provide longer answers

-n N, --n-predict N: Set the number of tokens to predict when generating text. Adjusting this value can influence the length of the generated text.