(
package: ModelPackage,
source: CompositeSnapshotSource,
models_root: Path,
overwrite: bool,
)
| 1320 | "model.safetensors", |
| 1321 | "tokenizer.json", |
| 1322 | "tokenizer_config.json", |
| 1323 | "audiovae.pth", |
| 1324 | "audiovae.safetensors", |
| 1325 | ), |
| 1326 | ), |
| 1327 | ModelPackage( |
| 1328 | id="voxcpm2_audiovae", |
| 1329 | display_name="VoxCPM2 AudioVAE local conversion utility", |
| 1330 | target_directory="VoxCPM2", |
| 1331 | source=ConverterSource( |
| 1332 | kind="pytorch_to_safetensors", |
| 1333 | description="Convert a local PyTorch checkpoint into safetensors.", |
| 1334 | ), |
| 1335 | required_files=("audiovae.safetensors",), |
| 1336 | description="Utility only. Use voxcpm2 for the full framework-ready VoxCPM2 package.", |
| 1337 | ), |
| 1338 | ModelPackage( |
| 1339 | id="htdemucs", |
| 1340 | display_name="HTDemucs", |
| 1341 | target_directory="htdemucs", |
| 1342 | source=ConverterSource( |
| 1343 | kind="demucs_reference", |
| 1344 | description="Download official Demucs .th checkpoints, or use --source-dir, and assemble framework safetensors plus a manifest.", |
| 1345 | ), |
| 1346 | required_files=( |
| 1347 | "manifest.json", |
| 1348 | "955717e8/config.json", |
| 1349 | "955717e8/model.safetensors", |
| 1350 | ), |
| 1351 | ), |
| 1352 | ) |
| 1353 | |
| 1354 | PACKAGE_BY_ID = {package.id: package for package in CATALOG} |
| 1355 | |
| 1356 | |
| 1357 | def parse_args() -> argparse.Namespace: |
| 1358 | parser = argparse.ArgumentParser( |
| 1359 | description="Download or convert official model packages into a local models layout." |
| 1360 | ) |
| 1361 | subparsers = parser.add_subparsers(dest="command", required=True) |
| 1362 | |
| 1363 | list_parser = subparsers.add_parser("list", help="List available model packages.") |
| 1364 | list_parser.add_argument("--json", action="store_true", help="Print machine-readable JSON.") |
| 1365 | |
| 1366 | info_parser = subparsers.add_parser("info", help="Show one package.") |
| 1367 | info_parser.add_argument("package_id") |
| 1368 | info_parser.add_argument("--json", action="store_true", help="Print machine-readable JSON.") |
| 1369 | |
| 1370 | install_parser = subparsers.add_parser("install", help="Install one package into a models root.") |
| 1371 | install_parser.add_argument("package_id") |
| 1372 | install_parser.add_argument("--models-root", default="models", help="Target models root.") |
| 1373 | install_parser.add_argument("--overwrite", action="store_true", help="Replace an existing installed directory.") |
| 1374 | install_parser.add_argument("--source-file", help="Local source checkpoint for utility packages.") |
| 1375 | install_parser.add_argument("--output-file", help="Optional output file for single-file utility packages.") |
| 1376 | install_parser.add_argument("--source-dir", help="Optional local source directory for packages that can use checkpoint folders.") |
| 1377 | install_parser.add_argument("--variant", help="Variant or model name for packages that support variants.") |
| 1378 | |
| 1379 | return parser.parse_args() |
no test coverage detected