Add benchmark reports and test results with metrics and visualizations

This commit is contained in:
Mingor committed 2025-04-22 18:16:20 +08:00
1 parent a6f82d5a0b
commit 1838c1d559
23 files changed
+1242 -187

No files matched your search

+6
View File
@@ -325,3 +325,9 @@ func (g *Generator) SelectPromptType() string {
// 默认返回第一个类型
return g.config.Requests[0].Type
}
// CountTokens 返回字符串的 token 数
func (g *Generator) CountTokens(s string) int {
tokens := g.tokenizer.Encode(s, nil, nil)
return len(tokens)
}