mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-19 11:08:55 +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:
|
) -> LLMResult:
|
||||||
# List to hold all results
|
# List to hold all results
|
||||||
text_generations: List[str] = []
|
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)
|
skip_prompt = kwargs.get("skip_prompt", False)
|
||||||
|
|
||||||
for i in range(0, len(prompts), self.batch_size):
|
for i in range(0, len(prompts), self.batch_size):
|
||||||
|
Loading…
Reference in New Issue
Block a user