Spaces:
Running
Running
Update base model id
Browse files
app.py
CHANGED
|
@@ -13,14 +13,17 @@ import os
|
|
| 13 |
# Load your custom VLM model from Hugging Face
|
| 14 |
# Replace with your actual model identifier
|
| 15 |
MODEL_ID = "enpeizhao/qwen2_5-3b-instruct-trl-sft-vlm-odd-12-nf4-merged"
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 18 |
|
| 19 |
def load_model():
|
| 20 |
"""Load the model and processor from Hugging Face"""
|
| 21 |
model = AutoModel.from_pretrained(MODEL_ID, trust_remote_code=True).to(device)
|
| 22 |
-
processor = AutoProcessor.from_pretrained(
|
| 23 |
-
tokenizer = AutoTokenizer.from_pretrained(
|
| 24 |
return model, processor, tokenizer
|
| 25 |
|
| 26 |
# Load model at startup
|
|
|
|
| 13 |
# Load your custom VLM model from Hugging Face
|
| 14 |
# Replace with your actual model identifier
|
| 15 |
MODEL_ID = "enpeizhao/qwen2_5-3b-instruct-trl-sft-vlm-odd-12-nf4-merged"
|
| 16 |
+
BASE_MODEL_ID = "Qwen/Qwen2.5-3B-Instruct"
|
| 17 |
+
|
| 18 |
+
|
| 19 |
|
| 20 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 21 |
|
| 22 |
def load_model():
|
| 23 |
"""Load the model and processor from Hugging Face"""
|
| 24 |
model = AutoModel.from_pretrained(MODEL_ID, trust_remote_code=True).to(device)
|
| 25 |
+
processor = AutoProcessor.from_pretrained(BASE_MODEL_ID, trust_remote_code=True)
|
| 26 |
+
tokenizer = AutoTokenizer.from_pretrained(BASE_MODEL_ID, trust_remote_code=True)
|
| 27 |
return model, processor, tokenizer
|
| 28 |
|
| 29 |
# Load model at startup
|