Push to Replicate #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Push to Replicate | |
on: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v4.7.1 | |
with: | |
python-version: 3.11 | |
- name: Setup Cog | |
uses: replicate/setup-cog@v1 | |
with: | |
token: ${{ secrets.REPLICATE_API_TOKEN }} | |
- name: Download weights | |
run: | | |
pip install -U huggingface_hub[cli] | |
huggingface-cli download BAAI/bge-reranker-large --local-dir bge-reranker-large/checkpoints --local-dir-use-symlink False | |
huggingface-cli download BAAI/bge-reranker-base --local-dir bge-reranker-base/checkpoints --local-dir-use-symlink False | |
- name: 'Login to GitHub Container Registry' | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{github.actor}} | |
password: ${{secrets.GITHUB_TOKEN}} | |
- name: Build & Push Image | |
run: | | |
cd bge-reranker-base/ && cog build -t ghcr.io/${{github.actor}}/bge-reranker-base:latest && docker push ghcr.io/ninehills/bge-reranker-base:latest | |
- name: Push to Replicate | |
run: | | |
echo OK |