Download DEPLOY.md from SolarWine/api: direct link, hf CLI and curl.
- Browser
- Download file 3.2 kB
-
https://huggingface.co/spaces/SolarWine/api/resolve/main/DEPLOY.md
- Command line
-
hf download hf://spaces/SolarWine/api/DEPLOY.md
-
curl -L -o DEPLOY.md https://huggingface.co/spaces/SolarWine/api/resolve/main/DEPLOY.md
ש# Deploy Streamlit app (free – Streamlit Community Cloud)
1. Prerequisites
- App code in a public GitHub repo (e.g.
solarwine-ai/Baseline). - A Streamlit Community Cloud account (sign in with GitHub).
sensors_wide_sample.csvcommitted underData/Seymour/(already in the repo).
2. Deploy steps
Go to https://share.streamlit.io and sign in with GitHub.
Click "New app".
Set:
- Repository:
solarwine-ai/Baseline(or your fork). - Branch:
main. - Main file path:
app.py.
- Repository:
Click "Advanced settings" and set:
- Python version: 3.11 (or match your local).
- Leave Requirements file as
requirements.txt(repo root).
Under Secrets, add your IMS API token so the app can fetch IMS data:
IMS_API_TOKEN = "your-ims-api-token-here"Streamlit Cloud injects secrets as environment variables; the app reads
IMS_API_TOKENfrom the environment viaos.environ.Click "Deploy". The first build may take a few minutes.
3. How data works on Community Cloud
Sensor data (Stage 1): The full
sensors_wide.csv(982 MB) is gitignored. Instead, a trimmedsensors_wide_sample.csv(~2.7 MB, Stage 1 columns only, growing season May-Sep) is committed. The app automatically falls back to the sample when the full file is absent — no code changes needed.IMS data (Stage 2): Click Download IMS 2024–2025 in the sidebar (requires
IMS_API_TOKENin Secrets), then Run Stage 2. IMS data is fetched at runtime; free-tier memory and CPU limits apply to very large or long-running fetches.Secrets: Never commit
.envor real tokens. Use only the Secrets field in the Streamlit Cloud app settings.
4. Regenerating the sample CSV locally
If you update the full sensor data and need to refresh the sample:
python -m scripts.create_sample_data
This reads sensors_wide.csv, extracts Stage 1 columns for May-Sep, and writes
sensors_wide_sample.csv. Commit the updated sample.
5. Configuration files
.streamlit/config.toml— setsheadless = trueand light theme for Cloud.requirements.txt— Python dependencies (already in repo root).- No
packages.txtneeded (no OS-level dependencies).
6. Chronos-2 long training (local)
To run LoRA fine-tuning with a large context window until results converge (single run, tuned for 32 GB RAM / 10 CPU cores):
cd /path/to/Baseline
PYTHONPATH=. conda run -n solarwine python scripts/run_chronos_long_training.py \
--device cpu \
--context-days 28 \
--num-steps 4000 \
--batch-size 16
- Output: Checkpoints in
outputs/chronos_finetuned_long/; benchmark rowlora / allappended tooutputs/chronos_benchmark.csv; sample plotoutputs/chronos_forecast_sample.png. - Convergence: Chronos does not support resuming LoRA across multiple
fit()calls; use one large--num-steps(e.g. 4000–6000). Training uses built-in validation; adjust--learning-rate(default1e-5) if needed. - Resources: Script sets
OMP_NUM_THREADSfrom CPU count; use--batch-size 8on lower memory.