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

Function get_conditioners

kleidiai-examples/audiogen/scripts/model.py:106–118  ·  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

104
105## Utility functions for conditioners
106def get_conditioners(model):
107 """Load the conditioners module from Stable Audio Open Small model.
108 Args:
109 model: Stable Audio Open Small model.
110 Returns:
111 sao_t5_cond: The T5 encoder.
112 sao_seconds_total_cond: The seconds_total conditioner.
113 """
114 cond_model = model.conditioner
115 t5_cond = force_t5_conditioner_float32(cond_model.conditioners["prompt"])
116 seconds_total_cond = cond_model.conditioners["seconds_total"]
117
118 return t5_cond, seconds_total_cond
119
120# Wrapper class for number conditioner
121class ExportableNumberConditioner(torch.nn.Module):

Callers 1

get_conditioners_moduleFunction · 0.70

Calls 1

Tested by

no test coverage detected