gpt4all icon indicating copy to clipboard operation
gpt4all copied to clipboard

DOC: CLI documentation is needed

Open AndriyMulyar opened this issue 1 year ago • 2 comments

Issue with current documentation:

Needs section for CLI binding

Idea or request for content:

Add CLI to documentation https://github.com/nomic-ai/gpt4all/tree/main/gpt4all-bindings%2Fcli

AndriyMulyar avatar May 20 '23 14:05 AndriyMulyar

I can't tell if the CLI version is good-to-go - I'm getting an error when I run it:

Traceback (most recent call last):

  File "/Users/micah/Downloads/A.I./gpt4all/gpt4all-bindings/cli/app.py", line 118, in <module>
    app()

  File "/Users/micah/Downloads/A.I./gpt4all/gpt4all-bindings/cli/app.py", line 88, in repl
    full_response = gpt4all_instance.chat_completion(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/Users/micah/Downloads/A.I./gpt4all/gpt4all-bindings/python/gpt4all/gpt4all.py", line 212, in chat_completion
    response = self.model.generate(full_prompt, streaming=streaming, **generate_kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

TypeError: LLModel.generate() got an unexpected keyword argument 'std_passthrough'

PlebeiusGaragicus avatar May 24 '23 19:05 PlebeiusGaragicus

Here is the change I used to get the cli version working:

+++ b/gpt4all-bindings/cli/app.py
@@ -35,7 +35,7 @@ Type /help for special commands.
 
 def _cli_override_response_callback(token_id, response):
     resp = response.decode("utf-8")
-    print(resp, end="", flush=True)
+    print(resp, end="")
     return True
 
 
@@ -102,8 +102,7 @@ def repl(
             repeat_last_n=64,
             context_erase=0.0,
             # required kwargs for cli ux (incremental response)
-            verbose=False,
-            std_passthrough=True,
+            verbose=False
         )
         # record assistant's response to messages
         MESSAGES.append(full_response.get("choices")[0].get("message"))

as cli command I used: python3 app.py repl -t 16 --model ggml-gpt4all-l13b-snoozy

thbley avatar Jun 03 '23 15:06 thbley

In case someone stumbles on this: The CLI was fixed and is working with v0.3.4 of the PyPI package since b66d0b4fffdbab6b67820fd7f1e1db8b779da8f5.

cosmic-snow avatar Jun 20 '23 01:06 cosmic-snow