debug: print full CHARS mapping and all 51 indices
Build and Deploy / build (push) Successful in 2m41s
Build and Deploy / deploy (push) Successful in 10s

This commit is contained in:
2026-07-17 12:33:49 +00:00
parent 65c77452c2
commit 5a86d68228
+9 -2
View File
@@ -423,6 +423,13 @@ func decodeMathFromOutput(output []float32) string {
CHARS := "0123456789+-*/÷×=?" 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 结果,用于调试 // 先收集所有时间步的 argmax 结果,用于调试
allChars := make([]int, T) allChars := make([]int, T)
for t := 0; t < T; t++ { for t := 0; t < T; t++ {
@@ -452,8 +459,8 @@ func decodeMathFromOutput(output []float32) string {
} }
fmt.Println(debugStr) fmt.Println(debugStr)
// 打印原始索引值 // 打印原始索引值(全部 51 个)
fmt.Printf("DEBUG raw indices: %v\n", allChars[:20]) fmt.Printf("DEBUG raw indices (all %d): %v\n", len(allChars), allChars)
// CTC 解码: 跳过 blank (index 0) 和连续重复 // CTC 解码: 跳过 blank (index 0) 和连续重复
result := "" result := ""