Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -44,7 +44,7 @@ def load_model(check_type):
|
|
44 |
model_path = CHECKPOINTS[check_type]
|
45 |
tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True, use_fast=False, use_auth_token=HF_TOKEN)
|
46 |
# model = InternVLChatModel.from_pretrained(model_path, torch_dtype=torch.bfloat16).eval()
|
47 |
-
model = InternVLChatModel.from_pretrained(
|
48 |
transform = get_transform(is_train=False, image_size=model.config.force_image_size)
|
49 |
|
50 |
return model.to(device), tokenizer, transform, device
|
|
|
44 |
model_path = CHECKPOINTS[check_type]
|
45 |
tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True, use_fast=False, use_auth_token=HF_TOKEN)
|
46 |
# model = InternVLChatModel.from_pretrained(model_path, torch_dtype=torch.bfloat16).eval()
|
47 |
+
model = InternVLChatModel.from_pretrained(model_path, low_cpu_mem_usage=True, torch_dtype=torch.bfloat16 ,load_in_8bit=False, load_in_4bit=False).eval()
|
48 |
transform = get_transform(is_train=False, image_size=model.config.force_image_size)
|
49 |
|
50 |
return model.to(device), tokenizer, transform, device
|