| 197 | } // namespace |
| 198 | |
| 199 | VibeVoiceSession::VibeVoiceSession( |
| 200 | runtime::TaskSpec task, |
| 201 | runtime::SessionOptions options, |
| 202 | std::shared_ptr<const VibeVoiceAssets> assets) |
| 203 | : runtime::RuntimeSessionBase(require_supported_backend_options(options)), |
| 204 | task_(task), |
| 205 | assets_(apply_vibevoice_finetune_options(require_assets(std::move(assets)), options.options)), |
| 206 | text_tokenizer_(assets_), |
| 207 | audio_tokenizer_( |
| 208 | assets_, |
| 209 | options.backend.type, |
| 210 | options.backend.device, |
| 211 | options.backend.threads, |
| 212 | 256ull * 1024ull * 1024ull, |
| 213 | 128ull * 1024ull * 1024ull, |
| 214 | options.options.find("vibevoice.tokenizer_weight_type") != options.options.end() |
| 215 | ? engine::assets::parse_tensor_storage_type(options.options.at("vibevoice.tokenizer_weight_type")) |
| 216 | : (options.options.find("vibevoice.weight_type") != options.options.end() |
| 217 | ? engine::assets::parse_tensor_storage_type(options.options.at("vibevoice.weight_type")) |
| 218 | : engine::assets::TensorStorageType::Native)), |
| 219 | connector_( |
| 220 | assets_, |
| 221 | options.backend.type, |
| 222 | options.backend.device, |
| 223 | options.backend.threads, |
| 224 | 64ull * 1024ull * 1024ull, |
| 225 | 32ull * 1024ull * 1024ull, |
| 226 | options.options.find("vibevoice.connector_weight_type") != options.options.end() |
| 227 | ? engine::assets::parse_tensor_storage_type(options.options.at("vibevoice.connector_weight_type")) |
| 228 | : (options.options.find("vibevoice.weight_type") != options.options.end() |
| 229 | ? engine::assets::parse_tensor_storage_type(options.options.at("vibevoice.weight_type")) |
| 230 | : engine::assets::TensorStorageType::Native)), |
| 231 | decoder_( |
| 232 | assets_, |
| 233 | options.backend.type, |
| 234 | options.backend.device, |
| 235 | options.backend.threads, |
| 236 | 256ull * 1024ull * 1024ull, |
| 237 | 128ull * 1024ull * 1024ull, |
| 238 | options.options.find("vibevoice.decoder_weight_type") != options.options.end() |
| 239 | ? engine::assets::parse_tensor_storage_type(options.options.at("vibevoice.decoder_weight_type")) |
| 240 | : (options.options.find("vibevoice.weight_type") != options.options.end() |
| 241 | ? engine::assets::parse_tensor_storage_type(options.options.at("vibevoice.weight_type")) |
| 242 | : engine::assets::TensorStorageType::Native)), |
| 243 | diffusion_head_( |
| 244 | assets_, |
| 245 | options.backend.type, |
| 246 | options.backend.device, |
| 247 | options.backend.threads, |
| 248 | 64ull * 1024ull * 1024ull, |
| 249 | 64ull * 1024ull * 1024ull, |
| 250 | options.options.find("vibevoice.diffusion_head_weight_type") != options.options.end() |
| 251 | ? engine::assets::parse_tensor_storage_type(options.options.at("vibevoice.diffusion_head_weight_type")) |
| 252 | : (options.options.find("vibevoice.weight_type") != options.options.end() |
| 253 | ? engine::assets::parse_tensor_storage_type(options.options.at("vibevoice.weight_type")) |
| 254 | : engine::assets::TensorStorageType::Native)) {} |
| 255 | |
| 256 | std::string VibeVoiceSession::family() const { |
nothing calls this directly
no test coverage detected