MCPcopy Create free account
hub / github.com/InternRobotics/G2VLM / __init__

Method __init__

eval_code/recons/models/fastmodel.py:45–56  ·  view source on GitHub ↗
(
            self,
            pretrained_model_name_or_path: Optional[str] = None,
            ori_model: bool = True,
        )

Source from the content-addressed store, hash-verified

43
44class MoGe(nn.Module):
45 def __init__(
46 self,
47 pretrained_model_name_or_path: Optional[str] = None,
48 ori_model: bool = True,
49 ):
50 super().__init__()
51
52 if ori_model and pretrained_model_name_or_path is not None:
53 from models.moge.model.v1 import MoGeModel
54 self.model = MoGeModel.from_pretrained(pretrained_model_name_or_path)
55 else:
56 raise NotImplementedError
57
58 def forward(self, image: torch.Tensor, num_tokens: int) -> Dict[str, torch.Tensor]:
59 return self.model(image, num_tokens)

Callers

nothing calls this directly

Calls 2

__init__Method · 0.45
from_pretrainedMethod · 0.45

Tested by

no test coverage detected