Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -139,7 +139,7 @@ def carbon_trend():
|
|
| 139 |
plt.title("Carbon Intensity Trend")
|
| 140 |
plt.legend()
|
| 141 |
plt.tight_layout()
|
| 142 |
-
plt.savefig("carbon_trend_plot.png")
|
| 143 |
|
| 144 |
return {
|
| 145 |
"trend_slope": round(slope, 4),
|
|
@@ -153,4 +153,4 @@ def carbon_trend():
|
|
| 153 |
# Optional: Return trend plot image
|
| 154 |
@app.get("/carbon-trend/plot")
|
| 155 |
def get_trend_plot():
|
| 156 |
-
return FileResponse("carbon_trend_plot.png", media_type="image/png")
|
|
|
|
| 139 |
plt.title("Carbon Intensity Trend")
|
| 140 |
plt.legend()
|
| 141 |
plt.tight_layout()
|
| 142 |
+
plt.savefig("/tmp/carbon_trend_plot.png")
|
| 143 |
|
| 144 |
return {
|
| 145 |
"trend_slope": round(slope, 4),
|
|
|
|
| 153 |
# Optional: Return trend plot image
|
| 154 |
@app.get("/carbon-trend/plot")
|
| 155 |
def get_trend_plot():
|
| 156 |
+
return FileResponse("/tmp/carbon_trend_plot.png", media_type="image/png")
|