langchain
langchain copied to clipboard
Calling HuggingFacePipeline using TextGenerationPipeline results in an error.
when I call langchain.llms.HuggingFacePipeline
class using transformers.TextGenerationPipeline
class, raise bellow error.
https://github.com/hwchase17/langchain/blob/master/langchain/llms/huggingface_pipeline.py#L157
pipe = TextGenerationPipeline(model=model, tokenizer=tokenizer)
hf = HuggingFacePipeline(pipeline=pipe)
Is this behavior expected?
I may call method that is not recommended.
Calling it as pipeline("text-generation", ... )
as in example works fine.
This happens because self.model.task
is not set in transformers.TextGenerationPipeline
class.