textgen-silence-output-feature in terminal (#10402)

Hello,
Added the new feature to silence TextGen's output in the terminal.

- Description: Added a new feature to control printing of TextGen's
output to the terminal.,
- Issue: the issue #TextGen parameter to silence the print in terminal
#10337 it fixes (if applicable)
  
  Thanks;

---------

Co-authored-by: Abonia SOJASINGARAYAR <abonia.sojasingarayar@loreal.com>
Co-authored-by: Harrison Chase <hw.chase.17@gmail.com>
pull/10465/head
Abonia Sojasingarayar 12 months ago committed by GitHub
parent 2bd9f5da7f
commit 31739577c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -208,7 +208,6 @@ class TextGen(LLM):
prompt=prompt, stop=stop, run_manager=run_manager, **kwargs
):
combined_text_output += chunk.text
print(prompt + combined_text_output)
result = combined_text_output
else:
@ -220,7 +219,6 @@ class TextGen(LLM):
if response.status_code == 200:
result = response.json()["results"][0]["text"]
print(prompt + result)
else:
print(f"ERROR: response: {response}")
result = ""
@ -256,7 +254,6 @@ class TextGen(LLM):
prompt=prompt, stop=stop, run_manager=run_manager, **kwargs
):
combined_text_output += chunk.text
print(prompt + combined_text_output)
result = combined_text_output
else:
@ -268,7 +265,6 @@ class TextGen(LLM):
if response.status_code == 200:
result = response.json()["results"][0]["text"]
print(prompt + result)
else:
print(f"ERROR: response: {response}")
result = ""

Loading…
Cancel
Save