langchain icon indicating copy to clipboard operation
langchain copied to clipboard

GPT4All: is there an argument to set if a prompt echos on the console?

Open h3x49r4m opened this issue 2 years ago • 2 comments

In the GPT4All, the prompts/contexts are always printed out on the console.
Is there any argument to set if a prompt echos or not on the console?

I supposed it was echo, yet, whether it is True or False, the prompts/contexts were stdout.

Setup

from langchain.llms import GPT4All

llm = GPT4All(model=model_path, echo=True, ...)

Output: On the console, GPT4All automatically prints the prompts + a model response.

Assistant is a large language model trained by OpenAI.

Assistant is designed to be able to assist with a wide range of tasks, from answering simple questions to providing in-depth explanations and discussions on a wide range of topics. As a language model, Assistant is able to generate human-like text based on the input it receives, allowing it to engage in natural-sounding conversations and provide responses that are coherent and relevant to the topic at hand.

Assistant is constantly learning and improving, and its capabilities are constantly evolving. It is able to process and understand large amounts of text, and can use this knowledge to provide accurate and informative responses to a wide range of questions. Additionally, Assistant is able to generate its own text based on the input it receives, allowing it to engage in discussions and provide explanations and descriptions on a wide range of topics.

Overall, Assistant is a powerful tool that can help with a wide range of tasks and provide valuable insights and information on a wide range of topics. Whether you need help with a specific question or just want to have a conversation about a particular topic, Assistant is here to assist.


Human: Hi
Assistant:
Assistant is a large language model trained by OpenAI.

Assistant is designed to be able to assist with a wide range of tasks, from answering simple questions to providing in-depth explanations and discussions on a wide range of topics. As a language model, Assistant is able to generate human-like text based on the input it receives, allowing it to engage in natural-sounding conversations and provide responses that are coherent and relevant to the topic at hand.
....

Expected Output: Users control if prompts/contexts are printed out, GPT4All just outputs the corresponding predicted n_tokens.

Assistant is a large language model trained by OpenAI.

Assistant is designed to be able to assist with a wide range of tasks, from answering simple questions to providing in-depth explanations and discussions on a wide range of topics. As a language model, Assistant is able to generate human-like text based on the input it receives, allowing it to engage in natural-sounding conversations and provide responses that are coherent and relevant to the topic at hand.

Assistant is constantly learning and improving, and its capabilities are constantly evolving. It is able to process and understand large amounts of text, and can use this knowledge to provide accurate and informative responses to a wide range of questions. Additionally, Assistant is able to generate its own text based on the input it receives, allowing it to engage in discussions and provide explanations and descriptions on a wide range of topics.

Overall, Assistant is a powerful tool that can help with a wide range of tasks and provide valuable insights and information on a wide range of topics. Whether you need help with a specific question or just want to have a conversation about a particular topic, Assistant is here to assist.


Human: Hi
Assistant:
How are you?

Human: ....
Assistant:
...

Human: ...
Assistant:
...

h3x49r4m avatar Apr 20 '23 04:04 h3x49r4m

Same issue. It appears pyllamacpp also doesn't have an option to disable this. Worse yet, working around it by just ignoring the first X tokens results in a long pause at the start of generation.

zaptrem avatar Apr 27 '23 20:04 zaptrem

@zaptrem Two options came up to my settings.

  • Cloning pyllamacpp, modifying the code, maintaining the modified version corresponding to specific purposes.
  • Setting verbose=False, then the console log will not be printed out, yet, the speed of response generation is still not fast enough for an edge device, especially for those long prompts based on a long context.

h3x49r4m avatar Apr 28 '23 02:04 h3x49r4m

Hi, @h3x49r4m! I'm Dosu, and I'm here to help the LangChain team manage their backlog. I wanted to let you know that we are marking this issue as stale.

From what I understand, you raised an issue about adding an argument in GPT4All to control whether prompts/contexts are printed out on the console. zaptrem also commented on the issue, mentioning that the current workaround of ignoring the first X tokens results in a long pause at the start of generation. You suggested two options: modifying the code of pyllamacpp or setting verbose=False to disable console logs. However, you mentioned that the response generation speed is still not fast enough for an edge device.

Before we close this issue, we wanted to check with you if it is still relevant to the latest version of the LangChain repository. If it is, please let us know by commenting on the issue. Otherwise, feel free to close the issue yourself or it will be automatically closed in 7 days.

Thank you for your contribution to the LangChain repository!

dosubot[bot] avatar Sep 02 '23 16:09 dosubot[bot]