pawmap / setup-git.sh
sara.mesquita
feat: Animal Visto app
b2ebfa6
#!/bin/bash
# setup-git.sh — Conecta o projeto ao HF Space e faz o primeiro push.
# Execute no terminal dentro da pasta animal-visto/
#
# Antes de rodar:
# 1. Crie um token de escrita em https://huggingface.co/settings/tokens
# 2. Exporte: export HF_TOKEN=hf_xxxxxxxxxxxxxxxxx
# 3. chmod +x setup-git.sh && ./setup-git.sh
set -e
SPACE_URL="https://huggingface.co/spaces/build-small-hackathon/pawmap"
HF_GIT_URL="https://user:${HF_TOKEN}@huggingface.co/spaces/build-small-hackathon/pawmap"
echo "🐾 Animal Visto — setup git"
# Inicializar git se ainda não existir
if [ ! -d ".git" ]; then
git init
git branch -M main
fi
# Configurar remote
if git remote get-url origin &>/dev/null; then
git remote set-url origin "$HF_GIT_URL"
else
git remote add origin "$HF_GIT_URL"
fi
# LFS para arquivos grandes (HF recomenda)
git lfs install
git lfs track "*.jpg" "*.png" "*.db"
git add .gitattributes 2>/dev/null || true
# Commit e push
git add .
git commit -m "feat: initial Animal Visto app
- Gradio UI mobile-first com mapa Leaflet
- Integração NVIDIA NIM (Nemotron Nano VL)
- Matching por cosine similarity (sentence-transformers)
- SQLite persistente via HF Storage Bucket"
echo ""
echo "Fazendo push para $SPACE_URL ..."
git push --force origin main
echo ""
echo "✅ Deploy feito! Acesse: $SPACE_URL"
echo ""
echo "⚙️ Não esqueça de configurar os secrets no Space Settings:"
echo " NVIDIA_API_KEY = sua chave em https://build.nvidia.com"