xzl12306 commited on
Commit
6e10bff
1 Parent(s): 6d74e51

set to fp16

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -125,10 +125,10 @@ def get_response(params):
125
 
126
  if type(images) is list:
127
  images = [
128
- image.to(model.device, dtype=torch.float32) for image in images
129
  ]
130
  else:
131
- images = images.to(model.device, dtype=torch.float32)
132
 
133
  replace_token = DEFAULT_IMAGE_TOKEN
134
  if getattr(model.config, "mm_use_im_start_end", False):
@@ -491,7 +491,7 @@ if __name__ == "__main__":
491
  device="cpu",
492
  load_4bit=args.load_4bit,
493
  load_8bit=args.load_8bit,
494
- torch_dtype=torch.float32,
495
  )
496
 
497
  demo = build_demo()
 
125
 
126
  if type(images) is list:
127
  images = [
128
+ image.to(model.device, dtype=torch.float16) for image in images
129
  ]
130
  else:
131
+ images = images.to(model.device, dtype=torch.float16)
132
 
133
  replace_token = DEFAULT_IMAGE_TOKEN
134
  if getattr(model.config, "mm_use_im_start_end", False):
 
491
  device="cpu",
492
  load_4bit=args.load_4bit,
493
  load_8bit=args.load_8bit,
494
+ torch_dtype=torch.float16,
495
  )
496
 
497
  demo = build_demo()