Download setting/operation_setting/operation_setting.go from AZILS/new-api: direct link, hf CLI and curl.
- Browser
- Download file 794 Bytes
-
https://huggingface.co/spaces/AZILS/new-api/resolve/main/setting/operation_setting/operation_setting.go
- Command line
-
hf download hf://spaces/AZILS/new-api/setting/operation_setting/operation_setting.go
-
curl -L -o operation_setting.go https://huggingface.co/spaces/AZILS/new-api/resolve/main/setting/operation_setting/operation_setting.go
794 Bytes
| package operation_setting | |
| import "strings" | |
| var DemoSiteEnabled = false | |
| var SelfUseModeEnabled = false | |
| var AutomaticDisableKeywords = []string{ | |
| "Your credit balance is too low", | |
| "This organization has been disabled.", | |
| "You exceeded your current quota", | |
| "Permission denied", | |
| "The security token included in the request is invalid", | |
| "Operation not allowed", | |
| "Your account is not authorized", | |
| } | |
| func AutomaticDisableKeywordsToString() string { | |
| return strings.Join(AutomaticDisableKeywords, "\n") | |
| } | |
| func AutomaticDisableKeywordsFromString(s string) { | |
| AutomaticDisableKeywords = []string{} | |
| ak := strings.Split(s, "\n") | |
| for _, k := range ak { | |
| k = strings.TrimSpace(k) | |
| k = strings.ToLower(k) | |
| if k != "" { | |
| AutomaticDisableKeywords = append(AutomaticDisableKeywords, k) | |
| } | |
| } | |
| } | |