# DESI Spectra Zoo Setup Guide ## Deploy to HuggingFace Spaces ### 1. Create a new Space - Go to [huggingface.co/new-space](https://huggingface.co/new-space) - Choose a name (e.g. `desi-spectra-zoo`) - Select **Docker** as the SDK - Set visibility to Public or Private - Click Create Space ### 2. Clone the Space and add files ```bash git clone https://huggingface.co/spaces/YOUR_USERNAME/desi-spectra-zoo cd desi-spectra-zoo # Copy all project files into this directory: # app.py, Dockerfile, requirements.txt, dataset_config.yaml, src/ git add . git commit -m "Initial deploy" git push ``` ### 3. Create a HuggingFace dataset for logging - Go to [huggingface.co/new-dataset](https://huggingface.co/new-dataset) - Name it something like `desi-spectra-zoo-logs` - This stores annotation state and logs ### 4. Create a HuggingFace token - Go to [huggingface.co/settings/tokens](https://huggingface.co/settings/tokens) - Create a new token with **Read & Write** access to the dataset repo from step 3 ### 5. Add secrets to the Space - Go to your Space's Settings page - Under **Repository secrets**, add: - `HF_LOG_REPO_ID` = `YOUR_USERNAME/desi-spectra-zoo-logs` - `HF_TOKEN` = the token from step 4 The Space will automatically rebuild after adding secrets. ### 6. Local development (optional) Create a `.env` file in the project root: ``` HF_LOG_REPO_ID=YOUR_USERNAME/desi-spectra-zoo-logs HF_TOKEN=hf_your_token_here ``` Make sure `.env` is in `.gitignore` (it already is by default). Run locally: ```bash python app.py ```