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)
| 79 | |
| 80 | ## ----------------- Conditioners Utility Functions ------------------- |
| 81 | def 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 ------------------- |
| 96 | class ExportableNumberConditioner(torch.nn.Module): |
no outgoing calls
no test coverage detected