Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
lm-evaluation-harness
Commits
94cba287
Commit
94cba287
authored
Jul 14, 2023
by
baberabb
Browse files
Add CI setup
parent
0a48d7c5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
82 additions
and
60 deletions
+82
-60
.github/workflows/python-app.yml
.github/workflows/python-app.yml
+38
-38
.github/workflows/python-package.yml
.github/workflows/python-package.yml
+36
-21
setup.py
setup.py
+7
-0
tests/test_evaluator.py
tests/test_evaluator.py
+1
-1
No files found.
.github/workflows/python-app.yml
View file @
94cba287
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name
:
Build
on
:
push
:
pull_request
:
workflow_dispatch
:
jobs
:
build
:
runs-on
:
ubuntu-latest
strategy
:
matrix
:
python-version
:
[
"
3.8"
,
"
3.9"
,
"
3.10"
]
steps
:
-
uses
:
actions/checkout@v3
-
name
:
Set up Python ${{ matrix.python-version }}
uses
:
actions/setup-python@v3
with
:
python-version
:
${{ matrix.python-version }}
-
name
:
Install dependencies
run
:
|
python -m pip install --upgrade pip
pip install flake8 pytest pytest-cov
pip install -e .[dev,multilingual]
# Install optional git dependencies
pip install bleurt@https://github.com/google-research/bleurt/archive/b610120347ef22b494b6d69b4316e303f5932516.zip#egg=bleurt
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
-
name
:
Lint with flake8
run
:
|
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
-
name
:
Test with pytest
run
:
|
pytest -vv tests/evaluator.py
# - name: Upload to codecov
#name: Build
#
#on:
# push:
# pull_request:
# workflow_dispatch:
#
#jobs:
# build:
# runs-on: ubuntu-latest
# strategy:
# matrix:
# python-version: ["3.8", "3.9", "3.10"]
# steps:
# - uses: actions/checkout@v3
# - name: Set up Python ${{ matrix.python-version }}
# uses: actions/setup-python@v3
# with:
# python-version: ${{ matrix.python-version }}
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# pip install flake8 pytest pytest-cov
# pip install -e .[dev,multilingual]
# # Install optional git dependencies
# pip install bleurt@https://github.com/google-research/bleurt/archive/b610120347ef22b494b6d69b4316e303f5932516.zip#egg=bleurt
# if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
# - name: Lint with flake8
# run: |
# # stop the build if there are Python syntax errors or undefined names
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
# - name: Test with pytest
# run: |
# bash <(curl -s https://codecov.io/bash) -t $CODECOV_TOKEN
# pytest -vv tests/evaluator.py
## - name: Upload to codecov
## run: |
## bash <(curl -s https://codecov.io/bash) -t $CODECOV_TOKEN
.github/workflows/python-package.yml
View file @
94cba287
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name
:
Python package
name
:
Tests
on
:
push
:
...
...
@@ -9,34 +9,49 @@ on:
workflow_dispatch
:
jobs
:
build
:
linter
:
name
:
Linters
runs-on
:
ubuntu-latest
strategy
:
fail-fast
:
false
matrix
:
python-version
:
[
"
3.9"
]
timeout-minutes
:
20
steps
:
-
uses
:
actions/checkout@v3
-
name
:
Set up Python ${{ matrix.python-version }}
uses
:
actions/setup-python@v3
-
name
:
Checkout Code
uses
:
actions/checkout@v3
-
name
:
Set up Python
3.8
uses
:
actions/setup-python@v4
with
:
python-version
:
${{ matrix.python-version }}
python-version
:
3.9
-
name
:
Install dependencies
run
:
|
python -m pip install --upgrade pip
pip install flake8 pytest pytest-cov
pip install -e .[dev,multilingual]
# Install optional git dependencies
pip install bleurt@https://github.com/google-research/bleurt/archive/b610120347ef22b494b6d69b4316e303f5932516.zip#egg=bleurt
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
run
:
pip install -e '.[linting,testing]' --extra-index-url https://download.pytorch.org/whl/cpu
-
name
:
Lint with flake8
run
:
|
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,
F63,F7,F82
--show-source --statistics
flake8 . --count --select=
F,
E9,
E71,E72,E501,E112,E113,W6
--show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
-
name
:
Test with pytest
-
name
:
Lint with pylint
run
:
python -m pylint --disable=all -e W0311 --jobs=0 --indent-string=' ' **/*.py
-
name
:
Lint with mypy
run
:
mypy tinygrad/ --ignore-missing-imports --check-untyped-defs --explicit-package-bases --warn-unreachable
testcpu
:
name
:
CPU Tests
runs-on
:
ubuntu-latest
timeout-minutes
:
20
steps
:
-
name
:
Checkout Code
uses
:
actions/checkout@v3
-
name
:
Set up Python
3.9
uses
:
actions/setup-python@v4
with
:
python-version
:
3.9
-
name
:
Install dependencies
run
:
|
pytest tests/test_evaluator.py
python -m pip install --upgrade pip
pip -e '.[testing]' --extra-index-url https://download.pytorch.org/whl/cpu
# Install optional git dependencies
# pip install bleurt@https://github.com/google-research/bleurt/archive/b610120347ef22b494b6d69b4316e303f5932516.zip#egg=bleurt
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
-
name
:
Test with pytest
run
:
python -m pytest -s -v -n=auto tests/test_evaluator.py
setup.py
View file @
94cba287
...
...
@@ -50,6 +50,13 @@ setuptools.setup(
],
extras_require
=
{
"dev"
:
[
"black"
,
"flake8"
,
"pre-commit"
,
"pytest"
,
"pytest-cov"
],
"linting"
:
[
"flake8"
,
"pylint"
,
"mypy"
,
"pre-commit"
,
],
"testing"
:
[
"pytest"
,
"pytest-cov"
,
"pytest-xdist"
],
"multilingual"
:
[
"nagisa>=0.2.7"
,
"jieba>=0.42.1"
],
"sentencepiece"
:
[
"sentencepiece>=0.1.98"
,
"protobuf>=4.22.1"
],
"promptsource"
:
[
...
...
tests/test_evaluator.py
View file @
94cba287
...
...
@@ -16,7 +16,7 @@ import pytest
@
pytest
.
mark
.
parametrize
(
(
"task_name,limit,model,model_args"
)
,
"task_name,limit,model,model_args"
,
[
(
[
"arc_easy"
],
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment