MCPcopy Create free account
hub / github.com/MiniMax-AI/VTP / unwrap_model

Function unwrap_model

vtp/models/utils/text_utils.py:24–28  ·  view source on GitHub ↗

Unwraps a model from its DataParallel wrapper if it is wrapped.

(model)

Source from the content-addressed store, hash-verified

22HF_CONFIG_NAME = 'open_clip_config.json'
23
24def unwrap_model(model):
25 """
26 Unwraps a model from its DataParallel wrapper if it is wrapped.
27 """
28 return model.module if hasattr(model, 'module') else model
29
30def freeze_batch_norm_2d(module, module_match={}, name=''):
31 """

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected