import os from datasets import load_dataset from pathlib import Path import json from datasets import load_dataset from flask import Flask, request, jsonify from flask_cors import CORS from PIL import Image from huggingface_hub import Repository app = Flask(__name__, static_url_path='/static') CORS(app) @ app.route('/') def index(): return app.send_static_file('index.html') if __name__ == '__main__': mode = os.environ.get('FLASK_ENV', 'production') print(mode) dev = mode == 'development' app.run(host='0.0.0.0', port=int( os.environ.get('PORT', 7860)), debug=True, use_reloader=dev)