Skip to content

Commit

Permalink
Add text generation task type (#569)
Browse files Browse the repository at this point in the history
Co-authored-by: b.nativi <[email protected]>
Co-authored-by: Nick L <[email protected]>
Co-authored-by: Charles Zaloom <[email protected]>
  • Loading branch information
4 people authored Jul 26, 2024
1 parent 01b92a8 commit b1d5030
Show file tree
Hide file tree
Showing 52 changed files with 9,256 additions and 109 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/tests-and-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,16 @@ jobs:
- name: install client
run: pip install -e ".[test]"
working-directory: ./client
- run: coverage run --source="api/valor_api,client/valor" -m pytest -v integration_tests/client/*
- name: run integration tests
run: coverage run --source="api/valor_api,client/valor" -m pytest -v integration_tests/client/*
- name: run external integration tests
run: |
if ${{ github.ref == 'refs/heads/main' }}; then
coverage run --source="api/valor_api,client/valor" -m pytest -v integration_tests/external/*
fi
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }}
- run: coverage report
- name: upload coverage report as artifact
uses: actions/upload-artifact@v3
Expand Down
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,10 @@ repos:
"GeoAlchemy2",
"psycopg2-binary",
"pgvector",
"openai",
"mistralai",
"absl-py",
"nltk",
"rouge_score",
"evaluate",
]
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,6 @@ start-server:

integration-tests:
python -m pytest -v ./integration_tests/client

external-integration-tests:
python -m pytest -v ./integration_tests/external
7 changes: 3 additions & 4 deletions api/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM python:3.10-alpine
FROM python:3.10-slim

ARG VERSION="0.0.0-dev"

RUN apk add --update --no-cache build-base libpq-dev gcc libffi-dev
RUN apt-get update && apt-get install build-essential libpq-dev -y

COPY ./pyproject.toml /src/

Expand All @@ -13,6 +13,5 @@ RUN python -m pip install -U pip
# git and put .git (which setuptools_scm needs to determine the version) in the container
RUN SETUPTOOLS_SCM_PRETEND_VERSION=${VERSION} python -m pip install .
COPY ./valor_api /src/valor_api
RUN apk del build-base
USER 65532:65532

CMD ["uvicorn", "valor_api.main:app", "--host", "0.0.0.0", "--log-level", "warning"]
6 changes: 6 additions & 0 deletions api/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ dependencies = [
"pydantic-settings",
"structlog",
"pgvector",
"openai",
"mistralai",
"absl-py",
"nltk",
"rouge_score",
"evaluate"
]

[build-system]
Expand Down
Loading

0 comments on commit b1d5030

Please sign in to comment.