yonilev commited on
Commit
f230440
Β·
verified Β·
1 Parent(s): 126bad0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -0
app.py CHANGED
@@ -681,5 +681,26 @@ def _start_discord_bot():
681
  # the Gradio runner, NOT executed via __main__, so the bot must start here.
682
  _start_discord_bot() # starts only if DISCORD_TOKEN secret is set
683
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
684
  if __name__ == "__main__":
685
  demo.launch(css=CSS)
 
681
  # the Gradio runner, NOT executed via __main__, so the bot must start here.
682
  _start_discord_bot() # starts only if DISCORD_TOKEN secret is set
683
 
684
+ # ── TEMP STARTUP SELF-TEST ───────────────────────────────────────────────────
685
+ # Runs the model on 3 DIFFERENT inputs at boot, prints input→output to the
686
+ # container log. Decisive test: if all 3 outputs are identical β†’ model is
687
+ # collapsed (adapter problem). If they differ β†’ model is fine, bug is in the
688
+ # Gradio input plumbing. Remove after diagnosis.
689
+ def _startup_selftest():
690
+ try:
691
+ _lazy_init()
692
+ print("πŸ§ͺ ===== STARTUP SELF-TEST =====", flush=True)
693
+ for _t in ["Χ§Χ™Χ‘ΧœΧͺΧ™ 90 שקל ΧžΧ™Χ•Χ‘Χ™ גל ΧͺΧ™Χ§Χ•ΧŸ או׀ניים",
694
+ "Χ Χ•Χ’Χ” Χ›Χ”ΧŸ Χ©Χ™ΧœΧžΧ” 350 גל Χ™Χ™Χ’Χ•Χ₯ Χ’Χ‘Χ§Χ™",
695
+ "Χ—Χ‘Χ¨Χͺ ΧžΧ’Χ’Χœ Χ©Χ™ΧœΧžΧ” 5000 גל Χ‘Χ Χ™Χ™Χͺ אΧͺΧ¨"]:
696
+ print(f"πŸ§ͺ IN : {_t!r}", flush=True)
697
+ print(f"πŸ§ͺ OUT: {model_parse(_t)!r}", flush=True)
698
+ print("πŸ§ͺ ===== END SELF-TEST =====", flush=True)
699
+ except Exception as e:
700
+ print(f"πŸ§ͺ SELF-TEST ERROR: {e}", flush=True)
701
+
702
+ import threading as _thr
703
+ _thr.Thread(target=_startup_selftest, daemon=True).start()
704
+
705
  if __name__ == "__main__":
706
  demo.launch(css=CSS)