debug: print full CHARS mapping and all 51 indices
This commit is contained in:
@@ -423,6 +423,13 @@ func decodeMathFromOutput(output []float32) string {
|
||||
|
||||
CHARS := "0123456789+-*/÷×=?"
|
||||
|
||||
// DEBUG: 打印字符集每个字符的索引和 rune 值
|
||||
fmt.Printf("DEBUG CHARS: ")
|
||||
for i, c := range CHARS {
|
||||
fmt.Printf("[%d]=%c(rune:%d) ", i+1, c, c)
|
||||
}
|
||||
fmt.Println()
|
||||
|
||||
// 先收集所有时间步的 argmax 结果,用于调试
|
||||
allChars := make([]int, T)
|
||||
for t := 0; t < T; t++ {
|
||||
@@ -452,8 +459,8 @@ func decodeMathFromOutput(output []float32) string {
|
||||
}
|
||||
fmt.Println(debugStr)
|
||||
|
||||
// 打印原始索引值
|
||||
fmt.Printf("DEBUG raw indices: %v\n", allChars[:20])
|
||||
// 打印原始索引值(全部 51 个)
|
||||
fmt.Printf("DEBUG raw indices (all %d): %v\n", len(allChars), allChars)
|
||||
|
||||
// CTC 解码: 跳过 blank (index 0) 和连续重复
|
||||
result := ""
|
||||
|
||||
Reference in New Issue
Block a user