shukdev3 commited on
Commit
59ce6a0
Β·
verified Β·
1 Parent(s): 99c2814

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -1,7 +1,7 @@
1
  """
2
  ShukGEN v3 β€” Flask Backend Server (Hugging Face Spaces Edition)
3
  Serves both the UI (index.html) and the API on port 7860.
4
- Model is auto-loaded from model.pt in the same directory at startup.
5
  """
6
 
7
  import io, base64, os, sys, traceback, threading, time, math
@@ -557,15 +557,15 @@ def api_save_all():
557
 
558
  # ─────────────────────────────────────────────────────────────────────────────
559
  # AUTO-LOAD MODEL ON STARTUP
560
- # Place your model file as model.pt in the same directory as this script.
561
  # It will be loaded automatically when the Space starts.
562
  # ─────────────────────────────────────────────────────────────────────────────
563
 
564
- MODEL_PATH = os.path.join(BASE_DIR, 'model.pt')
565
 
566
  def auto_load_model():
567
  if os.path.isfile(MODEL_PATH):
568
- print(f" πŸ” Found model.pt β€” loading...")
569
  try:
570
  model, image_size, cfg = load_model(MODEL_PATH, STATE['device'])
571
  STATE['model'] = model
@@ -576,8 +576,8 @@ def auto_load_model():
576
  print(f" ❌ Failed to auto-load model: {e}")
577
  traceback.print_exc()
578
  else:
579
- print(" ⚠️ No model.pt found in app directory.")
580
- print(" Upload model.pt to the Space repo and restart.")
581
 
582
 
583
  if __name__ == '__main__':
 
1
  """
2
  ShukGEN v3 β€” Flask Backend Server (Hugging Face Spaces Edition)
3
  Serves both the UI (index.html) and the API on port 7860.
4
+ Model is auto-loaded from shukgen_v3_final.pth in the same directory at startup.
5
  """
6
 
7
  import io, base64, os, sys, traceback, threading, time, math
 
557
 
558
  # ─────────────────────────────────────────────────────────────────────────────
559
  # AUTO-LOAD MODEL ON STARTUP
560
+ # Place your model file as shukgen_v3_final.pth in the same directory as this script.
561
  # It will be loaded automatically when the Space starts.
562
  # ─────────────────────────────────────────────────────────────────────────────
563
 
564
+ MODEL_PATH = os.path.join(BASE_DIR, 'shukgen_v3_final.pth')
565
 
566
  def auto_load_model():
567
  if os.path.isfile(MODEL_PATH):
568
+ print(f" πŸ” Found shukgen_v3_final.pth β€” loading...")
569
  try:
570
  model, image_size, cfg = load_model(MODEL_PATH, STATE['device'])
571
  STATE['model'] = model
 
576
  print(f" ❌ Failed to auto-load model: {e}")
577
  traceback.print_exc()
578
  else:
579
+ print(" ⚠️ No shukgen_v3_final.pth found in app directory.")
580
+ print(" Upload shukgen_v3_final.pth to the Space repo and restart.")
581
 
582
 
583
  if __name__ == '__main__':