diff --git a/app.py b/api/index.py similarity index 93% rename from app.py rename to api/index.py index 0198c45..f3291c7 100644 --- a/app.py +++ b/api/index.py @@ -6,7 +6,7 @@ from flask import Flask BASE_DIR = os.path.dirname(os.path.abspath(__file__)) -model_path = os.path.join(BASE_DIR, "models/main.pkl") +model_path = os.path.join(BASE_DIR, "models", "main.pkl") # to get your model: joblib.dump(model, "model.pkl") model = joblib.load(model_path) diff --git a/vercel.json b/vercel.json new file mode 100644 index 0000000..ef9707d --- /dev/null +++ b/vercel.json @@ -0,0 +1,14 @@ +{ + "version": 2, + "functions": { + "api/index.py": { + "runtime": "python3.11" + } + }, + "routes": [ + { + "src": "/(.*)", + "dest": "api/index.py" + } + ] +} \ No newline at end of file