Skip to content

Commit 8697cf7

Browse files
nv-alichengclaude
andcommitted
docs: clarify _check_tokenizer_exists is a probe, consumers are examples
Addresses PR #282 thread T33: reframe the docstring so MetricsAggregator and Harmony read as examples rather than a closed list of consumers, and state explicitly that this function never loads or downloads the tokenizer. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 731689c commit 8697cf7

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

  • src/inference_endpoint/commands/benchmark

src/inference_endpoint/commands/benchmark/execute.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,11 @@ def _check_tokenizer_exists(model_name: str) -> bool:
182182
"""Check if a HuggingFace tokenizer exists for the model (API only, no download).
183183
184184
Returns True if the model repo exists and has tokenizer files, False otherwise.
185-
The actual tokenizer is loaded later by the MetricsAggregator subprocess and
186-
by Harmony transforms (each loads their own instance as needed).
185+
This function is a probe — it never loads or downloads the tokenizer itself.
186+
Downstream consumers that need tokenization (e.g. the MetricsAggregator
187+
subprocess for ISL/OSL/TPOT, Harmony transforms for prompt preprocessing,
188+
and any future plugin with its own tokenization need) each load their own
189+
instance as required.
187190
"""
188191
try:
189192
info = model_info(model_name)
@@ -382,7 +385,11 @@ def _setup_kv_reader(
382385
reader = BasicKVStoreReader(metrics_dir)
383386
for counter_key in MetricCounterKey:
384387
reader.register_key(counter_key.value, "counter")
385-
_STREAMING_ONLY = {MetricSeriesKey.TTFT_NS, MetricSeriesKey.CHUNK_DELTA_NS, MetricSeriesKey.TPOT_NS}
388+
_STREAMING_ONLY = {
389+
MetricSeriesKey.TTFT_NS,
390+
MetricSeriesKey.CHUNK_DELTA_NS,
391+
MetricSeriesKey.TPOT_NS,
392+
}
386393
_FLOAT_SERIES = {MetricSeriesKey.TPOT_NS}
387394
for series_key in MetricSeriesKey:
388395
if series_key in _STREAMING_ONLY and not streaming:

0 commit comments

Comments
 (0)