Skip to content

Commit

Permalink
fix(catalog): fix topk to topK (#65)
Browse files Browse the repository at this point in the history
Because

topk is not precise

This commit

changes topk to topK
  • Loading branch information
Yougigun authored Aug 6, 2024
1 parent f2bdaec commit 5ff89fe
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ require (
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0
github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1
github.com/influxdata/influxdb-client-go/v2 v2.12.3
github.com/instill-ai/protogen-go v0.3.3-alpha.0.20240731142712-0dc717e8cea4
github.com/instill-ai/protogen-go v0.3.3-alpha.0.20240806091946-767ed03bebb4
github.com/instill-ai/usage-client v0.3.0-alpha.0.20240319060111-4a3a39f2fd61
github.com/instill-ai/x v0.3.0-alpha.0.20231219052200-6230a89e386c
github.com/knadh/koanf v1.5.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,8 @@ github.com/influxdata/influxdb-client-go/v2 v2.12.3 h1:28nRlNMRIV4QbtIUvxhWqaxn0
github.com/influxdata/influxdb-client-go/v2 v2.12.3/go.mod h1:IrrLUbCjjfkmRuaCiGQg4m2GbkaeJDcuWoxiWdQEbA0=
github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839 h1:W9WBk7wlPfJLvMCdtV4zPulc4uCPrlywQOmbFOhgQNU=
github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839/go.mod h1:xaLFMmpvUxqXtVkUJfg9QmT88cDaCJ3ZKgdZ78oO8Qo=
github.com/instill-ai/protogen-go v0.3.3-alpha.0.20240731142712-0dc717e8cea4 h1:YPaJSRkzdjmlNmIN0FbR9FaX3mnZkhpYNrprF3CZa8A=
github.com/instill-ai/protogen-go v0.3.3-alpha.0.20240731142712-0dc717e8cea4/go.mod h1:2blmpUwiTwxIDnrjIqT6FhR5ewshZZF554wzjXFvKpQ=
github.com/instill-ai/protogen-go v0.3.3-alpha.0.20240806091946-767ed03bebb4 h1:KRMsBzft0HOB1BpcKnWV1Ht1hkwe03eydf5wgDGLfwc=
github.com/instill-ai/protogen-go v0.3.3-alpha.0.20240806091946-767ed03bebb4/go.mod h1:2blmpUwiTwxIDnrjIqT6FhR5ewshZZF554wzjXFvKpQ=
github.com/instill-ai/usage-client v0.3.0-alpha.0.20240319060111-4a3a39f2fd61 h1:smPTvmXDhn/QC7y/TPXyMTqbbRd0gvzmFgWBChwTfhE=
github.com/instill-ai/usage-client v0.3.0-alpha.0.20240319060111-4a3a39f2fd61/go.mod h1:/TAHs4ybuylk5icuy+MQtHRc4XUnIyXzeNKxX9qDFhw=
github.com/instill-ai/x v0.3.0-alpha.0.20231219052200-6230a89e386c h1:a2RVkpIV2QcrGnSHAou+t/L+vBsaIfFvk5inVg5Uh4s=
Expand Down
2 changes: 1 addition & 1 deletion pkg/service/retrieval.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func (s *Service) SimilarityChunksSearch(ctx context.Context, caller uuid.UUID,
t = time.Now()

// search similar embeddings in kb
simEmbeddings, err := s.MilvusClient.SearchSimilarEmbeddingsInKB(ctx, kb.UID.String(), textVector, int(req.Topk))
simEmbeddings, err := s.MilvusClient.SearchSimilarEmbeddingsInKB(ctx, kb.UID.String(), textVector, int(req.TopK))
if err != nil {
log.Error("failed to search similar embeddings in kb", zap.Error(err))
return nil, fmt.Errorf("failed to search similar embeddings in kb. err: %w", err)
Expand Down

0 comments on commit 5ff89fe

Please sign in to comment.