Skip to content

Commit

Permalink
Migrate Text Generation Metrics to valor-lite (#802)
Browse files Browse the repository at this point in the history
Co-authored-by: b.nativi <[email protected]>
Co-authored-by: Charles Zaloom <[email protected]>
  • Loading branch information
3 people authored Oct 31, 2024
1 parent 18fbfd0 commit ce8d261
Show file tree
Hide file tree
Showing 47 changed files with 7,548 additions and 108 deletions.
38 changes: 0 additions & 38 deletions .github/workflows/core-benchmark-evaluations.yml

This file was deleted.

36 changes: 0 additions & 36 deletions .github/workflows/core-tests-and-coverage.yml

This file was deleted.

46 changes: 23 additions & 23 deletions .github/workflows/lite-tests-and-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,56 +22,56 @@ jobs:
- name: run classification tests and report coverage
run: |
pip install -e ".[test]"
COVERAGE_FILE=.coverage.classification python -m coverage run --omit "tests/*" -m pytest -v tests/classification/
COVERAGE_FILE=.coverage.classification python -m coverage run --include "valor_lite/*" -m pytest -v tests/classification/
python -m coverage combine
python -m coverage report -m
python -m coverage json
export TOTAL=$(python -c "import json;print(json.load(open('coverage.json'))['totals']['percent_covered_display'])")
echo "total=$TOTAL" >> $GITHUB_ENV
if (( $TOTAL < 90 )); then
echo "Coverage is below 90%"
if (( $TOTAL < 99 )); then
echo "Coverage is below 99%"
exit 1
fi
working-directory: ./lite
- name: run object detection tests and report coverage
run: |
pip install -e ".[test]"
COVERAGE_FILE=.coverage.detection python -m coverage run --omit "tests/*" -m pytest -v tests/object_detection/
COVERAGE_FILE=.coverage.detection python -m coverage run --include "valor_lite/*" -m pytest -v tests/object_detection/
python -m coverage combine
python -m coverage report -m
python -m coverage json
export TOTAL=$(python -c "import json;print(json.load(open('coverage.json'))['totals']['percent_covered_display'])")
echo "total=$TOTAL" >> $GITHUB_ENV
if (( $TOTAL < 90 )); then
echo "Coverage is below 90%"
if (( $TOTAL < 99 )); then
echo "Coverage is below 99%"
exit 1
fi
working-directory: ./lite
- name: run semantic segmentation tests and report coverage
run: |
pip install -e ".[test]"
COVERAGE_FILE=.coverage.segmentation python -m coverage run --omit "tests/*" -m pytest -v tests/semantic_segmentation/
COVERAGE_FILE=.coverage.segmentation python -m coverage run --include "valor_lite/*" -m pytest -v tests/semantic_segmentation/
python -m coverage combine
python -m coverage report -m
python -m coverage json
export TOTAL=$(python -c "import json;print(json.load(open('coverage.json'))['totals']['percent_covered_display'])")
echo "total=$TOTAL" >> $GITHUB_ENV
if (( $TOTAL < 90 )); then
echo "Coverage is below 90%"
if (( $TOTAL < 99 )); then
echo "Coverage is below 99%"
exit 1
fi
working-directory: ./lite
- name: run text generation tests and report coverage
run: |
pip install -e ".[test,openai,mistral]"
COVERAGE_FILE=.coverage.text_generation python -m coverage run --include "valor_lite/*" -m pytest -v tests/text_generation/
python -m coverage combine
python -m coverage report -m
python -m coverage json
export TOTAL=$(python -c "import json;print(json.load(open('coverage.json'))['totals']['percent_covered_display'])")
echo "total=$TOTAL" >> $GITHUB_ENV
if (( $TOTAL < 99 )); then
echo "Coverage is below 99%"
exit 1
fi
working-directory: ./lite
# - name: run nlp generation tests and report coverage
# run: |
# pip install -e ".[test]"
# COVERAGE_FILE=.coverage.generation python -m coverage run --omit "tests/*" -m pytest -v tests/text_generation
# python -m coverage combine
# python -m coverage report -m
# python -m coverage json
# export TOTAL=$(python -c "import json;print(json.load(open('coverage.json'))['totals']['percent_covered_display'])")
# echo "total=$TOTAL" >> $GITHUB_ENV
# if (( $TOTAL < 90 )); then
# echo "Coverage is below 90%"
# exit 1
# fi
# working-directory: ./lite
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ core-tests:
pytest ./core/tests/unit-tests
pytest ./core/tests/functional-tests

lite-tests:
pytest ./lite/tests/text_generation

start-server:
POSTGRES_PASSWORD=password POSTGRES_HOST=localhost POSTGRES_DB=valor uvicorn valor_api.main:app --host 0.0.0.0

Expand Down
Loading

0 comments on commit ce8d261

Please sign in to comment.