File tree Expand file tree Collapse file tree 3 files changed +10
-6
lines changed Expand file tree Collapse file tree 3 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -92,15 +92,16 @@ Result<uint64_t> MultimodalPrefiller::prefill(
9292
9393 // 2. Run decoder model for prefill.
9494
95-
96- // Get expected shape of cache position tensor, which should be the second argument
95+ // Get expected shape of cache position tensor, which should be the second
96+ // argument
9797
9898 int64_t seq_len = encoder_output.toTensor ().size (1 );
9999 if (seq_len == 0 ) {
100100 ET_LOG (Error, " The encoder returned an empty output." );
101101 return ::executorch::runtime::Error::InvalidState;
102102 }
103- auto cache_position_tensor = ET_UNWRAP (populate_start_pos_tensor (module_, start_pos, seq_len));
103+ auto cache_position_tensor =
104+ ET_UNWRAP (populate_start_pos_tensor (module_, start_pos, seq_len));
104105
105106 auto prefill_result = module_->execute (
106107 kTextModelMethod , {encoder_output, cache_position_tensor});
Original file line number Diff line number Diff line change @@ -53,7 +53,8 @@ ::executorch::runtime::Result<executorch::aten::Tensor> TextDecoderRunner::step(
5353 auto numel = sizes[0 ];
5454 std::vector<::executorch::aten::SizesType> sizes_vec = {numel};
5555
56- auto start_pos_tensor = ET_UNWRAP (populate_start_pos_tensor (module_, start_pos, tokens->numel ()));
56+ auto start_pos_tensor = ET_UNWRAP (
57+ populate_start_pos_tensor (module_, start_pos, tokens->numel ()));
5758
5859 std::vector<runtime::EValue> inputs;
5960 auto inputs_res = io_manager_->prepare_decode (tokens, start_pos_tensor);
Original file line number Diff line number Diff line change @@ -103,8 +103,10 @@ ET_EXPERIMENTAL size_t inline get_rss_bytes() {
103103 return 0 ;
104104}
105105
106- inline runtime::Result<TensorPtr> populate_start_pos_tensor (Module* module , int64_t & start_pos, int seq_len) {
107- // Get expected shape of cache position tensor, which should be the second argument
106+ inline runtime::Result<TensorPtr>
107+ populate_start_pos_tensor (Module* module , int64_t & start_pos, int seq_len) {
108+ // Get expected shape of cache position tensor, which should be the second
109+ // argument
108110 auto method_meta = ET_UNWRAP (module ->method_meta (kTextModelMethod ));
109111 auto second_input_info = ET_UNWRAP (method_meta.input_tensor_meta (1 ));
110112 auto second_input_sizes = second_input_info.sizes ();
You can’t perform that action at this time.
0 commit comments