Skip to main content

Loading a model

To load a model in a custom recipe, you should use the harmony client and provide the model path to the model method:

Passing models as input

If a model should be given as input, there are two ways to give it.

From the context

In custom recipes, you are always asked to input a model to train. This model is retrieved from the recipe context in the attribute model_to_train. The model can then by loaded using the client. Make sure to pass the model path attribute to the harmony client and not the model itself.

From the config

In custom recipes, you can pass models in the recipe config. The model is then loaded by giving its path to the harmony client.

Load a model from Hugging Face

Use load_from_hf() to load models directly from Hugging Face if you have an internet connection: