-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Error while loading pipelines from yaml files #7804
Labels
Comments
IronD7
changed the title
Errors while loading pipelines from yaml files
Error while loading pipelines from yaml files
Jun 5, 2024
Hello! When loading a Pipeline from YAML, you should use The following code works properly: from haystack import Pipeline
test_pipeline = """
components:
first_addition:
init_parameters:
add: 2
type: haystack.testing.sample_components.add_value.AddFixedValue
double:
init_parameters: {}
type: haystack.testing.sample_components.double.Double
connections:
- receiver: double.value
sender: first_addition.result
max_loops_allowed: 100
metadata: {}
"""
pipeline = Pipeline.loads(test_pipeline)
print(pipeline)
# Save pipeline to YAML file
with open("test_pipeline_01.yaml", "w") as f:
f.write(test_pipeline)
# Load pipeline from YAML file
with open("test_pipeline_01.yaml", "r") as f:
pipeline = Pipeline.load(f)
print(pipeline) Can you close the issue if the problem is solved? |
That works, thanks a lot for the quick response!! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
I've tried loading a Pipeline from a yaml file, it fails with an Error. The same pipeline as a String can be deserialized successfully (see To Reproduce section)
Error message
Expected behavior
The pipeline is loaded.
Additional context
To Reproduce
The first call is fine, the second (the string was copied from the yml file) fails
FAQ Check
System:
The text was updated successfully, but these errors were encountered: