Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .github/workflows/sync-hf-space.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ name: Sync to Hugging Face Space
# 0.0.0.0:8080 — matched by `app_port: 8080` in the Space metadata).
#
# One-time setup (see README → "Deploy to Hugging Face Spaces"):
# 1. Create a Docker Space on huggingface.co.
# 1. Create a Gradio Space on huggingface.co.
# 2. Add a repo secret HF_TOKEN (a HF access token with write scope).
# 3. Optionally set repo variables HF_USERNAME / HF_SPACE (they default to the
# GitHub owner and "conflens").
# 3. Optionally set repo variables HF_USERNAME / HF_SPACE (they default to
# "picault" and "conflens").
# 4. Add your LLM API keys as *Space* secrets in the Space settings.
on:
push:
Expand Down Expand Up @@ -42,7 +42,9 @@ jobs:
- name: Push to Hugging Face Space
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
HF_USERNAME: ${{ vars.HF_USERNAME || github.repository_owner }}
# HF owner defaults to 'picault' (the HF username differs from the
# GitHub owner 'picaultj'); override with the HF_USERNAME repo variable.
HF_USERNAME: ${{ vars.HF_USERNAME || 'picault' }}
HF_SPACE: ${{ vars.HF_SPACE || 'conflens' }}
run: |
set -euo pipefail
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,9 @@ Action mirrors `main` to the Space on every push, so it stays in sync.
scope (Settings → Access Tokens) and add it to this GitHub repo as a secret
named **`HF_TOKEN`** (Settings → Secrets and variables → Actions).
3. **Point the action at your Space** *(optional)* — the workflow defaults to
owner = the GitHub repo owner and space = `conflens`. If your Space differs,
set repo **variables** `HF_USERNAME` and `HF_SPACE`.
owner `picault` and space `conflens` (the HF username differs from the GitHub
owner). If your Space differs, set repo **variables** `HF_USERNAME` and
`HF_SPACE`.
4. **Add your API keys as *Space* secrets** — in the Space's *Settings →
Variables and secrets*, add whatever your provider needs (e.g.
`ANTHROPIC_API_KEY`, or `OPENAI_API_KEY` / `OPENAI_BASE_URL`; see
Expand Down
Loading