John6666 commited on
Commit
e122ddb
·
verified ·
1 Parent(s): 4a827c1

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -164,7 +164,7 @@ def load_models():
164
  assert isinstance(tokenizer, (PreTrainedTokenizer, PreTrainedTokenizerFast)), f"Tokenizer is of type {type(tokenizer)}"
165
 
166
  print(f"Loading LLM: {MODEL_PATH} 🤖")
167
- text_model = AutoModelForCausalLM.from_pretrained(MODEL_PATH, device_map=device, torch_dtype=torch.bfloat16).eval() # device_map=auto may cause LoRA error
168
 
169
  if LORA_PATH.exists():
170
  print("Loading VLM's custom text model 🤖")
 
164
  assert isinstance(tokenizer, (PreTrainedTokenizer, PreTrainedTokenizerFast)), f"Tokenizer is of type {type(tokenizer)}"
165
 
166
  print(f"Loading LLM: {MODEL_PATH} 🤖")
167
+ text_model = AutoModelForCausalLM.from_pretrained(MODEL_PATH, device_map="auto", torch_dtype=torch.bfloat16).eval() # device_map=auto may cause LoRA error
168
 
169
  if LORA_PATH.exists():
170
  print("Loading VLM's custom text model 🤖")