Spaces:
Sleeping
Sleeping
- Dockerfile +3 -0
- main.py +2 -2
Dockerfile
CHANGED
@@ -15,3 +15,6 @@ COPY . .
|
|
15 |
|
16 |
# Command to run the application
|
17 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
|
|
|
|
15 |
|
16 |
# Command to run the application
|
17 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
18 |
+
|
19 |
+
# Set the environment variable for Matplotlib cache
|
20 |
+
ENV MPLCONFIGDIR=/tmp/matplotlib
|
main.py
CHANGED
@@ -228,8 +228,8 @@ def run_xgboost(df):
|
|
228 |
|
229 |
# Calculate and print RMSE for the test set
|
230 |
rmse = np.sqrt(mean_squared_error(y_test, predictions))
|
231 |
-
|
232 |
-
return {"latest_prediction": latest_prediction, "RMSE":
|
233 |
|
234 |
|
235 |
@app.get("/ticker/{ticker}")
|
|
|
228 |
|
229 |
# Calculate and print RMSE for the test set
|
230 |
rmse = np.sqrt(mean_squared_error(y_test, predictions))
|
231 |
+
np_float = np.float32(rmse)
|
232 |
+
return {"latest_prediction": latest_prediction, "RMSE": float(np_float)}
|
233 |
|
234 |
|
235 |
@app.get("/ticker/{ticker}")
|