Simplify tests with T.TempDir (#929)

This commit is contained in:
Oleksandr Redko
2025-01-31 20:55:41 +02:00
committed by GitHub
parent 2a0ff5ac63
commit 7a2915a37d
8 changed files with 24 additions and 70 deletions

View File

@@ -31,7 +31,7 @@ func setupAzureTestServer() (client *openai.Client, server *test.ServerTest, tea
// This function approximates based on the rule of thumb stated by OpenAI:
// https://beta.openai.com/tokenizer
//
// TODO: implement an actual tokenizer for GPT-3 and Codex (once available)
// TODO: implement an actual tokenizer for GPT-3 and Codex (once available).
func numTokens(s string) int {
return int(float32(len(s)) / 4)
}