File tree Expand file tree Collapse file tree 13 files changed +51
-13
lines changed Expand file tree Collapse file tree 13 files changed +51
-13
lines changed Original file line number Diff line number Diff line change 31
31
release :
32
32
name : Create Release with tag
33
33
runs-on : ${{ matrix.os }}
34
- needs : release
35
34
strategy :
36
35
matrix :
37
36
os : [ubuntu-20.04]
Original file line number Diff line number Diff line change 74
74
- name : Install Dependencies
75
75
run : |
76
76
pip install -r requirements.txt
77
- - name : Test mock JetStream token utils
77
+ - name : Run all unit tests in JetStream (jetstream/tests)
78
78
run : |
79
- python -m jetstream.engine.utils_test
80
- - name : Test mock JetStream engine implementation
79
+ coverage run -m unittest -v
80
+ - name : Create test coverage report
81
81
run : |
82
- python -m jetstream.engine.mock_engine_test
83
- - name : Test JetStream core orchestrator
84
- run : |
85
- python -m jetstream.core.orchestrator_test
86
- - name : Test JetStream core server library
87
- run : |
88
- python -m jetstream.core.server_test
82
+ coverage report -m
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ __pycache__
3
3
build /
4
4
dist /
5
5
google_jetstream.egg-info /
6
+ .coverage
6
7
7
8
# local folders
8
9
data /
Original file line number Diff line number Diff line change
1
+ # Copyright 2024 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
Original file line number Diff line number Diff line change
1
+ # Copyright 2024 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
1
+ # Copyright 2024 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
File renamed without changes.
Original file line number Diff line number Diff line change 12
12
# See the License for the specific language governing permissions and
13
13
# limitations under the License.
14
14
15
+ """Tests functionality of the tokenizer with supported models."""
16
+
15
17
import os
16
18
import unittest
17
19
from typing import List
@@ -24,7 +26,8 @@ class SPTokenizer:
24
26
"""Tokenier used in original llama2 git"""
25
27
26
28
def __init__ (self , tokenizer_path : str ):
27
- self .tokenizer = SentencePieceProcessor (model_file = tokenizer_path )
29
+ self .tokenizer = SentencePieceProcessor ()
30
+ self .tokenizer .Load (model_file = tokenizer_path )
28
31
assert self .tokenizer .vocab_size () == self .tokenizer .get_piece_size ()
29
32
30
33
def decode (self , t : List [int ]) -> str :
You can’t perform that action at this time.
0 commit comments