File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,13 @@ def __init__(self, path):
11
11
self .path = path
12
12
13
13
def read_queries (self ) -> Iterator [Query ]:
14
- pass
14
+ data = h5py .File (self .path )
15
+ for vector , expected_result in zip (data ['test' ], data ['neighbors' ]):
16
+ yield Query (
17
+ vector = vector .tolist (),
18
+ meta_conditions = None ,
19
+ expected_result = expected_result .tolist (),
20
+ )
15
21
16
22
def read_data (self ) -> Iterator [Record ]:
17
23
data = h5py .File (self .path )
@@ -37,4 +43,7 @@ def read_data(self) -> Iterator[Record]:
37
43
38
44
test_path = os .path .join (DATASET_DIR , 'glove-100-angular' , 'glove-100-angular.hdf5' )
39
45
record = next (H5Reader (test_path ).read_data ())
40
- print (record )
46
+ print (record , end = '\n \n ' )
47
+
48
+ query = next (H5Reader (test_path ).read_queries ())
49
+ print (query )
You can’t perform that action at this time.
0 commit comments