fixed response formatting when streaming

This commit is contained in:
Richard Guo
2023-05-18 11:34:39 -04:00
parent 860193b9e8
commit c679d35eb1
3 changed files with 5 additions and 3 deletions

View File

@@ -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 = {

View File

@@ -225,6 +225,8 @@ class LLModel:
# Revert to old stdout
sys.stdout = old_stdout
# Force new line
print()
return stream_processor.output