MCPcopy Create free account
hub / github.com/NVIDIA/TensorRT-LLM / Phi3VisionWrapper

Class Phi3VisionWrapper

tensorrt_llm/tools/multimodal_builder.py:996–1004  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

994 image = image.flatten(0, 1)
995
996 class Phi3VisionWrapper(torch.nn.Module):
997
998 def __init__(self, vision_model):
999 super().__init__()
1000 self.vision_model = vision_model
1001
1002 def forward(self, pixel_values):
1003 return self.vision_model.get_img_features(pixel_values).reshape(
1004 1, pixel_values.shape[0], -1, self.vision_model.image_dim_out)
1005
1006 model = AutoModelForCausalLM.from_pretrained(args.model_path,
1007 dtype=torch.float16,

Callers 1

build_phi_engineFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected