Skip to content

Commit

Permalink
Fix a bug for multilingual ASR
Browse files Browse the repository at this point in the history
  • Loading branch information
csukuangfj committed Aug 17, 2023
1 parent 54eca59 commit 148798b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
project(sherpa-onnx)

set(SHERPA_ONNX_VERSION "1.7.8")
set(SHERPA_ONNX_VERSION "1.7.9")

# Disable warning about
#
Expand Down
6 changes: 4 additions & 2 deletions sherpa-onnx/csrc/offline-whisper-greedy-search-decoder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,10 @@ OfflineWhisperGreedySearchDecoder::Decode(Ort::Value cross_k,
auto logits_shape = logits.GetTensorTypeAndShapeInfo().GetShape();
int32_t vocab_size = logits_shape[2];

int32_t max_token_id = static_cast<int32_t>(std::distance(
p_logits, std::max_element(p_logits, p_logits + vocab_size)));
const float *p_start = p_logits + (logits_shape[1] - 1) * vocab_size;

int32_t max_token_id = static_cast<int32_t>(
std::distance(p_start, std::max_element(p_start, p_start + vocab_size)));

int32_t n_text_ctx = model_->TextCtx();

Expand Down

0 comments on commit 148798b

Please sign in to comment.