The agent engineering platform.
Python agentsaiai-agentsanthropicchatgptdeepagentsenterpriseframeworkgeminigenerative-ailangchainlanggraphllmmultiagentopen-sourceopenaipydanticpythonragtypescript
feat(llms): add missing params to huggingface text-generation (#9724)
Massimiliano Pronestia7c9bd30d47d
diff --git a/libs/langchain/langchain/llms/huggingface_text_gen_inference.py b/libs/langchain/langchain/llms/huggingface_text_gen_inference.pyindex 8e23d935f8..284890579b 100644--- a/libs/langchain/langchain/llms/huggingface_text_gen_inference.py+++ b/libs/langchain/langchain/llms/huggingface_text_gen_inference.py@@ -80,6 +80,7 @@ class HuggingFaceTextGenInference(LLM):typical_p: Optional[float] = 0.95temperature: float = 0.8repetition_penalty: Optional[float] = None+ return_full_text: bool = Falsetruncate: Optional[int] = Nonestop_sequences: List[str] = Field(default_factory=list)seed: Optional[int] = None@@ -87,6 +88,8 @@ class HuggingFaceTextGenInference(LLM):timeout: int = 120server_kwargs: Dict[str, Any] = Field(default_factory=dict)streaming: bool = False+ do_sample: bool = False+ watermark: bool = Falseclient: Anyasync_client: Any@@ -134,9 +137,12 @@ class HuggingFaceTextGenInference(LLM):"typical_p": self.typical_p,"temperature": self.temperature,"repetition_penalty": self.repetition_penalty,+ "return_full_text": self.return_full_text,"truncate": self.truncate,"stop_sequences": self.stop_sequences,"seed": self.seed,+ "do_sample": self.do_sample,+ "watermark": self.watermark,}def _invocation_params(