uttarasawant commited on
Commit
ea64d81
·
verified ·
1 Parent(s): 793ad4a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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
- # Keep the model load global. On ZeroGPU, this registers it in container RAM.
44
- model = AutoModelForCausalLM.from_pretrained(model_id, trust_remote_code=True)
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