Spaces:
Runtime error
Runtime error
Download setting/operation_setting/token_setting.go from Tomsass1/test-docker: direct link, hf CLI and curl.
- Browser
- Download file 679 Bytes
-
https://huggingface.co/spaces/Tomsass1/test-docker/resolve/main/setting/operation_setting/token_setting.go
- Command line
-
hf download hf://spaces/Tomsass1/test-docker/setting/operation_setting/token_setting.go
-
curl -L -o token_setting.go https://huggingface.co/spaces/Tomsass1/test-docker/resolve/main/setting/operation_setting/token_setting.go
679 Bytes
| package operation_setting | |
| import "github.com/QuantumNous/new-api/setting/config" | |
| // TokenSetting 令牌相关配置 | |
| type TokenSetting struct { | |
| MaxUserTokens int `json:"max_user_tokens"` // 每用户最大令牌数量 | |
| } | |
| // 默认配置 | |
| var tokenSetting = TokenSetting{ | |
| MaxUserTokens: 1000, // 默认每用户最多 1000 个令牌 | |
| } | |
| func init() { | |
| // 注册到全局配置管理器 | |
| config.GlobalConfig.Register("token_setting", &tokenSetting) | |
| } | |
| // GetTokenSetting 获取令牌配置 | |
| func GetTokenSetting() *TokenSetting { | |
| return &tokenSetting | |
| } | |
| // GetMaxUserTokens 获取每用户最大令牌数量 | |
| func GetMaxUserTokens() int { | |
| return GetTokenSetting().MaxUserTokens | |
| } | |