| 72 | if (assets == nullptr) { |
| 73 | throw std::runtime_error("RoFormer session requires assets"); |
| 74 | } |
| 75 | const auto & family = assets->config.family; |
| 76 | return runtime::apply_option_v1_compatibility( |
| 77 | std::move(options), |
| 78 | { |
| 79 | {"weight_type", family + ".weight_type"}, |
| 80 | {"num_overlap", family + ".num_overlap"}, |
| 81 | }, |
| 82 | family); |
| 83 | } |
| 84 | |
| 85 | std::shared_ptr<const RoformerAssets> load_roformer_assets_for_family( |
| 86 | const std::filesystem::path & model_path, |
| 87 | std::string_view family) { |
| 88 | runtime::ModelLoadRequest request; |
| 89 | request.model_path = model_path; |
| 90 | request.family_hint = std::string(family); |
| 91 | return load_roformer_assets(request, family); |