Datasets:
senaK-quasara
commited on
Commit
•
a252a0a
1
Parent(s):
a1256d7
Upload read_dataset.py
Browse files- read_dataset.py +3 -3
read_dataset.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import pyarrow.parquet as pq
|
2 |
|
3 |
-
METADATA_FILEPATH = '
|
4 |
-
EMBEDDINGS_FILEPATH = '
|
5 |
|
6 |
|
7 |
def read_embeddings(filepath):
|
@@ -39,7 +39,7 @@ embedding_file_value = row['embedding_file'] # specific embedding file for the r
|
|
39 |
|
40 |
# Read the embeddings in the embedding file
|
41 |
embeddings = read_embeddings(EMBEDDINGS_FILEPATH)
|
42 |
-
vector = embeddings[dat_row_value]
|
43 |
|
44 |
print(f"Row: {row}, Dat Row: {dat_row_value}, Embedding File: {embedding_file_value}, Vector length: {len(vector)}")
|
45 |
#print(f"Vector: {vector}")
|
|
|
1 |
import pyarrow.parquet as pq
|
2 |
|
3 |
+
METADATA_FILEPATH = '/home/sena/plato_backend/scripts/huggingface_embedding_sharing/huggingface_embedding_sharing/save_backup/metadata_file.parquet'
|
4 |
+
EMBEDDINGS_FILEPATH = '/home/sena/plato_backend/scripts/huggingface_embedding_sharing/huggingface_embedding_sharing/embeddings_2.txt'
|
5 |
|
6 |
|
7 |
def read_embeddings(filepath):
|
|
|
39 |
|
40 |
# Read the embeddings in the embedding file
|
41 |
embeddings = read_embeddings(EMBEDDINGS_FILEPATH)
|
42 |
+
vector = embeddings[int(dat_row_value)]
|
43 |
|
44 |
print(f"Row: {row}, Dat Row: {dat_row_value}, Embedding File: {embedding_file_value}, Vector length: {len(vector)}")
|
45 |
#print(f"Vector: {vector}")
|