Skip to content

Commit

Permalink
Merge pull request #17 from parcaster/use_features_from_timestamp
Browse files Browse the repository at this point in the history
Use features from timestamp
  • Loading branch information
ritahaffter committed Dec 2, 2023
2 parents ce7e054 + dd36af3 commit 7143e47
Show file tree
Hide file tree
Showing 14 changed files with 325 additions and 45,756 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Swiss meteo request
.cache.sqlite

# Created by https://www.toptal.com/developers/gitignore/api/python,visualstudiocode,pycharm+all,flask,windows,macos,linux
# Edit at https://www.toptal.com/developers/gitignore?templates=python,visualstudiocode,pycharm+all,flask,windows,macos,linux

Expand Down
2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
web: cd deploy && gunicorn app:app
web: gunicorn app:app
31 changes: 31 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import json
from flask import Flask, jsonify, request
from deploy.single_prediction import SinglePrediction

app = Flask(__name__)
single_prediction = SinglePrediction("deploy/model_scripted.pt", "data/preprocessing/raw_features_2024.csv")


@app.route('/')
def hello():
return 'Hello World!'


@app.route('/metadata')
def metadata():
metadata_json = json.load(open("data/metadata/metadata.json"))
return metadata_json


@app.route('/predict', methods=['POST'])
def predict():
if request.method == 'POST':
date = request.json['date']
print(date)

output_dicts = single_prediction.predict_for_date(date)
return jsonify(output_dicts)


if __name__ == '__main__':
app.run()

0 comments on commit 7143e47

Please sign in to comment.