Upload app.py
Browse files
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=
|
| 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 🤖")
|