Spaces:
Sleeping
Sleeping
|
Download docs/HF_RELEASE_HOSTING.md from jrrribeiro/BirdNET-Uploader-App: direct link, hf CLI and curl.
- Browser
- Download file 5.71 kB
-
https://huggingface.co/spaces/jrrribeiro/BirdNET-Uploader-App/resolve/main/docs/HF_RELEASE_HOSTING.md
- Command line
-
hf download hf://spaces/jrrribeiro/BirdNET-Uploader-App/docs/HF_RELEASE_HOSTING.md
-
curl -L -o HF_RELEASE_HOSTING.md https://huggingface.co/spaces/jrrribeiro/BirdNET-Uploader-App/resolve/main/docs/HF_RELEASE_HOSTING.md
5.71 kB
| # Hostagem do Windows Portable no Hugging Face | |
| ## VisΓ£o Geral | |
| O Windows portable (`birdnet-uploader-windows.zip`) deve ser: | |
| 1. **ConstruΓdo** localmente com PyInstaller β (ConcluΓdo) | |
| 2. **Hospedado** em um repositΓ³rio Hugging Face (Dataset ou Space) | |
| 3. **BaixΓ‘vel** via link direto na pΓ‘gina web | |
| ## Arquitetura de Hospedagem | |
| ``` | |
| βββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| β Hugging Face Spaces (App Web) β | |
| β https://huggingface.co/spaces/your-org/... β | |
| β β | |
| β ββββββββββββββββββββββββββββββββββββ β | |
| β β BirdNET Uploader Interface β β | |
| β β β’ Web UI (Gradio) β β | |
| β β β’ β Download Windows Portable β β | |
| β β β’ Link para Dataset β β | |
| β ββββββββββββββββββββββββββββββββββββ β | |
| βββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| β (link) | |
| βββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| β Hugging Face Dataset (Release Repository) β | |
| β https://huggingface.co/datasets/your-org/... β | |
| β β | |
| β releases/v1.0.0/ β | |
| β βββ birdnet-uploader-1.0.0-windows.zip β | |
| β βββ birdnet-uploader-1.0.0-windows.zip.sha256β | |
| βββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| ``` | |
| ## OpΓ§Γ£o 1: Usar um Dataset Hugging Face (Recomendado) | |
| ### Passo 1: Criar um Dataset no HF | |
| 1. Acesse https://huggingface.co/new-dataset | |
| 2. Preencha: | |
| - **Repository name**: `birdnet-uploader-releases` | |
| - **License**: `mit` | |
| - **Private**: Deixe pΓΊblico para permitir downloads diretos | |
| ### Passo 2: Fazer Upload do Windows Portable | |
| ```bash | |
| # Configurar token HF (em primeira vez) | |
| huggingface-cli login | |
| # Ou definir variΓ‘vel de ambiente | |
| $env:HF_TOKEN = "hf_xxxxxxxxxxxx" | |
| # Upload via script Python | |
| python scripts/upload_release_to_hf.py ` | |
| --repo-id your-org/birdnet-uploader-releases ` | |
| --version 1.0.0 | |
| ``` | |
| ### Passo 3: Adicionar Link no Web UI | |
| Edite [src/uploader/web_ui.py](./src/uploader/web_ui.py) para adicionar o link de download: | |
| ```python | |
| with gr.Group("Download"): | |
| gr.Markdown(""" | |
| ## πΎ Download Windows Portable | |
| Para uploads maiores (>1 GB) sem limite de tamanho, baixe o executΓ‘vel portΓ‘til: | |
| **[π Download birdnet-uploader-1.0.0-windows.zip](https://huggingface.co/datasets/jrrribeiro/birdnet-uploader-releases/resolve/main/releases/v1.0.0/birdnet-uploader-1.0.0-windows.zip)** | |
| **Checksum SHA256:** | |
| ``` | |
| [SHA256 aqui] | |
| ``` | |
| """) | |
| ``` | |
| ## OpΓ§Γ£o 2: Hospedar Diretamente em um Space | |
| Se quiser hospedar o arquivo no prΓ³prio Space: | |
| ### Passo 1: Configurar Space com "Large File" Storage | |
| 1. VΓ‘ para o Settings do seu Space | |
| 2. Em "Persistent Data", ative "Ephemeral storage" ou use a aba "Files" | |
| 3. Upload manual do arquivo via interface | |
| ### Passo 2: Servir o Arquivo via Gradio | |
| ```python | |
| import gr | |
| from pathlib import Path | |
| exe_path = Path("releases/birdnet-uploader-1.0.0-windows.zip") | |
| if exe_path.exists(): | |
| with gr.Group("Download Windows Portable"): | |
| gr.File( | |
| label="π₯ Click to download Windows portable", | |
| value=str(exe_path), | |
| ) | |
| ``` | |
| β οΈ **LimitaΓ§Γ£o**: EspaΓ§o limitado, melhor para versΓ£o ΓΊnica. | |
| ## OpΓ§Γ£o 3: GitHub Releases + Link no HF | |
| Se vocΓͺ usar GitHub para gerenciar releases: | |
| ```python | |
| # No web_ui.py | |
| download_url = "https://github.com/jrrribeiro/BirdNET-Uploader-App/releases/download/v1.0.0/birdnet-uploader-1.0.0-windows.zip" | |
| with gr.Group("Download"): | |
| gr.Markdown(f""" | |
| [π₯ Download Windows Portable](download_url) | |
| """) | |
| ``` | |
| ## Fluxo de Release Completo | |
| ### Para cada nova versΓ£o (ex: 1.0.0): | |
| ```bash | |
| # 1. Build local β (jΓ‘ feito) | |
| python build/release_uploader.py --version 1.0.0 | |
| # 2. Verificar arquivo | |
| dir build\release\*.zip | |
| # 3. Upload para HF Dataset | |
| python scripts/upload_release_to_hf.py ` | |
| --repo-id your-org/birdnet-uploader-releases ` | |
| --version 1.0.0 | |
| # 4. Atualizar link no cΓ³digo | |
| # Edite src/uploader/web_ui.py com novo link | |
| # 5. Commit e push para repo | |
| git add -A | |
| git commit -m "Release v1.0.0: Windows portable" | |
| git push | |
| ``` | |
| ## ValidaΓ§Γ£o de Download | |
| ### Para usuΓ‘rios, validar integridade: | |
| ```powershell | |
| # ApΓ³s download | |
| $expected = "hash-sha256-aqui" | |
| $actual = (Get-FileHash -Path "birdnet-uploader-1.0.0-windows.zip" -Algorithm SHA256).Hash | |
| if ($actual -eq $expected) { | |
| Write-Host "β Arquivo verificado com sucesso" | |
| } else { | |
| Write-Host "β Checksum invΓ‘lido!" | |
| } | |
| ``` | |
| ## Melhorias Futuras | |
| 1. **CDN**: Usar Cloudflare CDN para acelerar downloads | |
| 2. **Auto-update**: Implementar verificaΓ§Γ£o de versΓ£o no app | |
| 3. **Code signing**: Assinar o .exe com certificado | |
| 4. **Mirror**: Hospedar em multiple plataformas (GitHub, SourceForge, etc) | |
| ## RecomendaΓ§Γ£o Final | |
| **Use a OpΓ§Γ£o 1 (Dataset HF)** porque: | |
| - β Hospedagem gratuita e ilimitada | |
| - β Download automΓ‘tico com HF CDN (rΓ‘pido) | |
| - β Versionamento histΓ³rico | |
| - β FΓ‘cil integraΓ§Γ£o com Space | |
| - β Sem dependΓͺncia de GitHub | |