Skip to content

fix(engine): prioritize SafeTensors engine for .safetensors files (Issue #112) - #122

Merged
Michael-A-Kuykendall merged 1 commit into
mainfrom
clean/issue-112-safetensors-priority
Oct 13, 2025
Merged

fix(engine): prioritize SafeTensors engine for .safetensors files (Issue #112)#122
Michael-A-Kuykendall merged 1 commit into
mainfrom
clean/issue-112-safetensors-priority

Conversation

@Michael-A-Kuykendall

Copy link
Copy Markdown
Owner

Summary

  • SafeTensors files (.safetensors) ALWAYS use SafeTensors engine regardless of source
  • Move file extension detection to highest priority over model ID detection
  • Prevents HuggingFace SafeTensors files from incorrectly using HuggingFace engine

Changes

  • Restructured select_backend() to prioritize file extensions first
  • SafeTensors files now route to SafeTensors engine before HuggingFace model ID check
  • Added comprehensive test coverage for SafeTensors priority scenarios
  • Added tests for file extension precedence over model patterns

Test Coverage

  • ✅ SafeTensors files from HuggingFace paths use SafeTensors engine
  • ✅ Complex paths with slashes still route to SafeTensors correctly
  • ✅ Windows paths with SafeTensors files work properly
  • ✅ File extensions take priority over model name patterns
  • ✅ Existing regression test test_issue_112_safetensors_engine_selection passes

Issue Resolution

Fixes Issue #112: SafeTensors files should use SafeTensors engine

Previously, a file like /path/to/org/model/pytorch_model.safetensors would be incorrectly routed to the HuggingFace engine due to the slash pattern matching. Now it correctly uses the SafeTensors engine.

🤖 Generated with Claude Code

…sue #112)

- SafeTensors files (.safetensors) ALWAYS use SafeTensors engine regardless of source
- Move file extension detection to highest priority over model ID detection
- Prevents HuggingFace SafeTensors files from incorrectly using HuggingFace engine
- Add comprehensive tests for SafeTensors priority and file extension precedence
- Fixes Issue #112: SafeTensors files should use SafeTensors engine

Resolves user report of SafeTensors files being incorrectly routed to HuggingFace engine.

Signed-off-by: Michael A. Kuykendall <michaelallenkuykendall@gmail.com>
@Michael-A-Kuykendall
Michael-A-Kuykendall merged commit 5c79b2d into main Oct 13, 2025
12 checks passed
@Michael-A-Kuykendall
Michael-A-Kuykendall deleted the clean/issue-112-safetensors-priority branch October 13, 2025 15:29
Michael-A-Kuykendall added a commit that referenced this pull request Dec 19, 2025
…sue #112) (#122)

- SafeTensors files (.safetensors) ALWAYS use SafeTensors engine regardless of source
- Move file extension detection to highest priority over model ID detection
- Prevents HuggingFace SafeTensors files from incorrectly using HuggingFace engine
- Add comprehensive tests for SafeTensors priority and file extension precedence
- Fixes Issue #112: SafeTensors files should use SafeTensors engine

Resolves user report of SafeTensors files being incorrectly routed to HuggingFace engine.

Signed-off-by: Michael A. Kuykendall <michaelallenkuykendall@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant