Upload modeling_minicpm_reranker.py
Browse files
modeling_minicpm_reranker.py
CHANGED
|
@@ -1265,6 +1265,8 @@ class LayerWiseMiniCPMForCausalLM(MiniCPMPreTrainedModel):
|
|
| 1265 |
)
|
| 1266 |
|
| 1267 |
cutoff_layers = [i for i in cutoff_layers if i not in remove_layers]
|
|
|
|
|
|
|
| 1268 |
|
| 1269 |
# decoder outputs consists of (dec_features, layer_state, dec_hidden, dec_attn)
|
| 1270 |
outputs = self.model(
|
|
|
|
| 1265 |
)
|
| 1266 |
|
| 1267 |
cutoff_layers = [i for i in cutoff_layers if i not in remove_layers]
|
| 1268 |
+
if len(cutoff_layers) == 0:
|
| 1269 |
+
raise ValueError(f"Your cutoff layers must in [{self.config.start_layer}, {self.config.num_hidden_layers + 1}]")
|
| 1270 |
|
| 1271 |
# decoder outputs consists of (dec_features, layer_state, dec_hidden, dec_attn)
|
| 1272 |
outputs = self.model(
|