MCPcopy Create free account
hub / github.com/PaddlePaddle/FastDeploy / tokenizer

Function tokenizer

tests/model_executor/test_ernie_tokenizer.py:48–53  ·  view source on GitHub ↗

Create a tokenizer instance with mocked dependencies

(mock_sp_model, vocab_file)

Source from the content-addressed store, hash-verified

46
47@pytest.fixture
48def tokenizer(mock_sp_model, vocab_file):
49 """Create a tokenizer instance with mocked dependencies"""
50 with patch.object(SentencePieceProcessor, "Load", return_value=None):
51 with patch("sentencepiece.SentencePieceProcessor") as mock_spm:
52 mock_spm.return_value = mock_sp_model
53 return Ernie4_5Tokenizer(vocab_file=vocab_file)
54
55
56# ===== Initialization Tests (Parametrized) =====

Callers 1

run_hfFunction · 0.85

Calls 1

Ernie4_5TokenizerClass · 0.90

Tested by

no test coverage detected