diff --git a/gpt4all-bindings/python/gpt4all/gpt4all.py b/gpt4all-bindings/python/gpt4all/gpt4all.py index bee3f3cd..f24ee226 100644 --- a/gpt4all-bindings/python/gpt4all/gpt4all.py +++ b/gpt4all-bindings/python/gpt4all/gpt4all.py @@ -155,7 +155,7 @@ class GPT4All(): print("Model downloaded at: " + download_path) return download_path - def generate(self, prompt: str, streaming: bool = False, **generate_kwargs) -> str: + def generate(self, prompt: str, streaming: bool = True, **generate_kwargs) -> str: """ Surfaced method of running generate without accessing model object. @@ -211,7 +211,7 @@ class GPT4All(): response = self.model.generate(full_prompt, streaming=streaming, **generate_kwargs) - if verbose: + if verbose and not streaming: print(response) response_dict = { diff --git a/gpt4all-bindings/python/gpt4all/pyllmodel.py b/gpt4all-bindings/python/gpt4all/pyllmodel.py index f7d32399..b6737fd1 100644 --- a/gpt4all-bindings/python/gpt4all/pyllmodel.py +++ b/gpt4all-bindings/python/gpt4all/pyllmodel.py @@ -225,6 +225,8 @@ class LLModel: # Revert to old stdout sys.stdout = old_stdout + # Force new line + print() return stream_processor.output diff --git a/gpt4all-bindings/python/setup.py b/gpt4all-bindings/python/setup.py index c4c44448..5709542b 100644 --- a/gpt4all-bindings/python/setup.py +++ b/gpt4all-bindings/python/setup.py @@ -61,7 +61,7 @@ copy_prebuilt_C_lib(SRC_CLIB_DIRECtORY, setup( name=package_name, - version="0.2.2", + version="0.2.3", description="Python bindings for GPT4All", author="Richard Guo", author_email="richard@nomic.ai",