Open bibhas2 opened 3 months ago
When initializing the HuggingFacePipeline Class like this:
pipeline = pipeline(
"text-generation",
"TinyLlama/TinyLlama-1.1B-Chat-v1.0")
llm = HuggingFacePipeline(
pipeline=pipeline,
pipeline_kwargs={"max_new_tokens": 128}
)
The pipeline_kwargs gets overwritten and that is why it takes so long. This is probably a bug right now. But It works like this:
llm = HuggingFacePipeline.from_model_id(
model_id="TinyLlama/TinyLlama-1.1B-Chat-v1.0",
task="text-generation",
pipeline_kwargs={"max_new_tokens": 128}
)
@Jaiczay I can verify that your suggested solution works.
The stop
argument is not used in HuggingFacePiepeline. Therefor, agents don't work properly.
Checked other resources
Example Code
I create a pipeline.
I use the pipeline directly and get a response back in seconds.
Ignore the wrong answer :-)
Then I try to do the same using Langchain.
This code never ends. It seems to be stuck here.
Error Message and Stack Trace (if applicable)
No response
Description
Langchain chain never finishes executing. This seems to be a problem with
HuggingFacePipeline
as the same prompt works fine with Open AI.System Info
pip show output: