Spaces:
Running
Running
Store HF as secret
Browse files
app.py
CHANGED
@@ -33,6 +33,7 @@ IO_PARAMS = {
|
|
33 |
# "skip_instance_cache": True
|
34 |
"cache_type": "blockcache", # or "first" with enough space
|
35 |
"block_size": 2 * 1024 * 1024, # could be bigger
|
|
|
36 |
},
|
37 |
"h5py_params": {
|
38 |
"driver_kwds": { # only recent versions of xarray and h5netcdf allow this correctly
|
@@ -69,7 +70,7 @@ def get_dataset_files(dataset_name: str):
|
|
69 |
dataset_path = get_dataset_path(dataset_name)
|
70 |
fs, _ = fsspec.url_to_fs(dataset_path)
|
71 |
dataset_files = fs.glob(f"{dataset_path}/**/*.hdf5")
|
72 |
-
return dataset_files
|
73 |
|
74 |
|
75 |
@st.cache_data
|
|
|
33 |
# "skip_instance_cache": True
|
34 |
"cache_type": "blockcache", # or "first" with enough space
|
35 |
"block_size": 2 * 1024 * 1024, # could be bigger
|
36 |
+
"token": st.secrets["HF_TOKEN"],
|
37 |
},
|
38 |
"h5py_params": {
|
39 |
"driver_kwds": { # only recent versions of xarray and h5netcdf allow this correctly
|
|
|
70 |
dataset_path = get_dataset_path(dataset_name)
|
71 |
fs, _ = fsspec.url_to_fs(dataset_path)
|
72 |
dataset_files = fs.glob(f"{dataset_path}/**/*.hdf5")
|
73 |
+
return fs, dataset_files
|
74 |
|
75 |
|
76 |
@st.cache_data
|