mirror of
https://github.com/hwchase17/langchain
synced 2024-11-06 03:20:49 +00:00
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>
This commit is contained in:
parent
2bd9f5da7f
commit
31739577c2
@ -208,7 +208,6 @@ class TextGen(LLM):
|
|||||||
prompt=prompt, stop=stop, run_manager=run_manager, **kwargs
|
prompt=prompt, stop=stop, run_manager=run_manager, **kwargs
|
||||||
):
|
):
|
||||||
combined_text_output += chunk.text
|
combined_text_output += chunk.text
|
||||||
print(prompt + combined_text_output)
|
|
||||||
result = combined_text_output
|
result = combined_text_output
|
||||||
|
|
||||||
else:
|
else:
|
||||||
@ -220,7 +219,6 @@ class TextGen(LLM):
|
|||||||
|
|
||||||
if response.status_code == 200:
|
if response.status_code == 200:
|
||||||
result = response.json()["results"][0]["text"]
|
result = response.json()["results"][0]["text"]
|
||||||
print(prompt + result)
|
|
||||||
else:
|
else:
|
||||||
print(f"ERROR: response: {response}")
|
print(f"ERROR: response: {response}")
|
||||||
result = ""
|
result = ""
|
||||||
@ -256,7 +254,6 @@ class TextGen(LLM):
|
|||||||
prompt=prompt, stop=stop, run_manager=run_manager, **kwargs
|
prompt=prompt, stop=stop, run_manager=run_manager, **kwargs
|
||||||
):
|
):
|
||||||
combined_text_output += chunk.text
|
combined_text_output += chunk.text
|
||||||
print(prompt + combined_text_output)
|
|
||||||
result = combined_text_output
|
result = combined_text_output
|
||||||
|
|
||||||
else:
|
else:
|
||||||
@ -268,7 +265,6 @@ class TextGen(LLM):
|
|||||||
|
|
||||||
if response.status_code == 200:
|
if response.status_code == 200:
|
||||||
result = response.json()["results"][0]["text"]
|
result = response.json()["results"][0]["text"]
|
||||||
print(prompt + result)
|
|
||||||
else:
|
else:
|
||||||
print(f"ERROR: response: {response}")
|
print(f"ERROR: response: {response}")
|
||||||
result = ""
|
result = ""
|
||||||
|
Loading…
Reference in New Issue
Block a user