-
Notifications
You must be signed in to change notification settings - Fork 223
/
vector.go
84 lines (75 loc) · 1.68 KB
/
vector.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
package vector
import (
"github.com/spf13/cobra"
"github.com/superfly/flyctl/internal/command"
"github.com/superfly/flyctl/internal/flag"
)
type SimilarityFunction struct {
Identifier string
Name string
UseCases string
}
var similarityFunctions = []SimilarityFunction{
{
Identifier: "EUCLIDEAN",
Name: "Euclidean Distance",
UseCases: "Natural Language Processing, Recommendation Systems",
},
{
Identifier: "COSINE",
Name: "Cosine Similarity",
UseCases: "Computer Vision, Anomaly Detection",
},
{
Identifier: "DOT_PRODUCT",
Name: "Dot Product",
UseCases: "Machine Learning Models, Collaborative Filtering",
},
}
type EmbeddingModel struct {
Identifier string
Name string
Dimensions int
}
var embeddingModels = []EmbeddingModel{
{
Identifier: "MXBAI_EMBED_LARGE_V1",
Name: "mixedbread-ai/mxbai-embed-large-v1",
Dimensions: 1024,
},
{
Identifier: "UAE_Large_V1",
Name: "WhereIsAI/UAE-Large-V1",
Dimensions: 1024,
},
{
Identifier: "BGE_LARGE_EN_V1_5",
Name: "BAAI/bge-large-en-v1.5",
Dimensions: 1024,
},
{
Identifier: "BGE_BASE_EN_V1_5",
Name: "BAAI/bge-base-en-v1.5",
Dimensions: 768,
},
{
Identifier: "BGE_SMALL_EN_V1_5",
Name: "BAAI/bge-small-en-v1.5",
Dimensions: 384,
},
{
Identifier: "ALL_MINILM_L6_V2",
Name: "sentence-transformers/all-MiniLM-L6-v2",
Dimensions: 384,
},
}
func New() (cmd *cobra.Command) {
const (
short = "Provision and manage Upstash Vector index"
long = short + "\n"
)
cmd = command.New("vector", short, long, nil)
cmd.AddCommand(create(), list(), dashboard(), destroy(), status())
return cmd
}
var SharedFlags = flag.Set{}