Pipeline Instanitation using from_confg
#9613
-
Could you provide some assistance with how to instantiate a pipeline using You will see in the code below that I've created a pipeline using The code then saves the pipeline config file to disk and instantiates a new pipeline using the same config file. Rather than using ... continues below code `
` You will see in this output that the original pipeline with the custom component works, and the new pipeline contains the custom component. However, you will also see how the pipeline names are different and that attempting to run the pipeline throws up an error. Do you know what the problem is and how it may be solved? `
` |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The config contains state about the pipeline components, but it doesn't contain all the state, so when you make a new pipeline and initialize it from the old config you get all the same components but they aren't ready to go. You don't get patterns, and components aren't initialized, which is why you get that error. You can read more about this process in "serializing the pipeline".
I am not sure what you mean by "a default set of patterns", but those methods should save all your patterns. You could save one Language per use case if you need to differentiate patterns. That said, loading serialized patterns is basically the same as just loading patterns normally (there are no speed benefits or anything), so if it's easier you can also just save your patterns somewhere and load them at runtime. |
Beta Was this translation helpful? Give feedback.
The config contains state about the pipeline components, but it doesn't contain all the state, so when you make a new pipeline and initialize it from the old config you get all the same components but they aren't ready to go. You don't get patterns, and components aren't initialized, which is why you get that error. You can read more about this process in "serializing the pipeline".
I am not sure what you mean by "a default set of patterns", but those methods should save all your patterns. You could save one Language per use c…