Skip to content

Commit b2099a6

Browse files
Peter JohnsonPeter Johnson
authored andcommitted
Workflows to use LFS, update dockerfile and dependencies (remove nltk
1 parent 46c210e commit b2099a6

File tree

7 files changed

+19
-15
lines changed

7 files changed

+19
-15
lines changed

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
uses: actions/checkout@v4
2626
with:
2727
fetch-depth: 0
28+
lfs: true
2829

2930
- name: Set up Python ${{ matrix.python-version }}
3031
id: python-setup
@@ -103,4 +104,3 @@ jobs:
103104
aws-key-id: ${{ secrets.LAMBDA_CONTAINER_PIPELINE_AWS_ID }}
104105
aws-secret-key: ${{ secrets.LAMBDA_CONTAINER_PIPELINE_AWS_SECRET}}
105106
function-admin-api-key: ${{ secrets.FUNCTION_ADMIN_API_KEY}}
106-

.github/workflows/production-deploy.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ jobs:
3535
uses: actions/checkout@v4
3636
with:
3737
fetch-depth: 0
38+
lfs: true
3839

3940
- name: Set up Python ${{ matrix.python-version }}
4041
id: python-setup

.github/workflows/staging-deploy.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
uses: actions/checkout@v4
2626
with:
2727
fetch-depth: 0
28+
lfs: true
2829

2930
- name: Set up Python ${{ matrix.python-version }}
3031
id: python-setup

Dockerfile

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,12 @@ RUN --mount=type=cache,target=$POETRY_CACHE_DIR \
2020
find /app/.venv -path "*/tests/*" -delete && \
2121
find /app/.venv -path "*/test/*" -delete && \
2222
find /app/.venv -name "*.md" -delete && \
23-
find /app/.venv -name "*.txt" -delete &&\
24-
# Download NLTK corpora into the venv so it's cached ---
25-
/app/.venv/bin/python -m nltk.downloader -d /app/.venv/nltk_data brown reuters gutenberg webtext punkt punkt_tab
26-
27-
ENV NLTK_DATA=/app/.venv/nltk_data
23+
find /app/.venv -name "*.txt" -delete
2824

2925
FROM ghcr.io/lambda-feedback/evaluation-function-base/python:3.12
3026

3127
ENV VIRTUAL_ENV=/app/.venv \
3228
PATH="/app/.venv/bin:$PATH"
33-
ENV NLTK_DATA=/app/.venv/nltk_data
3429

3530
# Copy the cleaned virtual environment
3631
COPY --from=builder ${VIRTUAL_ENV} ${VIRTUAL_ENV}

evaluation_function/models/shannon_words_ngram.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@
88
from .utils import csv_to_lists, build_counts
99

1010

11+
import sys, traceback
12+
def log(msg):
13+
sys.stdout.write(msg + "\n")
14+
sys.stdout.flush()
15+
16+
log(f"[DEBUG] Starting shannon_words_ngram.py")
17+
1118
# Local users run the following once (no need if using Docker):
1219
#nltk.download("brown"); nltk.download("reuters"); nltk.download("gutenberg"); nltk.download("webtext") # CHANGE (one-time)
1320

poetry.lock

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ typing_extensions = "^4.12.2"
2626
lf_toolkit = { git = "https://github.com/lambda-feedback/toolkit-python.git", branch = "main", extras = [
2727
"ipc",
2828
] }
29-
nltk = "^3.9.2"
3029
numpy = "^2.3.4"
3130

3231
[tool.poetry.group.overrides.dependencies]
@@ -39,6 +38,7 @@ sympy = ">=1.13.3"
3938
[tool.poetry.group.dev.dependencies]
4039
pytest = "^8.2.2"
4140
flake8 = "^7.1.0"
41+
nltk = "^3.9.2"
4242

4343
[build-system]
4444
requires = ["poetry-core"]

0 commit comments

Comments
 (0)