sugiv commited on
Commit
62a3b2e
·
verified ·
1 Parent(s): c4b729e

Add library requirements and UNEXPECTED/MISSING key explanations

Browse files
Files changed (1) hide show
  1. README.md +24 -1
README.md CHANGED
@@ -122,8 +122,31 @@ highlight_indices = [i for i, score in enumerate(scores) if score >= 0.9]
122
  ### Installation
123
 
124
  ```bash
125
- pip install torch transformers
126
  ```
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
127
 
128
  ### Quick Start
129
 
 
122
  ### Installation
123
 
124
  ```bash
125
+ pip install "transformers>=4.41" "huggingface_hub>=0.27" torch
126
  ```
127
+ > **Important:** Requires `huggingface_hub >= 0.27` to avoid deprecated API errors.
128
+
129
+ ### Requirements
130
+
131
+ | Library | Minimum Version | Notes |
132
+ |---------|----------------|-------|
133
+ | `transformers` | **>= 4.41** | XLMRobertaModel support |
134
+ | `huggingface_hub` | **>= 0.27** | No deprecated `use_auth_token` |
135
+ | `torch` | **>= 2.0** | CUDA support |
136
+
137
+ ```bash
138
+ pip install "transformers>=4.41" "huggingface_hub>=0.27" torch
139
+ ```
140
+
141
+ ### Loading Notes
142
+
143
+ **UNEXPECTED / MISSING keys on load:** When loading `AutoModel.from_pretrained("BAAI/bge-reranker-v2-m3")`, you will see warnings about:
144
+
145
+ - **UNEXPECTED** keys (`classifier.out_proj.weight`, `classifier.out_proj.bias`, `classifier.dense.weight`, `classifier.dense.bias`): These are the **reranker's classification head** weights. Since we load with `AutoModel` (encoder-only, no classification head), these extra keys are not consumed. This is **completely normal** — we only need the encoder backbone. Our separate `PruningHead` MLP replaces the original classification head.
146
+
147
+ - **MISSING** keys (`pooler.dense.weight`, `pooler.dense.bias`): The `AutoModel` class expects a pooler layer, but the BGE-reranker checkpoint was trained without one. These get **randomly initialized** but are **never used** in our pipeline — we use `last_hidden_state` directly, not the pooled output. Safe to ignore.
148
+
149
+
150
 
151
  ### Quick Start
152