Skip to content

Commit

Permalink
remove explicit setting of streamer in 'test_multinomial_sampling_aga…
Browse files Browse the repository at this point in the history
…inst_reference', rely on automatic addition
  • Loading branch information
pavel-esir committed Jan 16, 2025
1 parent 470d968 commit f8f2445
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions tests/python_tests/test_sampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,21 +331,14 @@ def test_multinomial_sampling_against_reference(tmp_path, test_struct: RandomSam
generation_config.rng_seed = 0
generation_configs = generation_config

# We can use streamer only if we have a single batch.
streamer = StreamerWithResults() if len(prompts) == 1 else None

model_id : str = "facebook/opt-125m"
model, hf_tokenizer = get_hugging_face_models(model_id)

models_path : Path = tmp_path / model_id
convert_models(model, hf_tokenizer, models_path)

# Run multinomial without comparison with HF reference.
ov_results = run_llm_pipeline(models_path, prompts, generation_configs, streamer=streamer.accumulate if streamer is not None else None)

# Compare with streamers text.
if streamer is not None:
compare_generation_results(prompts, ov_results, streamer.get_results(), generation_config)
_ = run_llm_pipeline(models_path, prompts, generation_configs)

# Reference comparison is not performed as sampling results are non-deterministic.
# Discrete_distribution impl depends on platform, model inference results may depend on CPU.

0 comments on commit f8f2445

Please sign in to comment.