test_get_eos.py 948 B

1234567891011121314151617181920212223242526
  1. from aphrodite.transformers_utils.config import try_get_generation_config
  2. from aphrodite.transformers_utils.tokenizer import get_tokenizer
  3. def test_get_llama3_eos_token():
  4. model_name = "meta-llama/Meta-Llama-3-8B-Instruct"
  5. tokenizer = get_tokenizer(model_name)
  6. assert tokenizer.eos_token_id == 128009
  7. generation_config = try_get_generation_config(model_name,
  8. trust_remote_code=False)
  9. assert generation_config is not None
  10. assert generation_config.eos_token_id == [128001, 128009]
  11. def test_get_blip2_eos_token():
  12. model_name = "Salesforce/blip2-opt-2.7b"
  13. tokenizer = get_tokenizer(model_name)
  14. assert tokenizer.eos_token_id == 2
  15. generation_config = try_get_generation_config(model_name,
  16. trust_remote_code=False)
  17. assert generation_config is not None
  18. assert generation_config.eos_token_id == 50118