#!/usr/bin/env bash # Deploy LLM Fishing to build-small-hackathon Hugging Face Space. # Prerequisites: hf auth login, membership in build-small-hackathon org. set -euo pipefail SPACE_ORG="build-small-hackathon" SPACE_NAME="${1:-llm-fishing}" REPO_ID="${SPACE_ORG}/${SPACE_NAME}" cd "$(dirname "$0")/.." if ! hf auth whoami &>/dev/null; then echo "Run: hf auth login" exit 1 fi echo "Creating Space ${REPO_ID} (if missing)..." hf repo create "$REPO_ID" --type space --space-sdk gradio --no-private -y 2>/dev/null || true if [[ ! -d .git ]]; then git init git branch -M main fi git add -A git commit -m "Deploy LLM Fishing hackathon Space" || true REMOTE="https://huggingface.co/spaces/${REPO_ID}" if ! git remote get-url origin &>/dev/null; then git remote add origin "$REMOTE" else git remote set-url origin "$REMOTE" fi echo "Pushing to ${REMOTE} ..." git push -u origin main --force echo "" echo "Space URL: https://huggingface.co/spaces/${REPO_ID}" echo "" echo "Add these Space secrets (Settings → Repository secrets):" echo " MODAL_TOKEN_ID — from modal token info / ~/.modal.toml" echo " MODAL_TOKEN_SECRET" echo " LLM_MODE=modal" echo " IMAGE_MODE=modal"