MCPcopy Create free account
hub / github.com/Ar-Ray-code/lingbot-depth-trt / load_export_model

Function load_export_model

tools/export_trt.py:262–269  ·  view source on GitHub ↗
(args: argparse.Namespace, device: torch.device)

Source from the content-addressed store, hash-verified

260
261
262def 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
272def export_onnx(

Callers 1

mainFunction · 0.85

Calls 2

Tested by

no test coverage detected