File tree Expand file tree Collapse file tree 3 files changed +12
-1
lines changed
Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ def count_tokens() -> int:
2525 )
2626 print (response )
2727 # Example output:
28- # total_tokens=10
28+ # total_tokens=9
2929 # cached_content_token_count=None
3030 # [END googlegenaisdk_counttoken_with_txt]
3131 return response .total_tokens
Original file line number Diff line number Diff line change 11google-genai == 1.42.0
2+ sentencepiece == 0.2.1
Original file line number Diff line number Diff line change 1919import os
2020
2121import counttoken_compute_with_txt
22+ import counttoken_localtokenizer_compute_with_txt
23+ import counttoken_localtokenizer_with_txt
2224import counttoken_resp_with_txt
2325import counttoken_with_txt
2426import counttoken_with_txt_vid
@@ -43,3 +45,11 @@ def test_counttoken_with_txt() -> None:
4345
4446def test_counttoken_with_txt_vid () -> None :
4547 assert counttoken_with_txt_vid .count_tokens ()
48+
49+
50+ def test_counttoken_localtokenizer_with_txt () -> None :
51+ assert counttoken_localtokenizer_with_txt .counttoken_localtokenizer_with_txt ()
52+
53+
54+ def test_counttoken_localtokenizer_compute_with_txt () -> None :
55+ assert counttoken_localtokenizer_compute_with_txt .counttoken_localtokenizer_compute_with_txt ()
You can’t perform that action at this time.
0 commit comments