Ketengan-Diffusion-Lab commited on
Commit
f4dc684
·
verified ·
1 Parent(s): f8d9f18

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -19,9 +19,15 @@ model_name = 'cognitivecomputations/dolphin-vision-7b'
19
  model = AutoModelForCausalLM.from_pretrained(
20
  model_name,
21
  torch_dtype=torch.float16,
22
- device_map='auto',
23
  trust_remote_code=True
24
  )
 
 
 
 
 
 
 
25
 
26
  tokenizer = AutoTokenizer.from_pretrained(
27
  model_name,
 
19
  model = AutoModelForCausalLM.from_pretrained(
20
  model_name,
21
  torch_dtype=torch.float16,
 
22
  trust_remote_code=True
23
  )
24
+ model.to(device) # Explicitly move the model to the device
25
+
26
+ # Ensure all model components are on the same device
27
+ for param in model.parameters():
28
+ param.data = param.data.to(device)
29
+ for buffer in model.buffers():
30
+ buffer.data = buffer.data.to(device)
31
 
32
  tokenizer = AutoTokenizer.from_pretrained(
33
  model_name,