Skip to content

Commit

Permalink
Merge pull request #64 from Efficient-Large-Model/weimingc/fix_visual…
Browse files Browse the repository at this point in the history
…_engine_build

Fix vision engine build for vila-40b
  • Loading branch information
meenchen authored May 17, 2024
2 parents d7d54bc + 25db060 commit 44a4cca
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions demo_trt_llm/build_visual_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,10 @@ def build_vila_engine(args):
vision_tower = model.get_vision_tower()
image_processor = vision_tower.image_processor
raw_image = Image.new('RGB', [10, 10]) # dummy image
image = image_processor(images=raw_image,
return_tensors="pt")['pixel_values'].to(
args.device, torch.float16)

image = image_processor(images=raw_image,return_tensors="pt")['pixel_values']
if isinstance(image, list):
image = image[0].unsqueeze(0)
image = image.to(args.device, torch.float16)
class VilaVisionWrapper(torch.nn.Module):

def __init__(self, tower, projector):
Expand Down

0 comments on commit 44a4cca

Please sign in to comment.