diff --git a/internal/captcha/handler.go b/internal/captcha/handler.go index f68bbc5..0f064d5 100644 --- a/internal/captcha/handler.go +++ b/internal/captcha/handler.go @@ -422,6 +422,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) @@ -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 := ""