(make_enc: Callable[[], tiktoken.Encoding])
| 238 | |
| 239 | @pytest.mark.parametrize("make_enc", ENCODING_FACTORIES) |
| 240 | def test_batch_encode(make_enc: Callable[[], tiktoken.Encoding]): |
| 241 | enc = make_enc() |
| 242 | text1 = "hello world" |
| 243 | text2 = "goodbye world" |
| 244 | |
| 245 | assert enc.encode_batch([text1]) == [enc.encode(text1)] |
| 246 | assert enc.encode_batch([text1, text2]) == [enc.encode(text1), enc.encode(text2)] |
| 247 | |
| 248 | assert enc.encode_ordinary_batch([text1]) == [enc.encode_ordinary(text1)] |
| 249 | assert enc.encode_ordinary_batch([text1, text2]) == [ |
| 250 | enc.encode_ordinary(text1), |
| 251 | enc.encode_ordinary(text2), |
| 252 | ] |
| 253 | |
| 254 | |
| 255 | @pytest.mark.parametrize("make_enc", ENCODING_FACTORIES) |
nothing calls this directly
no test coverage detected
searching dependent graphs…