-
-
Notifications
You must be signed in to change notification settings - Fork 12
53 lines (44 loc) · 1.46 KB
/
docker-image.yml
File metadata and controls
53 lines (44 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Build and Push Docker Image
on:
push:
tags:
- "v*.*.*"
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Set up Python (no need for full Anaconda in CI)
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
# Install huggingface_hub CLI
- name: Install huggingface_hub CLI
run: pip install -U "huggingface_hub[cli]"
# Cache the downloaded model directory
- name: Cache HuggingFace model
id: cache-model
uses: actions/cache@v4
with:
path: app/models/BitNet-b1.58-2B-4T
key: bitnet-model-${{ hashFiles('**/docker-image.yml') }}
# Download the model if not cached
- name: Download BitNet model
if: steps.cache-model.outputs.cache-hit != 'true'
run: |
huggingface-cli download microsoft/BitNet-b1.58-2B-4T-gguf --local-dir app/models/BitNet-b1.58-2B-4T
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: grctest/fastapi_bitnet:latest