Skip to content

Commit

Permalink
Tidying up the patch.
Browse files Browse the repository at this point in the history
  • Loading branch information
Craigacp committed Jan 25, 2024
1 parent 73b867b commit 5c29422
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion operators/tokenizer/sentencepiece_tokenizer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ OrtStatusPtr KernelSentencepieceTokenizer::Compute(const ortc::Tensor<std::strin
}
}
}
instance_indices.push_back(content.size());

// Patch fairseq indices
if (fairseq.has_value() && (*fairseq) && !add_rev) {
// HF Fairseq Example (XLMRobertaTokenizer) : https://huggingface.co/transformers/v4.6.0/_modules/transformers/models/xlm_roberta/tokenization_xlm_roberta.html#XLMRobertaTokenizer
//
Expand All @@ -106,7 +109,6 @@ OrtStatusPtr KernelSentencepieceTokenizer::Compute(const ortc::Tensor<std::strin
}
});
}
instance_indices.push_back(content.size());

// Setup output
std::vector<int64_t> size_content(1);
Expand Down

0 comments on commit 5c29422

Please sign in to comment.