Spaces:
Sleeping
Sleeping
File size: 1,674 Bytes
08b3957 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | # Hugging Face Space Deployment Process
If uploads through the Hugging Face web UI keep failing with package errors, use this Git-based flow instead. It preserves correct file line endings and avoids CRLF conversion issues.
## Why this is needed
When files are uploaded via UI from Windows, line endings may become CRLF (`\r\n`). In Linux build containers, this can break `packages.txt` parsing and cause errors like:
- `E: Unable to locate package texlive-latex-base`
- `E: Unable to locate package texlive-latex-extra`
## Step-by-step deployment
### 1) Clone your Hugging Face Space
```bash
git clone https://huggingface.co/spaces/YOUR_USERNAME/YOUR_SPACE_NAME
```
You will be prompted for credentials:
- Username: your Hugging Face username
- Password: use a Hugging Face Access Token (not account password)
Create token here: https://huggingface.co/settings/tokens (with `write` permission)
### 2) Copy your local project files into the cloned Space repo
```bash
xcopy /E /Y "D:\Projects\Personal_assistant\*" "D:\Projects\YOUR_SPACE_NAME\"
```
### 3) Enforce LF line endings before commit
Inside the cloned Space folder:
```bash
cd D:\Projects\YOUR_SPACE_NAME
git add --renormalize .
```
This ensures files are normalized with `.gitattributes` rules.
### 4) Commit and push
```bash
git add .
git commit -m "Deploy app with correct line endings"
git push
```
The Space rebuild starts automatically after push.
## Recommended ongoing workflow
For all future updates:
1. Update files locally.
2. Copy changes into the cloned Space repo.
3. Run `git add .`, `git commit`, and `git push`.
Prefer Git push over web UI uploads for deployment reliability.
|