Download initialize/auth.go from ensionet/groq: direct link, hf CLI and curl.
- Browser
- Download file 729 Bytes
-
https://huggingface.co/spaces/ensionet/groq/resolve/main/initialize/auth.go
- Command line
-
hf download hf://spaces/ensionet/groq/initialize/auth.go
-
curl -L -o auth.go https://huggingface.co/spaces/ensionet/groq/resolve/main/initialize/auth.go
729 Bytes
| package initialize | |
| import ( | |
| "bufio" | |
| groq "github.com/learnLi/groq_client" | |
| "groqai2api/global" | |
| "groqai2api/pkg/accountpool" | |
| "os" | |
| ) | |
| func InitAuth() { | |
| var Secrets []*groq.Account | |
| // Read accounts.txt and create a list of accounts | |
| if _, err := os.Stat("session_tokens.txt"); err == nil { | |
| // Each line is a proxy, put in proxies array | |
| file, _ := os.Open("session_tokens.txt") | |
| defer file.Close() | |
| scanner := bufio.NewScanner(file) | |
| for scanner.Scan() { | |
| // Split by : | |
| token := scanner.Text() | |
| if len(token) == 0 { | |
| continue | |
| } | |
| // Append to accounts | |
| Secrets = append(Secrets, groq.NewAccount(token, "")) | |
| } | |
| } | |
| global.AccountPool = accountpool.NewAccounts(Secrets) | |
| } | |