Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
robertgshaw2-neuralmagic committed Jan 12, 2025
1 parent 5f37918 commit 1d9b233
Showing 1 changed file with 23 additions and 8 deletions.
31 changes: 23 additions & 8 deletions tests/v1/engine/test_output_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def test_incremental_detokenization(request_output_kind: RequestOutputKind):

@pytest.mark.parametrize("include_stop_str_in_output", [True, False])
def test_stop_string(include_stop_str_in_output: bool):
output_processor = OutputProcessor(TOKENIZER_GROUP, log_stats=False)
output_processor = OutputProcessor(TOKENIZER_GROUP, log_stats=True)
engine_core = MockEngineCore(GENERATION_TOKENS)

# Make N requests.
Expand All @@ -157,13 +157,7 @@ def test_stop_string(include_stop_str_in_output: bool):
mm_placeholders=None,
eos_token_id=None,
lora_request=None,
sampling_params=SamplingParams(
skip_special_tokens=False,
spaces_between_special_tokens=False,
output_kind=RequestOutputKind.DELTA,
stop=STOP_STRINGS,
include_stop_str_in_output=include_stop_str_in_output,
)) for idx, (
sampling_params=SamplingParams()) for idx, (
prompt,
prompt_tokens) in enumerate(zip(PROMPT_STRINGS, PROMPT_TOKENS))
]
Expand Down Expand Up @@ -226,3 +220,24 @@ def test_stop_string(include_stop_str_in_output: bool):

assert output_processor.get_num_unfinished_requests() == 0
assert not output_processor.has_unfinished_requests()


def test_iteration_stats():
output_processor = OutputProcessor(TOKENIZER_GROUP, log_stats=False)

Check failure on line 226 in tests/v1/engine/test_output_processor.py

View workflow job for this annotation

GitHub Actions / ruff (3.12)

Ruff (F841)

tests/v1/engine/test_output_processor.py:226:5: F841 Local variable `output_processor` is assigned to but never used
engine_core = MockEngineCore(GENERATION_TOKENS)

Check failure on line 227 in tests/v1/engine/test_output_processor.py

View workflow job for this annotation

GitHub Actions / ruff (3.12)

Ruff (F841)

tests/v1/engine/test_output_processor.py:227:5: F841 Local variable `engine_core` is assigned to but never used

# Make N requests.
requests = [

Check failure on line 230 in tests/v1/engine/test_output_processor.py

View workflow job for this annotation

GitHub Actions / ruff (3.12)

Ruff (F841)

tests/v1/engine/test_output_processor.py:230:5: F841 Local variable `requests` is assigned to but never used
EngineCoreRequest(
request_id=f"request-{idx}",
prompt=prompt,
prompt_token_ids=prompt_tokens,
arrival_time=0,
mm_inputs=None,
mm_hashes=None,
mm_placeholders=None,
eos_token_id=None,
lora_request=None,
sampling_params=SamplingParams()
) for idx, (prompt, prompt_tokens) in enumerate(zip(PROMPT_STRINGS, PROMPT_TOKENS))

Check failure on line 242 in tests/v1/engine/test_output_processor.py

View workflow job for this annotation

GitHub Actions / ruff (3.12)

Ruff (E501)

tests/v1/engine/test_output_processor.py:242:81: E501 Line too long (91 > 80)
]

0 comments on commit 1d9b233

Please sign in to comment.