1
0
mirror of https://github.com/fumiama/deepinfra.git synced 2026-06-09 04:29:41 +08:00

init: add codes

This commit is contained in:
源文雨
2025-02-14 15:34:05 +09:00
parent 4d4f1f5cb7
commit 507e407127
6 changed files with 184 additions and 0 deletions

19
model/utils.go Normal file
View File

@@ -0,0 +1,19 @@
package model
import "strings"
const (
SeparatorThink = "</think>"
)
func CutLast(txt, sep string) string {
a := strings.LastIndex(txt, sep)
if a < 0 {
return ""
}
a += len(sep)
if a >= len(txt) {
return ""
}
return strings.TrimSpace(txt[a:])
}