File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -200,8 +200,9 @@ async fn init_gte(state: Rc<RefCell<OpState>>) -> Result<(), Error> {
200
200
. map ( |i| * i as i64 )
201
201
. collect :: < Vec < _ > > ( ) ;
202
202
203
+ // Convert our flattened arrays into 2-dimensional tensors of shape [N, L] -> Since we're not batching 'N' will be always = 1
203
204
let input_ids_array =
204
- TensorRef :: from_array_view ( ( [ input_ids. len ( ) , 1 ] , & * input_ids) ) ?;
205
+ TensorRef :: from_array_view ( ( [ 1 , input_ids. len ( ) ] , & * input_ids) ) ?;
205
206
let attention_mask_array = TensorRef :: from_array_view ( (
206
207
[ 1 , encoded_prompt. len ( ) ] ,
207
208
& * attention_mask,
@@ -237,7 +238,6 @@ async fn init_gte(state: Rc<RefCell<OpState>>) -> Result<(), Error> {
237
238
. insert_axis ( Axis ( 0 ) )
238
239
. insert_axis ( Axis ( 2 ) ) ;
239
240
240
- println ! ( "attention_mask: {attention_mask_array_clone:?}" ) ;
241
241
mean_pool ( embeddings, attention_mask_array_clone)
242
242
} else {
243
243
embeddings. into_owned ( ) . remove_axis ( Axis ( 0 ) )
You can’t perform that action at this time.
0 commit comments