Update app.py
Browse files
app.py
CHANGED
|
@@ -35,13 +35,13 @@ def save_state_to_disk(dataframe_rows):
|
|
| 35 |
print(f"⚠️ Critical storage write failure: {e}")
|
| 36 |
|
| 37 |
# =====================================================================
|
| 38 |
-
# 🛰️ GLOBAL VISION-LANGUAGE INITIALIZATION
|
| 39 |
# =====================================================================
|
| 40 |
print("🤖 Initializing Moondream VLM weights into memory pool...")
|
| 41 |
model_id = "vikhyatk/moondream2"
|
| 42 |
|
| 43 |
-
#
|
| 44 |
-
model =
|
| 45 |
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 46 |
print("Model layers successfully loaded.")
|
| 47 |
|
|
|
|
| 35 |
print(f"⚠️ Critical storage write failure: {e}")
|
| 36 |
|
| 37 |
# =====================================================================
|
| 38 |
+
# 🛰️ GLOBAL VISION-LANGUAGE INITIALIZATION (Class Mapping Corrected)
|
| 39 |
# =====================================================================
|
| 40 |
print("🤖 Initializing Moondream VLM weights into memory pool...")
|
| 41 |
model_id = "vikhyatk/moondream2"
|
| 42 |
|
| 43 |
+
# Using AutoModel instead of AutoModelForCausalLM bypasses the tied weights checking loop
|
| 44 |
+
model = AutoModel.from_pretrained(model_id, trust_remote_code=True)
|
| 45 |
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 46 |
print("Model layers successfully loaded.")
|
| 47 |
|