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:
19
model/utils.go
Normal file
19
model/utils.go
Normal 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:])
|
||||
}
|
||||
Reference in New Issue
Block a user