Skip to content

Commit

Permalink
chore: remove options type
Browse files Browse the repository at this point in the history
  • Loading branch information
mdelapenya committed Dec 13, 2024
1 parent 5c5058e commit 857a378
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
6 changes: 3 additions & 3 deletions modules/ollama/ollama.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,17 +103,17 @@ func Run(ctx context.Context, img string, opts ...testcontainers.ContainerCustom
// always request a GPU if the host supports it
opts = append(opts, withGpu())

options := defaultOptions()
useLocal := false
for _, opt := range opts {
if err := opt.Customize(&genericContainerReq); err != nil {
return nil, fmt.Errorf("customize: %w", err)
}
if _, ok := opt.(UseLocal); ok {
options.useLocal = true
useLocal = true
}
}

if options.useLocal {
if useLocal {
container, err := runLocal(ctx, req.Env)
if err == nil {
return container, nil
Expand Down
8 changes: 0 additions & 8 deletions modules/ollama/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@ import (
"github.com/testcontainers/testcontainers-go"
)

type options struct {
useLocal bool
}

func defaultOptions() options {
return options{}
}

var noopCustomizeRequestOption = func(req *testcontainers.GenericContainerRequest) error { return nil }

// withGpu requests a GPU for the container, which could improve performance for some models.
Expand Down

0 comments on commit 857a378

Please sign in to comment.