Spaces:
Running
Running
Evgueni Poloukarov
commited on
Commit
·
f2524dc
1
Parent(s):
f4be780
fix: replace hardcoded HF token with environment variable for security
Browse files- gradio_app.py +9 -1
gradio_app.py
CHANGED
|
@@ -4,6 +4,7 @@ Gradio Interface for Dynamic Forecast System
|
|
| 4 |
Interactive interface for time-aware forecasting with run date selection.
|
| 5 |
"""
|
| 6 |
|
|
|
|
| 7 |
import gradio as gr
|
| 8 |
import polars as pl
|
| 9 |
import pandas as pd
|
|
@@ -22,7 +23,14 @@ def load_data():
|
|
| 22 |
global dataset, forecaster, borders
|
| 23 |
|
| 24 |
print("[*] Loading dataset from HuggingFace...")
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
ds = load_dataset(
|
| 28 |
"evgueni-p/fbmc-features-24month",
|
|
|
|
| 4 |
Interactive interface for time-aware forecasting with run date selection.
|
| 5 |
"""
|
| 6 |
|
| 7 |
+
import os
|
| 8 |
import gradio as gr
|
| 9 |
import polars as pl
|
| 10 |
import pandas as pd
|
|
|
|
| 23 |
global dataset, forecaster, borders
|
| 24 |
|
| 25 |
print("[*] Loading dataset from HuggingFace...")
|
| 26 |
+
|
| 27 |
+
# Load HF token from environment variable
|
| 28 |
+
hf_token = os.getenv("HF_TOKEN")
|
| 29 |
+
if not hf_token:
|
| 30 |
+
raise ValueError(
|
| 31 |
+
"HF_TOKEN not found in environment variables. "
|
| 32 |
+
"Please set HF_TOKEN in your environment or .env file."
|
| 33 |
+
)
|
| 34 |
|
| 35 |
ds = load_dataset(
|
| 36 |
"evgueni-p/fbmc-features-24month",
|