jupyterjazz
commited on
Commit
•
fd34c40
1
Parent(s):
3f72891
fix: var name
Browse filesSigned-off-by: jupyterjazz <saba.sturua@jina.ai>
- modeling_xlm_roberta.py +2 -2
modeling_xlm_roberta.py
CHANGED
@@ -583,11 +583,11 @@ class XLMRobertaModel(XLMRobertaPreTrainedModel):
|
|
583 |
logger.warning(
|
584 |
'Matryoshka embeddings are not supported, so dimension truncation will not be performed.'
|
585 |
)
|
586 |
-
elif truncate_dim in self.config.
|
587 |
all_embeddings = [tensor[:truncate_dim] for tensor in all_embeddings]
|
588 |
else:
|
589 |
raise ValueError(f'The provided `truncate_dim` value of {truncate_dim} is not supported. '
|
590 |
-
f'Supported dimensions are {self.config.
|
591 |
|
592 |
if convert_to_tensor:
|
593 |
all_embeddings = torch.stack(all_embeddings)
|
|
|
583 |
logger.warning(
|
584 |
'Matryoshka embeddings are not supported, so dimension truncation will not be performed.'
|
585 |
)
|
586 |
+
elif truncate_dim in self.config.matryoshka_dimensions:
|
587 |
all_embeddings = [tensor[:truncate_dim] for tensor in all_embeddings]
|
588 |
else:
|
589 |
raise ValueError(f'The provided `truncate_dim` value of {truncate_dim} is not supported. '
|
590 |
+
f'Supported dimensions are {self.config.matryoshka_dimensions}.')
|
591 |
|
592 |
if convert_to_tensor:
|
593 |
all_embeddings = torch.stack(all_embeddings)
|