mirror of
https://github.com/ollama/ollama.git
synced 2025-05-11 02:16:36 +02:00
lint: enable usetesting, disable tenv (#10594)
This commit is contained in:
parent
b585a58121
commit
6e9a7a2568
12 changed files with 55 additions and 87 deletions
|
@ -78,7 +78,7 @@ func BenchmarkColdStart(b *testing.B) {
|
|||
|
||||
for _, tt := range tests {
|
||||
b.Run(fmt.Sprintf("%s/cold/%s", m, tt.name), func(b *testing.B) {
|
||||
ctx := context.Background()
|
||||
ctx := b.Context()
|
||||
|
||||
// Set number of tokens as our throughput metric
|
||||
b.SetBytes(int64(tt.maxTokens))
|
||||
|
@ -113,7 +113,7 @@ func BenchmarkWarmStart(b *testing.B) {
|
|||
|
||||
for _, tt := range tests {
|
||||
b.Run(fmt.Sprintf("%s/warm/%s", m, tt.name), func(b *testing.B) {
|
||||
ctx := context.Background()
|
||||
ctx := b.Context()
|
||||
|
||||
// Pre-warm the model
|
||||
warmup(client, m, tt.prompt, b)
|
||||
|
@ -140,7 +140,7 @@ func setup(b *testing.B) *api.Client {
|
|||
if err != nil {
|
||||
b.Fatal(err)
|
||||
}
|
||||
if _, err := client.Show(context.Background(), &api.ShowRequest{Model: modelName(b)}); err != nil {
|
||||
if _, err := client.Show(b.Context(), &api.ShowRequest{Model: modelName(b)}); err != nil {
|
||||
b.Fatalf("Model unavailable: %v", err)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue