Subh775 commited on
Commit
ecee7e2
·
verified ·
1 Parent(s): f8a9f51

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -1
app.py CHANGED
@@ -290,5 +290,13 @@ def predict():
290
  return send_file(buf, mimetype="image/png")
291
 
292
 
 
 
 
293
  if __name__ == "__main__":
294
- app.run(host="0.0.0.0", port=7860)
 
 
 
 
 
 
290
  return send_file(buf, mimetype="image/png")
291
 
292
 
293
+ # if __name__ == "__main__":
294
+ # app.run(host="0.0.0.0", port=7860)
295
+
296
  if __name__ == "__main__":
297
+ # warm up model on startup (non-blocking)
298
+ try:
299
+ init_model()
300
+ except Exception as e:
301
+ print("Model init warning:", e)
302
+ app.run(host="0.0.0.0", port=int(os.environ.get("PORT", 7860)), debug=False)