MCPcopy
hub / github.com/InternLM/lmdeploy / export_iter

Method export_iter

lmdeploy/turbomind/model_loader.py:60–69  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

58 torch.cuda.empty_cache()
59
60 def export_iter(self):
61 ckpt = create_checkpoint(
62 self.model_path,
63 mappings=getattr(self.model, '_loader_mappings', []))
64 try:
65 self.model.model(Prefix(ckpt))
66 yield -1
67 finally:
68 ckpt.close()
69 torch.cuda.empty_cache()

Callers

nothing calls this directly

Calls 4

create_checkpointFunction · 0.85
PrefixClass · 0.85
modelMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected