| 715 | return weights; |
| 716 | } |
| 717 | |
| 718 | std::shared_ptr<const Vevo2CocoTokenizerWeights> load_coco_tokenizer_weights( |
| 719 | const Vevo2CocoTokenizerConfig & config, |
| 720 | const char * name, |
| 721 | ggml_backend_t backend, |
| 722 | engine::core::BackendType backend_type, |
| 723 | size_t weight_context_bytes, |
| 724 | engine::assets::TensorStorageType matmul_storage_type, |
| 725 | engine::assets::TensorStorageType conv_storage_type, |
| 726 | const engine::assets::TensorSource & source) { |
| 727 | if (config.coco_type != "style" && config.coco_type != "content_style") { |
| 728 | throw std::runtime_error("Vevo2 Coco tokenizer weights require style or content_style config"); |
| 729 | } |
| 730 | auto weights = std::make_shared<Vevo2CocoTokenizerWeights>(); |
| 731 | weights->store = std::make_shared<engine::core::BackendWeightStore>( |
| 732 | backend, |
| 733 | backend_type, |
| 734 | std::string("vevo2.") + name + ".weights", |
| 735 | weight_context_bytes); |
| 736 | if (config.coco_type == "content_style") { |
| 737 | weights->whisper_input = engine::modules::binding::linear_from_source( |
| 738 | *weights->store, |
| 739 | source, |
| 740 | "whisper_input_layer", |
| 741 | matmul_storage_type, |
| 742 | config.hidden_size, |
| 743 | config.whisper_dim, |
| 744 | true); |
| 745 | } |
| 746 | weights->chromagram_input = engine::modules::binding::linear_from_source( |
| 747 | *weights->store, |
| 748 | source, |
| 749 | "chromagram_input_layer", |
| 750 | matmul_storage_type, |
| 751 | config.hidden_size, |
| 752 | config.chromagram_dim, |
| 753 | true); |
no test coverage detected