From 5a86d6822849552afe4853601751a5b2f530d843 Mon Sep 17 00:00:00 2001 From: Admin Date: Fri, 17 Jul 2026 12:33:49 +0000 Subject: [PATCH] debug: print full CHARS mapping and all 51 indices --- internal/captcha/handler.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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 := ""