Commit
·
c77b6e7
1
Parent(s):
a6799a9
added code for YFINANCE_NO_CACHE
Browse files
app.py
CHANGED
@@ -63,9 +63,13 @@ NN_model.predict(np.zeros((1, 5))) # warm-up dummy prediction
|
|
63 |
scaler_X = joblib.load(os.path.join(model_dir, "scaler_X.pkl"))
|
64 |
scaler_y = joblib.load(os.path.join(model_dir, "scaler_y.pkl"))
|
65 |
|
|
|
|
|
66 |
# --- Inference Function --- #
|
67 |
def predict_stock():
|
68 |
-
|
|
|
|
|
69 |
# --- Clear yfinance cache to get latest volume and price data --- #
|
70 |
cache_path = os.path.expanduser("~/.cache/py-yfinance")
|
71 |
if os.path.exists(cache_path):
|
|
|
63 |
scaler_X = joblib.load(os.path.join(model_dir, "scaler_X.pkl"))
|
64 |
scaler_y = joblib.load(os.path.join(model_dir, "scaler_y.pkl"))
|
65 |
|
66 |
+
os.environ["YFINANCE_NO_CACHE"] = "1" # <-- 🔥 disables SQLite caching
|
67 |
+
|
68 |
# --- Inference Function --- #
|
69 |
def predict_stock():
|
70 |
+
# lightweight log print near the top of predict_stock() to verify it's hitting the cache config:
|
71 |
+
print("YFINANCE_NO_CACHE =", os.getenv("YFINANCE_NO_CACHE"))
|
72 |
+
|
73 |
# --- Clear yfinance cache to get latest volume and price data --- #
|
74 |
cache_path = os.path.expanduser("~/.cache/py-yfinance")
|
75 |
if os.path.exists(cache_path):
|