Download model/model_extra.go from AZILS/new-api: direct link, hf CLI and curl.
- Browser
- Download file 632 Bytes
-
https://huggingface.co/spaces/AZILS/new-api/resolve/main/model/model_extra.go
- Command line
-
hf download hf://spaces/AZILS/new-api/model/model_extra.go
-
curl -L -o model_extra.go https://huggingface.co/spaces/AZILS/new-api/resolve/main/model/model_extra.go
632 Bytes
| package model | |
| func GetModelEnableGroups(modelName string) []string { | |
| // 确保缓存最新 | |
| GetPricing() | |
| if modelName == "" { | |
| return make([]string, 0) | |
| } | |
| modelEnableGroupsLock.RLock() | |
| groups, ok := modelEnableGroups[modelName] | |
| modelEnableGroupsLock.RUnlock() | |
| if !ok { | |
| return make([]string, 0) | |
| } | |
| return groups | |
| } | |
| // GetModelQuotaTypes 返回指定模型的计费类型集合(来自缓存) | |
| func GetModelQuotaTypes(modelName string) []int { | |
| GetPricing() | |
| modelEnableGroupsLock.RLock() | |
| quota, ok := modelQuotaTypeMap[modelName] | |
| modelEnableGroupsLock.RUnlock() | |
| if !ok { | |
| return []int{} | |
| } | |
| return []int{quota} | |
| } | |