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)
| 104 | |
| 105 | ## Utility functions for conditioners |
| 106 | def 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 |
| 121 | class ExportableNumberConditioner(torch.nn.Module): |
no test coverage detected