File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
sentence_transformers/losses Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -175,7 +175,7 @@ def embed_minibatch(
175
175
with_grad : bool ,
176
176
copy_random_state : bool ,
177
177
random_state : RandContext | None = None ,
178
- ) -> tuple [Tensor , RandContext | None ]:
178
+ ) -> tuple [Tensor , Tensor , RandContext | None ]:
179
179
"""Do forward pass on a minibatch of the input features and return corresponding embeddings."""
180
180
grad_context = nullcontext if with_grad else torch .no_grad
181
181
random_state_context = nullcontext () if random_state is None else random_state
@@ -203,7 +203,7 @@ def embed_minibatch_iter(
203
203
with_grad : bool ,
204
204
copy_random_state : bool ,
205
205
random_states : list [RandContext ] | None = None ,
206
- ) -> Iterator [tuple [Tensor , RandContext | None ]]:
206
+ ) -> Iterator [tuple [Tensor , Tensor , RandContext | None ]]:
207
207
"""Do forward pass on all the minibatches of the input features and yield corresponding embeddings."""
208
208
input_ids : Tensor = sentence_feature ["input_ids" ]
209
209
bsz , _ = input_ids .shape
You can’t perform that action at this time.
0 commit comments