Skip to content

Commit

Permalink
textgen-silence-output-feature in terminal (langchain-ai#10402)
Browse files Browse the repository at this point in the history
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
langchain-ai#10337 it fixes (if applicable)
  
  Thanks;

---------

Co-authored-by: Abonia SOJASINGARAYAR <[email protected]>
Co-authored-by: Harrison Chase <[email protected]>
  • Loading branch information
3 people authored Sep 11, 2023
1 parent 2bd9f5d commit 3173957
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions libs/langchain/langchain/llms/textgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@ def _call(
prompt=prompt, stop=stop, run_manager=run_manager, **kwargs
):
combined_text_output += chunk.text
print(prompt + combined_text_output)
result = combined_text_output

else:
Expand All @@ -220,7 +219,6 @@ def _call(

if response.status_code == 200:
result = response.json()["results"][0]["text"]
print(prompt + result)
else:
print(f"ERROR: response: {response}")
result = ""
Expand Down Expand Up @@ -256,7 +254,6 @@ async def _acall(
prompt=prompt, stop=stop, run_manager=run_manager, **kwargs
):
combined_text_output += chunk.text
print(prompt + combined_text_output)
result = combined_text_output

else:
Expand All @@ -268,7 +265,6 @@ async def _acall(

if response.status_code == 200:
result = response.json()["results"][0]["text"]
print(prompt + result)
else:
print(f"ERROR: response: {response}")
result = ""
Expand Down

0 comments on commit 3173957

Please sign in to comment.