Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Looping pipelines with a PromptBuilder is not running #7561

Closed
1 task done
bilgeyucel opened this issue Apr 19, 2024 · 7 comments
Closed
1 task done

Looping pipelines with a PromptBuilder is not running #7561

bilgeyucel opened this issue Apr 19, 2024 · 7 comments
Assignees
Labels
2.x Related to Haystack v2.0 topic:pipeline type:bug Something isn't working

Comments

@bilgeyucel
Copy link
Contributor

Describe the bug
If the PrompBuilder is the first component in looping pipelines, the pipeline gets stuck in a loop (might not be running at all) even when max_loops_allowed is set to a small number.

Error message
There's no error message. The pipeline is not outputting anything however the colab cell with pipeline.run doesn't stop running.

Expected behavior
Looping pipelines run without any problem.

Additional context
Relevant discussion: #7554

To Reproduce
Run tutorial 28: https://haystack.deepset.ai/tutorials/28_structured_output_with_loop

FAQ Check

System:

  • OS: google colab
  • GPU/CPU: CPU
  • Haystack version (commit or version number): Got the error in three versions: 2.0.0, 2.0.1, 2.1.0-rc
  • DocumentStore: -
  • Reader: -
  • Retriever: -
@bilgeyucel
Copy link
Contributor Author

Feel free to add more context @silvanocerza

@bilgeyucel bilgeyucel added 2.x Related to Haystack v2.0 topic:pipeline type:bug Something isn't working labels Apr 19, 2024
@nateostro
Copy link

Encountered this yesterday. Fixed it this morning. Will link the PR here.

@silvanocerza
Copy link
Contributor

Investigated a bit more and found out that this is actually already solved with #7531.
Tutorial is running fine on Haystack main.

Closing.

@Ovank
Copy link

Ovank commented May 8, 2024

@silvanocerza , I am still observing this issue, I did a fresh clone of main and re-ran the tutorial code with my local LLM , still process going in infinite loop . Code is also not generating any log . Can you help with the log generation issue ?

@bilgeyucel
Copy link
Contributor Author

@Ovank Thanks for the update. I tried to run tutorial 28 on google colab just now and it worked without any problems.
Which Generator are you using in your pipeline?

@Ovank
Copy link

Ovank commented May 8, 2024

@bilgeyucel , I am using HuggingFaceLocalGenerator to create generator object , Sharing snippet from my code.

from haystack.components.generators.chat import HuggingFaceLocalChatGenerator 
from haystack.components.generators import HuggingFaceLocalGenerator
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline

model_id = "./path_to_checkpoint/llama-2-7b-chat-hf/"
tokenizer = AutoTokenizer.from_pretrained(model_id,use_fast=False )

generator = HuggingFaceLocalGenerator(
    task = "text-generation", 
    huggingface_pipeline_kwargs = { 
        "model" : model_id, 
        "tokenizer" : tokenizer
    },
    generation_kwargs = {
            "temperature": 0.9,
            "max_new_tokens": 2096,
    }
)

llm = generator

@airibarne
Copy link

Any other news on this? Seems not solved in current Haystack version (2.7.0), running the tutorial as-is will result in RuntimeWarning: Pipeline is stuck running in a loop:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.x Related to Haystack v2.0 topic:pipeline type:bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants