Spaces:
Running
on
Zero
Running
on
Zero
set to fp16
Browse files
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.
|
129 |
]
|
130 |
else:
|
131 |
-
images = images.to(model.device, dtype=torch.
|
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.
|
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()
|