1
0
mirror of https://github.com/fumiama/deepinfra.git synced 2026-06-05 00:32:46 +08:00
Files
deepinfra/model/utils.go
2025-06-01 20:27:06 +09:00

23 lines
330 B
Go

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