Spaces:
Runtime error
Runtime error
update
Browse files
app.py
CHANGED
@@ -47,7 +47,8 @@ else:
|
|
47 |
with init_empty_weights():
|
48 |
#model = AutoModel.from_pretrained(model_path, trust_remote_code=True, attn_implementation='sdpa', torch_dtype=torch.bfloat16)
|
49 |
model = AutoModel.from_pretrained(model_path, trust_remote_code=True, torch_dtype=torch.bfloat16)
|
50 |
-
device_map = infer_auto_device_map(model, max_memory={0: "10GB", 1: "10GB"},
|
|
|
51 |
no_split_module_classes=['SiglipVisionTransformer', 'Qwen2DecoderLayer'])
|
52 |
device_id = device_map["llm.model.embed_tokens"]
|
53 |
device_map["llm.lm_head"] = device_id # firtt and last layer should be in same device
|
|
|
47 |
with init_empty_weights():
|
48 |
#model = AutoModel.from_pretrained(model_path, trust_remote_code=True, attn_implementation='sdpa', torch_dtype=torch.bfloat16)
|
49 |
model = AutoModel.from_pretrained(model_path, trust_remote_code=True, torch_dtype=torch.bfloat16)
|
50 |
+
#device_map = infer_auto_device_map(model, max_memory={0: "10GB", 1: "10GB"},
|
51 |
+
device_map = infer_auto_device_map(model,
|
52 |
no_split_module_classes=['SiglipVisionTransformer', 'Qwen2DecoderLayer'])
|
53 |
device_id = device_map["llm.model.embed_tokens"]
|
54 |
device_map["llm.lm_head"] = device_id # firtt and last layer should be in same device
|