mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-17 10:13:29 +00:00
community: fix HuggingFacePipeline pipeline_kwargs (#19920)
Fix handling of pipeline_kwargs to prioritize class attribute defaults. #19770 Co-authored-by: jaizo <manuel.jaiczay@polygons.at> Co-authored-by: Isaac Francisco <78627776+isahers1@users.noreply.github.com>
This commit is contained in:
parent
4b63a217c2
commit
1c31234eed
@ -261,7 +261,10 @@ class HuggingFacePipeline(BaseLLM):
|
||||
) -> LLMResult:
|
||||
# List to hold all results
|
||||
text_generations: List[str] = []
|
||||
pipeline_kwargs = kwargs.get("pipeline_kwargs", {})
|
||||
|
||||
default_pipeline_kwargs = self.pipeline_kwargs if self.pipeline_kwargs else {}
|
||||
pipeline_kwargs = kwargs.get("pipeline_kwargs", default_pipeline_kwargs)
|
||||
|
||||
skip_prompt = kwargs.get("skip_prompt", False)
|
||||
|
||||
for i in range(0, len(prompts), self.batch_size):
|
||||
|
Loading…
Reference in New Issue
Block a user