Assitant-Tiya / deploy_process.md
dhanvanth183's picture
Added gitignore, pdf viewer replaced with image viewer
08b3957
# 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.