MCPcopy Create free account
hub / github.com/Arm-Examples/ML-examples / get_conditioners

Function get_conditioners

kleidiai-examples/audiogen-et/scripts/model.py:81–93  ·  view source on GitHub ↗

Load the conditioners module from Stable Audio Open Small model. Args: model: Stable Audio Open Small model. Returns: sao_t5_cond: The T5 encoder. sao_seconds_total_cond: The seconds_total conditioner.

(model)

Source from the content-addressed store, hash-verified

79
80## ----------------- Conditioners Utility Functions -------------------
81def get_conditioners(model):
82 """Load the conditioners module from Stable Audio Open Small model.
83 Args:
84 model: Stable Audio Open Small model.
85 Returns:
86 sao_t5_cond: The T5 encoder.
87 sao_seconds_total_cond: The seconds_total conditioner.
88 """
89 cond_model = model.conditioner
90 t5_cond = cond_model.conditioners["prompt"]
91 seconds_total_cond = cond_model.conditioners["seconds_total"]
92
93 return t5_cond, seconds_total_cond
94
95## ----------------- Wrapper Class -------------------
96class ExportableNumberConditioner(torch.nn.Module):

Callers 1

get_conditioners_moduleFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected