Skip to content

Commit 89fc676

Browse files
committed
chore: build workflow
1 parent c258948 commit 89fc676

File tree

2 files changed

+50
-2
lines changed

2 files changed

+50
-2
lines changed

.github/workflows/build.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Build
2+
3+
on:
4+
pull_request:
5+
workflow_call:
6+
secrets:
7+
OPENAI_API_KEY:
8+
required: true
9+
ANTHROPIC_API_KEY:
10+
required: true
11+
12+
jobs:
13+
build:
14+
name: Build & Test
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Python
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: "3.x"
23+
- name: Install dependencies
24+
run: |
25+
python -m pip install --upgrade pip
26+
pip install poetry
27+
poetry install
28+
29+
- name: Run tests
30+
run: |
31+
poetry run pytest
32+
33+
- name: Build
34+
run: |
35+
pip install poetry
36+
poetry build
37+
38+
- uses: actions/upload-artifact@v4
39+
with:
40+
path: ./dist

tests/test_functional/models_configuration.py

+10-2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
},
1717
]
1818

19+
n_gpu_layers = (
20+
0 # -1 to offload on GPU. Until GPU is supported on Github, must be run on CPU
21+
)
22+
1923

2024
def _model_local_path(model) -> str:
2125
return os.path.join(
@@ -30,7 +34,11 @@ def _create_models_settings():
3034
for model in models_to_test:
3135
local_path = _model_local_path(model)
3236
models.append(
33-
ModelSettings(model=local_path, model_alias=model["alias"], n_gpu_layers=-1)
37+
ModelSettings(
38+
model=local_path,
39+
model_alias=model["alias"],
40+
n_gpu_layers=n_gpu_layers,
41+
)
3442
)
3543

3644
return models
@@ -41,7 +49,7 @@ def create_llama(request) -> Llama:
4149

4250
return Llama(
4351
model_path=local_path,
44-
n_gpu_layers=-1,
52+
n_gpu_layers=n_gpu_layers,
4553
)
4654

4755

0 commit comments

Comments
 (0)