unsloth/tests
vivekkalyanarangan30 cea52f18ac Add transformers v5 compat, Qwen3/Gemma2 past_key_values support, and shared utilities
- Add _ensure_cache_is_dynamic to convert tuple/list KV caches to DynamicCache
  before transformers v5's _get_cache rejects them
- Wrap generate() via fix_prepare_inputs_for_generation for all model types
- Fix Qwen3 RoPE: index cos/sin by position_ids (both branches were identical)
- Fix Gemma2 softcapping attention: handle 4D masks and Q_len != K_len during
  prefill with past_key_values
- Add _slice_position_ids shared utility, replace inline duplication in
  PeftModel_fast_forward, MistralForCausalLM_fast_forward, and
  CausalLM_fast_forward (covers Llama/Qwen3/Gemma2)
- Remove redundant seq_len assignment in _fast_prepare_inputs_for_generation
- Add unit tests (test_past_kv_utils.py) and GPU integration tests
  (test_past_kv_models.py) for Llama, Qwen3, and Gemma2
2026-03-12 23:10:59 +00:00
..
qlora Revert "[pre-commit.ci] auto fixes from pre-commit.com hooks" 2025-12-01 07:24:58 -08:00
saving Revert "[pre-commit.ci] auto fixes from pre-commit.com hooks" 2025-12-01 07:24:58 -08:00
utils Patch trunc_normal_ for low-precision stability (#4027) 2026-02-19 04:40:14 -08:00
__init__.py Qwen 3, Bug Fixes (#2445) 2025-04-30 22:38:39 -07:00
test_get_model_name.py Fixup mapper issues and resolve properly (#4124) 2026-03-03 06:57:25 -08:00
test_model_registry.py Revert "[FIX] Vllm guided decoding params (#3662)" 2025-12-01 05:43:45 -08:00
test_past_kv_models.py Add transformers v5 compat, Qwen3/Gemma2 past_key_values support, and shared utilities 2026-03-12 23:10:59 +00:00
test_past_kv_utils.py Add transformers v5 compat, Qwen3/Gemma2 past_key_values support, and shared utilities 2026-03-12 23:10:59 +00:00
test_raw_text.py [pre-commit.ci] auto fixes from pre-commit.com hooks 2026-01-08 11:35:21 +00:00