LukasHug commited on
Commit
d1ec131
·
verified ·
1 Parent(s): 5e99db0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -155,7 +155,7 @@ def load_model(model_path):
155
  model_path,
156
  # torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32,
157
  torch_dtype="auto",
158
- device_map="auto" if torch.cuda.is_available() else None
159
  )
160
  processor = AutoProcessor.from_pretrained(model_path)
161
  tokenizer = processor.tokenizer
@@ -166,7 +166,7 @@ def load_model(model_path):
166
  model_path,
167
  # torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32,
168
  torch_dtype="auto",
169
- device_map="auto" if torch.cuda.is_available() else None,
170
  trust_remote_code=True
171
  )
172
  tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)
 
155
  model_path,
156
  # torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32,
157
  torch_dtype="auto",
158
+ device_map="auto"
159
  )
160
  processor = AutoProcessor.from_pretrained(model_path)
161
  tokenizer = processor.tokenizer
 
166
  model_path,
167
  # torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32,
168
  torch_dtype="auto",
169
+ device_map="auto",
170
  trust_remote_code=True
171
  )
172
  tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)