(args: argparse.Namespace, device: torch.device)
| 260 | |
| 261 | |
| 262 | def load_export_model(args: argparse.Namespace, device: torch.device) -> ExportableLingBotDepth: |
| 263 | apply_lingbot_export_patches() |
| 264 | model = MDMModel.from_pretrained(args.model).to(device).eval() |
| 265 | model.encoder.onnx_compatible_mode = True |
| 266 | model.enable_pytorch_native_sdpa() |
| 267 | if args.precision == "fp16": |
| 268 | model = model.half() |
| 269 | return ExportableLingBotDepth(model, args.num_tokens).to(device).eval() |
| 270 | |
| 271 | |
| 272 | def export_onnx( |
no test coverage detected