mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-06-22 05:29:20 +00:00
fixed response formatting when streaming
This commit is contained in:
parent
860193b9e8
commit
c679d35eb1
@ -155,7 +155,7 @@ class GPT4All():
|
|||||||
print("Model downloaded at: " + download_path)
|
print("Model downloaded at: " + download_path)
|
||||||
return 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.
|
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)
|
response = self.model.generate(full_prompt, streaming=streaming, **generate_kwargs)
|
||||||
|
|
||||||
if verbose:
|
if verbose and not streaming:
|
||||||
print(response)
|
print(response)
|
||||||
|
|
||||||
response_dict = {
|
response_dict = {
|
||||||
|
@ -225,6 +225,8 @@ class LLModel:
|
|||||||
|
|
||||||
# Revert to old stdout
|
# Revert to old stdout
|
||||||
sys.stdout = old_stdout
|
sys.stdout = old_stdout
|
||||||
|
# Force new line
|
||||||
|
print()
|
||||||
|
|
||||||
return stream_processor.output
|
return stream_processor.output
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ copy_prebuilt_C_lib(SRC_CLIB_DIRECtORY,
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name=package_name,
|
name=package_name,
|
||||||
version="0.2.2",
|
version="0.2.3",
|
||||||
description="Python bindings for GPT4All",
|
description="Python bindings for GPT4All",
|
||||||
author="Richard Guo",
|
author="Richard Guo",
|
||||||
author_email="richard@nomic.ai",
|
author_email="richard@nomic.ai",
|
||||||
|
Loading…
Reference in New Issue
Block a user