Skip to content

Commit 5e9fec2

Browse files
fix: ci (#1)
* fix: ci
1 parent 6921139 commit 5e9fec2

File tree

7 files changed

+29
-15
lines changed

7 files changed

+29
-15
lines changed

.github/workflows/build_docs.yaml

+5-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ jobs:
1010
deploy:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v3
13+
- uses: actions/checkout@v4
1414
- name: Install Python
15-
uses: actions/setup-python@v4
15+
uses: actions/setup-python@v5
16+
with:
17+
python-version: '3.11'
1618
- name: Setup pandoc
1719
run: |
1820
wget https://github.com/jgm/pandoc/releases/download/2.18/pandoc-2.18-1-amd64.deb && sudo dpkg -i pandoc-2.18-1-amd64.deb
@@ -29,7 +31,7 @@ jobs:
2931
path: ./.venv
3032
key: venv-${{ hashFiles('poetry.lock') }}
3133
- name: Install the project dependencies
32-
run: poetry install
34+
run: poetry install --only dev
3335

3436
- name: Build docs
3537
run: poetry run mkdocs gh-deploy --force

.github/workflows/python-publish.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ jobs:
2121
environment: publish
2222

2323
steps:
24-
- uses: actions/checkout@v3
25-
- name: Set up Python
26-
uses: actions/setup-python@v3
24+
- uses: actions/checkout@v4
25+
- name: Install Python
26+
uses: actions/setup-python@v5
2727
with:
28-
python-version: '3.x'
28+
python-version: '3.11'
2929
- name: Install dependencies
3030
run: |
3131
python -m pip install --upgrade pip

.github/workflows/test.yaml

+10-6
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,18 @@ jobs:
1111
strategy:
1212
fail-fast: false
1313
matrix:
14-
python-version: [ "3.11"]
14+
python-version: ["3.11"]
1515
poetry-version: ["1.7"]
1616
# os: [ubuntu-latest, macos-latest, windows-latest]
1717
os: [ubuntu-latest]
1818
runs-on: ${{ matrix.os }}
1919
steps:
20-
- uses: actions/checkout@v3
20+
- uses: actions/checkout@v4
2121
- name: Install Python
22-
uses: actions/setup-python@v4
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: ${{ matrix.python-version }}
25+
2326
# see details (matrix, python-version, python-version-file, etc.)
2427
# https://github.com/actions/setup-python
2528
- name: Install poetry
@@ -37,13 +40,14 @@ jobs:
3740
run: poetry install
3841

3942
- name: Run tests and generate coverage report
40-
run: poetry run pytest --doctest-modules -v --cov=mppt --cov-fail-under 0 --cov-report=term --cov-report=xml --cov-report=html
43+
run: poetry run pytest --doctest-modules -v --cov=toyllm --cov-fail-under 0 --cov-report=term --cov-report=xml --cov-report=html
4144

4245
- name: Upload coverage to Codecov
43-
uses: codecov/codecov-action@v3
44-
if: success() && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.8'
46+
uses: codecov/codecov-action@v4.0.1
47+
if: success() && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
4548
with:
4649
token: ${{ secrets.CODECOV_TOKEN }}
50+
slug: toy-ai/toyllm
4751
files: ./coverage.xml
4852
fail_ci_if_error: true
4953
verbose: true

CHANGELOG.md

-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@
22

33

44
## [Unreleased]
5-

README.md

-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@
22

33
ToyLLM is a simple language model that can be used to generate text.
44
It is based on the [GPT-2](https://huggingface.co/transformers/model_doc/gpt2.html) model.
5-

tests/test_device.py

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from toyllm.device import get_device
2+
3+
4+
def test_device():
5+
device = get_device()
6+
assert device.type in ("cuda", "cpu")

toyllm/device/__init__.py

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import torch
2+
3+
def get_device() -> torch.device:
4+
return torch.device("cuda" if torch.cuda.is_available() else "cpu")

0 commit comments

Comments
 (0)