stasaking's picture
download
raw
858 Bytes
#!/bin/bash
# Download data + code from HF Bucket on startup
python -c "
from huggingface_hub import download_bucket_files, list_bucket_tree
import os
# List all files in the bucket
files = list(list_bucket_tree('stasaking/xqtl-data'))
download_list = []
for f in files:
if f.path.endswith(('.parquet', '.json')):
local_path = f'/app/data/{f.path}'
os.makedirs(os.path.dirname(local_path), exist_ok=True)
download_list.append((f.path, local_path))
elif f.path == 'hf-space/main.py':
download_list.append((f.path, '/app/main.py'))
print(f'Downloading {len(download_list)} files...')
download_bucket_files('stasaking/xqtl-data', files=download_list)
print('Data downloaded')
"
# Start API — data lives in /app/data, not relative to main.py
export XQTL_DATA_DIR=/app/data
uvicorn main:app --host 0.0.0.0 --port 7860

Xet Storage Details

Size:
858 Bytes
·
Xet hash:
5b34173dc00016917058858c57cb39a2c3df3df5bdc5403090f214b50cc47e02

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.