Cristobal299 commited on
Commit
49dcf45
·
verified ·
1 Parent(s): 1f44040

Upload app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -98,9 +98,12 @@ def not_found(e):
98
  return jsonify({"error": "not found"}), 404
99
 
100
  if __name__ == "__main__":
101
- # Ensure the database exists before the first request
102
  if not os.path.isfile(DATABASE):
103
  init_db()
104
- # Use gunicorn for production in Hugging Face Spaces
105
- import subprocess
106
- app.run(host="0.0.0.0", port=7860)
 
 
 
 
 
98
  return jsonify({"error": "not found"}), 404
99
 
100
  if __name__ == "__main__":
 
101
  if not os.path.isfile(DATABASE):
102
  init_db()
103
+ import gradio as gr
104
+
105
+ def status():
106
+ return "Task API is running."
107
+
108
+ demo = gr.Interface(fn=status, inputs=None, outputs="text")
109
+ demo.launch(server_name="0.0.0.0", server_port=7860, debug=False)