Skip to content

Commit 1a75645

Browse files
Update app.py
1 parent 82070b6 commit 1a75645

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

backend/app.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def upload_file():
8686
summary = response.choices[0].message.content
8787

8888
log_print("🧠 OpenAI Summary generated.")
89-
return render_template("index.html", summary=summary, log=log_stream.getvalue(), forecast="Submit future x-values below to get predictions.",plot_url="/static/plot.png")
89+
return jsonify({"summary": summary, "log": log_stream.getvalue(), "forecast": "Submit future x-values below to get predictions.", "plot_url": "/static/plot.png"})
9090

9191

9292
@app.route("/predict", methods=["POST"])
@@ -131,13 +131,7 @@ def predict():
131131

132132
log_print("🔮 Forecast complete.")
133133

134-
return render_template(
135-
"index.html",
136-
summary="",
137-
log=log_stream.getvalue(),
138-
forecast=result,
139-
plot_url="/static/plot.png"
140-
)
134+
return jsonify({ "forecast": result, "log": log_stream.getvalue(), "plot_url": "/static/plot.png" })
141135
if __name__ == "__main__":
142136
app.run(host="0.0.0.0", port=80, debug=True)
143137

0 commit comments

Comments
 (0)