Skip to content

Commit ffca231

Browse files
committed
Added python and some test embeddings data
1 parent dff2507 commit ffca231

File tree

6 files changed

+79
-0
lines changed

6 files changed

+79
-0
lines changed

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,8 @@
1919

2020
# Go workspace file
2121
go.work
22+
23+
24+
# Python
25+
venv
26+
*.pyc

embeddings.py

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# This is python file to generate some test embeddings to use
2+
3+
from sentence_transformers import SentenceTransformer
4+
5+
from numpy import ndarray
6+
import numpy as np
7+
from typing import Type
8+
9+
sentences = [
10+
"Chandrayaan-3 is the third Indian lunar exploration mission under the Indian Space Research Organisation's (ISRO) Chandrayaan programme.",
11+
"Chandrayaan-3 was launched on 14 July 2023.",
12+
"On 22 July 2019, ISRO launched Chandrayaan-2",
13+
"The Vikram lander is responsible for the soft landing on the Moon.",
14+
"The Pragyan rover is a six-wheeled vehicle with a mass of 26 kilograms (57 pounds).",
15+
"Confirming the existence of the project, ISRO's former chairman K. Sivan stated that the estimated cost would be around ₹615 crore (equivalent to ₹721 crore or US$90 million in 2023).",
16+
]
17+
18+
model = SentenceTransformer("sentence-transformers/all-MiniLM-L6-v2")
19+
embeddings: Type[ndarray] = model.encode(sentences, convert_to_numpy=True)
20+
21+
print("Generated Embeddings from sentence \n", embeddings)
22+
23+
np.asarray(embeddings)
24+
np.savetxt("test_data.csv", embeddings, delimiter=",")

go.mod

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module github.com/kubre/vdb
2+
3+
go 1.21

main.go

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package main
2+
3+
import "fmt"
4+
5+
func main() {
6+
fmt.Print("Hello")
7+
}

requirements.txt

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
certifi==2023.7.22
2+
charset-normalizer==3.2.0
3+
click==8.1.7
4+
colorama==0.4.6
5+
filelock==3.12.2
6+
fsspec==2023.6.0
7+
huggingface-hub==0.16.4
8+
idna==3.4
9+
Jinja2==3.1.2
10+
joblib==1.3.2
11+
MarkupSafe==2.1.3
12+
mpmath==1.3.0
13+
networkx==3.1
14+
nltk==3.8.1
15+
numpy==1.25.2
16+
packaging==23.1
17+
Pillow==10.0.0
18+
PyYAML==6.0.1
19+
regex==2023.8.8
20+
requests==2.31.0
21+
safetensors==0.3.3
22+
scikit-learn==1.3.0
23+
scipy==1.11.2
24+
sentence-transformers==2.2.2
25+
sentencepiece==0.1.99
26+
sympy==1.12
27+
threadpoolctl==3.2.0
28+
tokenizers==0.13.3
29+
torch==2.0.1
30+
torchvision==0.15.2
31+
tqdm==4.66.1
32+
transformers==4.32.0
33+
typing_extensions==4.7.1
34+
urllib3==2.0.4

0 commit comments

Comments
 (0)