rahul7star commited on
Commit
9c7141f
·
verified ·
1 Parent(s): 8f4e2a0

Update app_flash1.py

Browse files
Files changed (1) hide show
  1. app_flash1.py +3 -2
app_flash1.py CHANGED
@@ -128,10 +128,11 @@ def get_flashpack_model(hf_repo="rahul7star/FlashPack"):
128
 
129
  local_path = "model.flashpack"
130
 
131
- # 1️⃣ Check if local copy already exists
132
  if os.path.exists(local_path):
133
  print("✅ Found local model.flashpack — loading it directly.")
134
  model = GemmaTrainer().from_flashpack(local_path)
 
135
  tokenizer, embed_model, _ = build_encoder("gpt2")
136
  print("✅ FlashPack model loaded successfully (local).")
137
  return model, tokenizer, embed_model, None, None
@@ -143,7 +144,7 @@ def get_flashpack_model(hf_repo="rahul7star/FlashPack"):
143
  print("✅ Found model.flashpack in repo — downloading and loading it.")
144
  local_path = hf_hub_download(repo_id=hf_repo, filename="model.flashpack")
145
 
146
- # Load cleanly using the class itself
147
  model = GemmaTrainer().from_flashpack(local_path)
148
  model.eval()
149
 
 
128
 
129
  local_path = "model.flashpack"
130
 
131
+ # 1️⃣ Try local first
132
  if os.path.exists(local_path):
133
  print("✅ Found local model.flashpack — loading it directly.")
134
  model = GemmaTrainer().from_flashpack(local_path)
135
+ model.eval()
136
  tokenizer, embed_model, _ = build_encoder("gpt2")
137
  print("✅ FlashPack model loaded successfully (local).")
138
  return model, tokenizer, embed_model, None, None
 
144
  print("✅ Found model.flashpack in repo — downloading and loading it.")
145
  local_path = hf_hub_download(repo_id=hf_repo, filename="model.flashpack")
146
 
147
+ # Correct loading: no extra args passed
148
  model = GemmaTrainer().from_flashpack(local_path)
149
  model.eval()
150