Skip to content

Commit bd0ec9e

Browse files
committed
chore(ci): fix model download to embed in img
1 parent a2d8e68 commit bd0ec9e

File tree

3 files changed

+4
-16
lines changed

3 files changed

+4
-16
lines changed

.github/workflows/publish-image-with-model.yml

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -68,24 +68,14 @@ jobs:
6868

6969
- name: Download model
7070
run: |
71-
MODEL_SIZE=""
72-
MODEL_SIZE_DESC=""
73-
7471
if [ "${{ github.event.inputs.model_size }}" == "small" ]; then
75-
MODEL_SIZE="418M"
76-
MODEL_SIZE_DESC="418M parameters, ~1GB disk space"
72+
make download-model-small
7773
elif [ "${{ github.event.inputs.model_size }}" == "medium" ]; then
78-
MODEL_SIZE="1.2B"
79-
MODEL_SIZE_DESC="1.2B parameters, ~2.5GB disk space"
74+
make download-model-medium
8075
elif [ "${{ github.event.inputs.model_size }}" == "large" ]; then
81-
MODEL_SIZE="12B"
82-
MODEL_SIZE_DESC="12B parameters, ~24GB disk space"
76+
make download-model-large
8377
fi
8478
85-
echo "Downloading ${{ github.event.inputs.model_size }} model ($MODEL_SIZE_DESC)..."
86-
mkdir -p models
87-
python -m babeltron.scripts.download_models --size $MODEL_SIZE --output-dir ./models
88-
8979
- name: Create Dockerfile with embedded model
9080
run: |
9181
cat > Dockerfile.with-model << EOF

babeltron/scripts/download_models.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,13 @@ def parse_args():
3333
def download_model(
3434
model_size: str = DEFAULT_MODEL_SIZE,
3535
output_dir: Optional[Union[str, Path]] = None,
36-
show_progress: bool = True,
3736
) -> str:
3837
"""
3938
Download M2M-100 model and tokenizer.
4039
4140
Args:
4241
model_size (str): Size of the model to download (418M, 1.2B, or 12B)
4342
output_dir (str or Path, optional): Directory to save the model to
44-
show_progress (bool): Whether to show a progress bar
4543
4644
Returns:
4745
str: Path to the downloaded model directory

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "babeltron"
3-
version = "0.3.4"
3+
version = "0.3.5"
44
dynamic = ["version"]
55
description = "A Python-based REST API that leverages single multilingual models like mBERT to provide efficient text translation services"
66
authors = [

0 commit comments

Comments
 (0)