MCPcopy Create free account
hub / github.com/InternLM/InternBootcamp / _get_patching_model

Function _get_patching_model

verl/verl/models/mcore/mtp_patch.py:35–44  ·  view source on GitHub ↗
(model: torch.nn.Module)

Source from the content-addressed store, hash-verified

33
34
35def _get_patching_model(model: torch.nn.Module):
36 model = unwrap_model(model)
37 if isinstance(model, GPTModel):
38 return model
39
40 if not (hasattr(model, "language_model") and isinstance(model.language_model, GPTModel)):
41 print(f"Model {model.__class__.__name__} is not a supported for fused forward")
42 return None
43
44 return model.language_model
45
46
47def patch_postprocess(model: torch.nn.Module):

Callers 4

patch_postprocessFunction · 0.70
unpatch_postprocessFunction · 0.70

Calls 1

unwrap_modelFunction · 0.90

Tested by

no test coverage detected