Skip to content

Commit c21ca98

Browse files
phymbertnopperl
authored andcommitted
ci: server: tests python env on github container ubuntu latest / fix n_predict (ggml-org#6935)
* ci: server: fix python env * ci: server: fix server tests after ggml-org#6638 * ci: server: fix windows is not building PR branch
1 parent 4f20618 commit c21ca98

File tree

2 files changed

+15
-18
lines changed

2 files changed

+15
-18
lines changed

.github/workflows/server.yml

+14-17
Original file line numberDiff line numberDiff line change
@@ -41,24 +41,16 @@ jobs:
4141
sanitizer: ""
4242
fail-fast: false # While -DLLAMA_SANITIZE_THREAD=ON is broken
4343

44-
container:
45-
image: ubuntu:latest
46-
ports:
47-
- 8888
48-
options: --cpus 4
49-
5044
steps:
5145
- name: Dependencies
5246
id: depends
5347
run: |
54-
apt-get update
55-
apt-get -y install \
48+
sudo apt-get update
49+
sudo apt-get -y install \
5650
build-essential \
5751
xxd \
5852
git \
5953
cmake \
60-
python3-pip \
61-
python3-venv \
6254
curl \
6355
wget \
6456
language-pack-en \
@@ -71,6 +63,17 @@ jobs:
7163
fetch-depth: 0
7264
ref: ${{ github.event.inputs.sha || github.event.pull_request.head.sha || github.sha || github.head_ref || github.ref_name }}
7365

66+
- name: Python setup
67+
id: setup_python
68+
uses: actions/setup-python@v5
69+
with:
70+
python-version: '3.11'
71+
72+
- name: Tests dependencies
73+
id: test_dependencies
74+
run: |
75+
pip install -r examples/server/tests/requirements.txt
76+
7477
- name: Verify server deps
7578
id: verify_server_deps
7679
run: |
@@ -101,13 +104,6 @@ jobs:
101104
-DLLAMA_SANITIZE_${{ matrix.sanitizer }}=ON ;
102105
cmake --build . --config ${{ matrix.build_type }} -j $(nproc) --target server
103106
104-
- name: Setup python env
105-
id: pipenv
106-
run: |
107-
cd examples/server/tests
108-
python3 -m venv venv
109-
. venv/bin/activate
110-
pip install -r requirements.txt
111107
112108
- name: Tests
113109
id: server_integration_tests
@@ -133,6 +129,7 @@ jobs:
133129
uses: actions/checkout@v4
134130
with:
135131
fetch-depth: 0
132+
ref: ${{ github.event.inputs.sha || github.event.pull_request.head.sha || github.sha || github.head_ref || github.ref_name }}
136133

137134
- name: libCURL
138135
id: get_libcurl

examples/server/server.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1208,7 +1208,7 @@ struct server_context {
12081208
}
12091209

12101210
auto n_ctx_train = llama_n_ctx_train(model);
1211-
if (slot.params.n_predict < 1 && slot.ga_n == 1
1211+
if (slot.params.n_predict < 1 && slot.n_predict < 1 && slot.ga_n == 1
12121212
&& slot.n_prompt_tokens + slot.n_decoded >= n_ctx_train) {
12131213
LOG_WARNING("n_predict is not set and self-context extend is disabled."
12141214
" Limiting generated tokens to n_ctx_train to avoid EOS-less generation infinite loop", {

0 commit comments

Comments
 (0)