MCPcopy Create free account
hub / github.com/cosdata/cosdata / get_tokenizer

Function get_tokenizer

tests/modal_remote_vllm/remote_cache_dense.py:49–58  ·  view source on GitHub ↗

Get tokenizer instance, loading it lazily.

()

Source from the content-addressed store, hash-verified

47# Helpers
48# ------------------------------------------------------------------
49def get_tokenizer():
50 """Get tokenizer instance, loading it lazily."""
51 global TOKENIZER
52 if TOKENIZER is None:
53 from transformers import AutoTokenizer
54
55 TOKENIZER = AutoTokenizer.from_pretrained(
56 "Snowflake/snowflake-arctic-embed-m-v1.5"
57 )
58 return TOKENIZER
59
60
61def chunk_text_by_tokens(

Callers 6

chunk_text_by_tokensFunction · 0.85
safe_tokenizeFunction · 0.85
clip_to_max_tokensFunction · 0.85
embedMethod · 0.85
cache_datasetFunction · 0.85
mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected