I'm working in Azure Machine Learning Studio to create components that I will run together in a pipeline. In this basic example, I have a single python
script and a single yml
file that make up my component, along with a notebook I am using to define, instantiate and run a pipeline. See an overview of the folder structure I have below for this component.
📦component
┣ 📜notebook.ipynb
┣ 📜component_script.py
â”— đź“ścomponent_def.yml
Inside my notebook I can then load the component and register it to the workspace using the code below (note that here I have already instantiated my ml_client
object).
# importing the Component Package
from azure.ai.ml import load_component
# Loading the component from the yml file
component = load_component("component_def.yml")
# Now we register the component to the workspace
component = ml_client.create_or_update(component)
I can then pass this component into a pipeline successfully. My question is, now that I have registered my component, I should no longer need to instantiate my component object using component = load_component("component_def.yml")
which requires access to the yml
file. I should instead be able to instantiate my component object from the registered component. How can I do this?