From 425219f1caf628559ec27fb1c647debe1d478c1f Mon Sep 17 00:00:00 2001 From: Blake Mizerany Date: Sat, 20 Apr 2024 20:04:00 -0700 Subject: [PATCH] use vanity imports --- api/client.go | 4 ++-- app/lifecycle/lifecycle.go | 4 ++-- app/lifecycle/server.go | 2 +- app/lifecycle/updater.go | 4 ++-- app/main.go | 2 +- app/tray/tray.go | 4 ++-- app/tray/tray_nonwindows.go | 2 +- app/tray/tray_windows.go | 4 ++-- app/tray/wintray/tray.go | 2 +- cmd/cmd.go | 12 ++++++------ cmd/interactive.go | 6 +++--- cmd/interactive_test.go | 2 +- cmd/start_darwin.go | 2 +- cmd/start_default.go | 2 +- cmd/start_windows.go | 2 +- convert/convert.go | 4 ++-- convert/gemma.go | 2 +- convert/llama.go | 2 +- convert/mistral.go | 2 +- convert/safetensors.go | 2 +- convert/torch.go | 2 +- examples/go-chat/main.go | 2 +- examples/go-generate-streaming/main.go | 2 +- examples/go-generate/main.go | 2 +- examples/go-multimodal/main.go | 2 +- examples/go-pull-progress/main.go | 2 +- go.mod | 2 +- gpu/gpu.go | 2 +- integration/basic_test.go | 2 +- integration/context_test.go | 2 +- integration/llm_image_test.go | 2 +- integration/llm_test.go | 2 +- integration/utils_test.go | 4 ++-- llm/payload.go | 2 +- llm/server.go | 6 +++--- main.go | 2 +- openai/openai.go | 2 +- progress/bar.go | 2 +- server/auth.go | 4 ++-- server/download.go | 4 ++-- server/images.go | 12 ++++++------ server/prompt.go | 2 +- server/prompt_test.go | 2 +- server/routes.go | 12 ++++++------ server/routes_test.go | 6 +++--- server/upload.go | 4 ++-- types/model/name.go | 2 +- 47 files changed, 78 insertions(+), 78 deletions(-) diff --git a/api/client.go b/api/client.go index a1ebdcd4..2b4a63fa 100644 --- a/api/client.go +++ b/api/client.go @@ -20,8 +20,8 @@ import ( "runtime" "strings" - "github.com/ollama/ollama/format" - "github.com/ollama/ollama/version" + "ollama.com/format" + "ollama.com/version" ) // Client encapsulates client state for interacting with the ollama diff --git a/app/lifecycle/lifecycle.go b/app/lifecycle/lifecycle.go index ab624e81..2c64ab98 100644 --- a/app/lifecycle/lifecycle.go +++ b/app/lifecycle/lifecycle.go @@ -9,8 +9,8 @@ import ( "os/signal" "syscall" - "github.com/ollama/ollama/app/store" - "github.com/ollama/ollama/app/tray" + "ollama.com/app/store" + "ollama.com/app/tray" ) func Run() { diff --git a/app/lifecycle/server.go b/app/lifecycle/server.go index 8680e7bc..eede8f2d 100644 --- a/app/lifecycle/server.go +++ b/app/lifecycle/server.go @@ -11,7 +11,7 @@ import ( "path/filepath" "time" - "github.com/ollama/ollama/api" + "ollama.com/api" ) func getCLIFullPath(command string) string { diff --git a/app/lifecycle/updater.go b/app/lifecycle/updater.go index 243bbf22..f90f7150 100644 --- a/app/lifecycle/updater.go +++ b/app/lifecycle/updater.go @@ -18,8 +18,8 @@ import ( "strings" "time" - "github.com/ollama/ollama/auth" - "github.com/ollama/ollama/version" + "ollama.com/auth" + "ollama.com/version" ) var ( diff --git a/app/main.go b/app/main.go index db829795..2356468e 100644 --- a/app/main.go +++ b/app/main.go @@ -4,7 +4,7 @@ package main // go build -ldflags="-H windowsgui" . import ( - "github.com/ollama/ollama/app/lifecycle" + "ollama.com/app/lifecycle" ) func main() { diff --git a/app/tray/tray.go b/app/tray/tray.go index dfa63435..cfaf5255 100644 --- a/app/tray/tray.go +++ b/app/tray/tray.go @@ -4,8 +4,8 @@ import ( "fmt" "runtime" - "github.com/ollama/ollama/app/assets" - "github.com/ollama/ollama/app/tray/commontray" + "ollama.com/app/assets" + "ollama.com/app/tray/commontray" ) func NewTray() (commontray.OllamaTray, error) { diff --git a/app/tray/tray_nonwindows.go b/app/tray/tray_nonwindows.go index ae5572b2..46109871 100644 --- a/app/tray/tray_nonwindows.go +++ b/app/tray/tray_nonwindows.go @@ -5,7 +5,7 @@ package tray import ( "fmt" - "github.com/ollama/ollama/app/tray/commontray" + "ollama.com/app/tray/commontray" ) func InitPlatformTray(icon, updateIcon []byte) (commontray.OllamaTray, error) { diff --git a/app/tray/tray_windows.go b/app/tray/tray_windows.go index 086fc794..1908383a 100644 --- a/app/tray/tray_windows.go +++ b/app/tray/tray_windows.go @@ -1,8 +1,8 @@ package tray import ( - "github.com/ollama/ollama/app/tray/commontray" - "github.com/ollama/ollama/app/tray/wintray" + "ollama.com/app/tray/commontray" + "ollama.com/app/tray/wintray" ) func InitPlatformTray(icon, updateIcon []byte) (commontray.OllamaTray, error) { diff --git a/app/tray/wintray/tray.go b/app/tray/wintray/tray.go index 69d4487d..77d33229 100644 --- a/app/tray/wintray/tray.go +++ b/app/tray/wintray/tray.go @@ -13,8 +13,8 @@ import ( "sync" "unsafe" - "github.com/ollama/ollama/app/tray/commontray" "golang.org/x/sys/windows" + "ollama.com/app/tray/commontray" ) // Helpful sources: https://github.com/golang/exp/blob/master/shiny/driver/internal/win32 diff --git a/cmd/cmd.go b/cmd/cmd.go index f77c08b8..336ac282 100644 --- a/cmd/cmd.go +++ b/cmd/cmd.go @@ -30,12 +30,12 @@ import ( "golang.org/x/exp/slices" "golang.org/x/term" - "github.com/ollama/ollama/api" - "github.com/ollama/ollama/format" - "github.com/ollama/ollama/parser" - "github.com/ollama/ollama/progress" - "github.com/ollama/ollama/server" - "github.com/ollama/ollama/version" + "ollama.com/api" + "ollama.com/format" + "ollama.com/parser" + "ollama.com/progress" + "ollama.com/server" + "ollama.com/version" ) func CreateHandler(cmd *cobra.Command, args []string) error { diff --git a/cmd/interactive.go b/cmd/interactive.go index 12c31052..e5fa9c3c 100644 --- a/cmd/interactive.go +++ b/cmd/interactive.go @@ -14,9 +14,9 @@ import ( "github.com/spf13/cobra" "golang.org/x/exp/slices" - "github.com/ollama/ollama/api" - "github.com/ollama/ollama/progress" - "github.com/ollama/ollama/readline" + "ollama.com/api" + "ollama.com/progress" + "ollama.com/readline" ) type MultilineState int diff --git a/cmd/interactive_test.go b/cmd/interactive_test.go index 8eedf729..908a9404 100644 --- a/cmd/interactive_test.go +++ b/cmd/interactive_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/ollama/ollama/api" + "ollama.com/api" ) func TestExtractFilenames(t *testing.T) { diff --git a/cmd/start_darwin.go b/cmd/start_darwin.go index 82b09ad6..71760e7f 100644 --- a/cmd/start_darwin.go +++ b/cmd/start_darwin.go @@ -7,7 +7,7 @@ import ( "os/exec" "strings" - "github.com/ollama/ollama/api" + "ollama.com/api" ) func startApp(ctx context.Context, client *api.Client) error { diff --git a/cmd/start_default.go b/cmd/start_default.go index c9d6137b..5a15d4aa 100644 --- a/cmd/start_default.go +++ b/cmd/start_default.go @@ -6,7 +6,7 @@ import ( "context" "fmt" - "github.com/ollama/ollama/api" + "ollama.com/api" ) func startApp(ctx context.Context, client *api.Client) error { diff --git a/cmd/start_windows.go b/cmd/start_windows.go index 6024a235..81b692e1 100644 --- a/cmd/start_windows.go +++ b/cmd/start_windows.go @@ -10,7 +10,7 @@ import ( "strings" "syscall" - "github.com/ollama/ollama/api" + "ollama.com/api" ) func startApp(ctx context.Context, client *api.Client) error { diff --git a/convert/convert.go b/convert/convert.go index bf6f0bf5..9d4110d9 100644 --- a/convert/convert.go +++ b/convert/convert.go @@ -13,8 +13,8 @@ import ( "google.golang.org/protobuf/proto" - "github.com/ollama/ollama/convert/sentencepiece" - "github.com/ollama/ollama/llm" + "ollama.com/convert/sentencepiece" + "ollama.com/llm" ) type Params struct { diff --git a/convert/gemma.go b/convert/gemma.go index 648a4ad9..e2ed4a43 100644 --- a/convert/gemma.go +++ b/convert/gemma.go @@ -12,7 +12,7 @@ import ( "github.com/pdevine/tensor" "github.com/pdevine/tensor/native" - "github.com/ollama/ollama/llm" + "ollama.com/llm" ) type GemmaModel struct { diff --git a/convert/llama.go b/convert/llama.go index c7f7b290..8b5b7827 100644 --- a/convert/llama.go +++ b/convert/llama.go @@ -14,7 +14,7 @@ import ( "github.com/pdevine/tensor/native" "github.com/x448/float16" - "github.com/ollama/ollama/llm" + "ollama.com/llm" ) type LlamaModel struct { diff --git a/convert/mistral.go b/convert/mistral.go index 70c92edd..b1f52112 100644 --- a/convert/mistral.go +++ b/convert/mistral.go @@ -13,7 +13,7 @@ import ( "github.com/pdevine/tensor/native" "github.com/x448/float16" - "github.com/ollama/ollama/llm" + "ollama.com/llm" ) type MistralModel struct { diff --git a/convert/safetensors.go b/convert/safetensors.go index 468bc707..14235a75 100644 --- a/convert/safetensors.go +++ b/convert/safetensors.go @@ -16,7 +16,7 @@ import ( "github.com/mitchellh/mapstructure" "github.com/x448/float16" - "github.com/ollama/ollama/llm" + "ollama.com/llm" ) type safetensorWriterTo struct { diff --git a/convert/torch.go b/convert/torch.go index fd237505..d8a33465 100644 --- a/convert/torch.go +++ b/convert/torch.go @@ -15,7 +15,7 @@ import ( "github.com/nlpodyssey/gopickle/types" "github.com/x448/float16" - "github.com/ollama/ollama/llm" + "ollama.com/llm" ) type torchWriterTo struct { diff --git a/examples/go-chat/main.go b/examples/go-chat/main.go index 83aaad3d..ed5fa9d6 100644 --- a/examples/go-chat/main.go +++ b/examples/go-chat/main.go @@ -5,7 +5,7 @@ import ( "fmt" "log" - "github.com/ollama/ollama/api" + "ollama.com/api" ) func main() { diff --git a/examples/go-generate-streaming/main.go b/examples/go-generate-streaming/main.go index 49403351..edaa96f8 100644 --- a/examples/go-generate-streaming/main.go +++ b/examples/go-generate-streaming/main.go @@ -5,7 +5,7 @@ import ( "fmt" "log" - "github.com/ollama/ollama/api" + "ollama.com/api" ) func main() { diff --git a/examples/go-generate/main.go b/examples/go-generate/main.go index 50fbf64b..f446cecd 100644 --- a/examples/go-generate/main.go +++ b/examples/go-generate/main.go @@ -5,7 +5,7 @@ import ( "fmt" "log" - "github.com/ollama/ollama/api" + "ollama.com/api" ) func main() { diff --git a/examples/go-multimodal/main.go b/examples/go-multimodal/main.go index 0b0f19ed..e7ac4f08 100644 --- a/examples/go-multimodal/main.go +++ b/examples/go-multimodal/main.go @@ -6,7 +6,7 @@ import ( "log" "os" - "github.com/ollama/ollama/api" + "ollama.com/api" ) func main() { diff --git a/examples/go-pull-progress/main.go b/examples/go-pull-progress/main.go index 74863368..89327ac4 100644 --- a/examples/go-pull-progress/main.go +++ b/examples/go-pull-progress/main.go @@ -5,7 +5,7 @@ import ( "fmt" "log" - "github.com/ollama/ollama/api" + "ollama.com/api" ) func main() { diff --git a/go.mod b/go.mod index 4325d58d..d439b4d8 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/ollama/ollama +module ollama.com go 1.22 diff --git a/gpu/gpu.go b/gpu/gpu.go index 47d70ed0..11a7208d 100644 --- a/gpu/gpu.go +++ b/gpu/gpu.go @@ -21,7 +21,7 @@ import ( "sync" "unsafe" - "github.com/ollama/ollama/format" + "ollama.com/format" ) type handles struct { diff --git a/integration/basic_test.go b/integration/basic_test.go index 40bde03c..4113c796 100644 --- a/integration/basic_test.go +++ b/integration/basic_test.go @@ -8,7 +8,7 @@ import ( "testing" "time" - "github.com/ollama/ollama/api" + "ollama.com/api" ) func TestOrcaMiniBlueSky(t *testing.T) { diff --git a/integration/context_test.go b/integration/context_test.go index 80ea540b..24d53908 100644 --- a/integration/context_test.go +++ b/integration/context_test.go @@ -8,7 +8,7 @@ import ( "testing" "time" - "github.com/ollama/ollama/api" + "ollama.com/api" ) func TestContextExhaustion(t *testing.T) { diff --git a/integration/llm_image_test.go b/integration/llm_image_test.go index 94082d6e..7c953489 100644 --- a/integration/llm_image_test.go +++ b/integration/llm_image_test.go @@ -9,8 +9,8 @@ import ( "testing" "time" - "github.com/ollama/ollama/api" "github.com/stretchr/testify/require" + "ollama.com/api" ) func TestIntegrationMultimodal(t *testing.T) { diff --git a/integration/llm_test.go b/integration/llm_test.go index bcc169d6..daa040eb 100644 --- a/integration/llm_test.go +++ b/integration/llm_test.go @@ -9,7 +9,7 @@ import ( "testing" "time" - "github.com/ollama/ollama/api" + "ollama.com/api" ) // TODO - this would ideally be in the llm package, but that would require some refactoring of interfaces in the server diff --git a/integration/utils_test.go b/integration/utils_test.go index 0f712271..ceeca7bb 100644 --- a/integration/utils_test.go +++ b/integration/utils_test.go @@ -21,9 +21,9 @@ import ( "testing" "time" - "github.com/ollama/ollama/api" - "github.com/ollama/ollama/app/lifecycle" "github.com/stretchr/testify/assert" + "ollama.com/api" + "ollama.com/app/lifecycle" ) func FindPort() string { diff --git a/llm/payload.go b/llm/payload.go index 8a134357..88e093f7 100644 --- a/llm/payload.go +++ b/llm/payload.go @@ -14,7 +14,7 @@ import ( "golang.org/x/exp/slices" "golang.org/x/sync/errgroup" - "github.com/ollama/ollama/gpu" + "ollama.com/gpu" ) var errPayloadMissing = fmt.Errorf("expected payloads not included in this build of ollama") diff --git a/llm/server.go b/llm/server.go index 3cab6f1d..0da3ac9e 100644 --- a/llm/server.go +++ b/llm/server.go @@ -21,9 +21,9 @@ import ( "strings" "time" - "github.com/ollama/ollama/api" - "github.com/ollama/ollama/format" - "github.com/ollama/ollama/gpu" + "ollama.com/api" + "ollama.com/format" + "ollama.com/gpu" ) // LlamaServer is an instance of the llama.cpp server diff --git a/main.go b/main.go index 158f0063..83308d28 100644 --- a/main.go +++ b/main.go @@ -3,8 +3,8 @@ package main import ( "context" - "github.com/ollama/ollama/cmd" "github.com/spf13/cobra" + "ollama.com/cmd" ) func main() { diff --git a/openai/openai.go b/openai/openai.go index 96d8f218..9b0b8f9f 100644 --- a/openai/openai.go +++ b/openai/openai.go @@ -11,7 +11,7 @@ import ( "time" "github.com/gin-gonic/gin" - "github.com/ollama/ollama/api" + "ollama.com/api" ) type Error struct { diff --git a/progress/bar.go b/progress/bar.go index 476ea888..65554702 100644 --- a/progress/bar.go +++ b/progress/bar.go @@ -6,8 +6,8 @@ import ( "strings" "time" - "github.com/ollama/ollama/format" "golang.org/x/term" + "ollama.com/format" ) type Bar struct { diff --git a/server/auth.go b/server/auth.go index e92a5b65..7b9bab26 100644 --- a/server/auth.go +++ b/server/auth.go @@ -15,8 +15,8 @@ import ( "strings" "time" - "github.com/ollama/ollama/api" - "github.com/ollama/ollama/auth" + "ollama.com/api" + "ollama.com/auth" ) type registryChallenge struct { diff --git a/server/download.go b/server/download.go index 935af9c1..e0cec17f 100644 --- a/server/download.go +++ b/server/download.go @@ -21,8 +21,8 @@ import ( "golang.org/x/sync/errgroup" - "github.com/ollama/ollama/api" - "github.com/ollama/ollama/format" + "ollama.com/api" + "ollama.com/format" ) const maxRetries = 6 diff --git a/server/images.go b/server/images.go index 74fa1a5e..9b520dc4 100644 --- a/server/images.go +++ b/server/images.go @@ -24,12 +24,12 @@ import ( "golang.org/x/exp/slices" - "github.com/ollama/ollama/api" - "github.com/ollama/ollama/convert" - "github.com/ollama/ollama/format" - "github.com/ollama/ollama/llm" - "github.com/ollama/ollama/parser" - "github.com/ollama/ollama/version" + "ollama.com/api" + "ollama.com/convert" + "ollama.com/format" + "ollama.com/llm" + "ollama.com/parser" + "ollama.com/version" ) type registryOptions struct { diff --git a/server/prompt.go b/server/prompt.go index 604e6971..12a46a00 100644 --- a/server/prompt.go +++ b/server/prompt.go @@ -7,7 +7,7 @@ import ( "text/template" "text/template/parse" - "github.com/ollama/ollama/api" + "ollama.com/api" ) // isResponseNode checks if the node contains .Response diff --git a/server/prompt_test.go b/server/prompt_test.go index a7e18a70..0688f5bb 100644 --- a/server/prompt_test.go +++ b/server/prompt_test.go @@ -4,7 +4,7 @@ import ( "strings" "testing" - "github.com/ollama/ollama/api" + "ollama.com/api" ) func TestPrompt(t *testing.T) { diff --git a/server/routes.go b/server/routes.go index b0d36b14..5e68caf3 100644 --- a/server/routes.go +++ b/server/routes.go @@ -27,12 +27,12 @@ import ( "github.com/gin-gonic/gin" "golang.org/x/exp/slices" - "github.com/ollama/ollama/api" - "github.com/ollama/ollama/gpu" - "github.com/ollama/ollama/llm" - "github.com/ollama/ollama/openai" - "github.com/ollama/ollama/parser" - "github.com/ollama/ollama/version" + "ollama.com/api" + "ollama.com/gpu" + "ollama.com/llm" + "ollama.com/openai" + "ollama.com/parser" + "ollama.com/version" ) var mode string = gin.DebugMode diff --git a/server/routes_test.go b/server/routes_test.go index 4f907702..e3c6381d 100644 --- a/server/routes_test.go +++ b/server/routes_test.go @@ -16,9 +16,9 @@ import ( "github.com/stretchr/testify/assert" - "github.com/ollama/ollama/api" - "github.com/ollama/ollama/parser" - "github.com/ollama/ollama/version" + "ollama.com/api" + "ollama.com/parser" + "ollama.com/version" ) func Test_Routes(t *testing.T) { diff --git a/server/upload.go b/server/upload.go index 9b52238a..e3671dc7 100644 --- a/server/upload.go +++ b/server/upload.go @@ -16,9 +16,9 @@ import ( "sync/atomic" "time" - "github.com/ollama/ollama/api" - "github.com/ollama/ollama/format" "golang.org/x/sync/errgroup" + "ollama.com/api" + "ollama.com/format" ) var blobUploadManager sync.Map diff --git a/types/model/name.go b/types/model/name.go index 9c56c49a..b94b2a73 100644 --- a/types/model/name.go +++ b/types/model/name.go @@ -12,7 +12,7 @@ import ( "strings" "sync" - "github.com/ollama/ollama/types/structs" + "ollama.com/types/structs" ) // Errors