diff --git a/run.py b/run.py index 72d68ad..8f859bd 100644 --- a/run.py +++ b/run.py @@ -6,13 +6,13 @@ import json from logzero import logger import io -from house_price.house_price_predcition import run_boston_price -from ocean_wave.wave_height_mlp import predict_wave_height +# from house_price.house_price_predcition import run_boston_price +# from ocean_wave.wave_height_mlp import predict_wave_height from prophet_predict.prophet_predict import run_prophet TEXT = "text" app = Flask(__name__) - +''' @app.route('/house_price/', methods=["POST"]) def predict_price(): @@ -62,7 +62,7 @@ def predict_price(): if resp_info["code"] == 200: resp = make_response(resp_info["data"]) resp.headers["Content-Disposition"] = "attachment; filename=house_price.xlsx" - resp.headers["Content-type"] = "application/x-xlsx" + resp.headers["Content-type"] = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8" else: resp = make_response(json.dumps(resp_info)) resp.status_code = 200 @@ -112,7 +112,7 @@ def predict_height(): resp = make_response(json.dumps(resp_info)) resp.status_code = 200 return resp - +''' @app.route("/prophet/", methods=["POST"]) def run_ts_predict(): @@ -147,7 +147,7 @@ def run_ts_predict(): if resp_info.get("code") == 200: resp = make_response(resp_info["data"]) resp.headers["Content-Disposition"] = f"attachment; filename={file_name}" - resp.headers["Content-type"] = "application/x-xlsx" + resp.headers["Content-type"] = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8" else: resp = make_response(json.dumps(resp_info)) resp.status_code = 200