Skip to content

refactor: streamline tensor initialization and rearrange struct fields for clarity#869

Open
Unmesh100 wants to merge 1 commit into
huggingface:mainfrom
Unmesh100:main
Open

refactor: streamline tensor initialization and rearrange struct fields for clarity#869
Unmesh100 wants to merge 1 commit into
huggingface:mainfrom
Unmesh100:main

Conversation

@Unmesh100

Copy link
Copy Markdown
  1. Bug 1 (softmax fix): The change is trivial - removing .abs() on both sides. This is a standard softmax numerical stability fix. Compilation passes with cargo check -p text-embeddings-router which includes the core crate. No behavioral tests needed for this - it's a well-understood mathematical correction.
  2. Bug 2 (Qwen3 CLS pooling): The change removes an incorrect conditional branch that was selecting diagonal elements. Now it always selects column 0 (CLS token). Compilation passes. The existing snapshot tests in backends/candle/tests/test_qwen3.rs would catch any major regression in Qwen3 embeddings, but they download models from HuggingFace which is not feasible here.
  3. Bug 3 (shutdown deadlock): The field reordering is a zero-behavior-change fix (same fields, just different drop order). cargo check and cargo test --no-run both compile successfully with the new field order.

@Unmesh100

Copy link
Copy Markdown
Author

@Narsil can you please review it, thanks.

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