Skip to content

The agent engineering platform.

One Line Fix: missing text output with huggingface TGI LLM (#7972)

Wian Stipp0ffb7fc10cf3
diff --git a/langchain/llms/huggingface_text_gen_inference.py b/langchain/llms/huggingface_text_gen_inference.py
index 1bd150de65..012dd29a5c 100644
--- a/langchain/llms/huggingface_text_gen_inference.py
+++ b/langchain/llms/huggingface_text_gen_inference.py
@@ -255,4 +255,5 @@ class HuggingFaceTextGenInference(LLM):
if not token.special:
if text_callback:
await text_callback(token.text)
+ text += token.text
return text