faiss 0.2.5 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/LICENSE.txt +1 -1
- data/ext/faiss/index.cpp +13 -0
- data/lib/faiss/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a12656e91180940d60fdd412b6f179cd0faa8a6b473aaadfa0bc4a371131464
|
4
|
+
data.tar.gz: 1076b01164ff1702abc8a9184410e0f8417199056698628ff2b0e5bf641cf168
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1298e0ed4b4455c478ee94384dbd02b4a029ea96409d66cf0b0e4292e51acde782d6bd875470c093a07198b99e222a366878d7019b6dc499221ee8b126a95cd7
|
7
|
+
data.tar.gz: 4b61b0fa059d240b568e176abdffff5b56a06e16598c185795e4d437bb0581a1cafb36794dd799168512b010ba71858837a30f3197be9b781510e50d3d4a268b
|
data/CHANGELOG.md
CHANGED
data/LICENSE.txt
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
MIT License
|
2
2
|
|
3
3
|
Copyright (c) Facebook, Inc. and its affiliates.
|
4
|
-
Copyright (c) 2020-
|
4
|
+
Copyright (c) 2020-2023 Andrew Kane
|
5
5
|
|
6
6
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
7
|
of this software and associated documentation files (the "Software"), to deal
|
data/ext/faiss/index.cpp
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
#include <faiss/Index.h>
|
2
2
|
#include <faiss/IndexFlat.h>
|
3
3
|
#include <faiss/IndexHNSW.h>
|
4
|
+
#include <faiss/IndexIDMap.h>
|
4
5
|
#include <faiss/IndexIVFFlat.h>
|
5
6
|
#include <faiss/IndexLSH.h>
|
6
7
|
#include <faiss/IndexScalarQuantizer.h>
|
@@ -118,6 +119,15 @@ void init_index(Rice::Module& m) {
|
|
118
119
|
auto n = check_shape(objects, self.d);
|
119
120
|
self.add(n, objects.read_ptr());
|
120
121
|
})
|
122
|
+
.define_method(
|
123
|
+
"add_with_ids",
|
124
|
+
[](faiss::Index &self, numo::SFloat objects, numo::Int64 ids) {
|
125
|
+
auto n = check_shape(objects, self.d);
|
126
|
+
if (ids.ndim() != 1 || ids.shape()[0] != n) {
|
127
|
+
throw Rice::Exception(rb_eArgError, "expected ids to be 1d array with size %d", n);
|
128
|
+
}
|
129
|
+
self.add_with_ids(n, objects.read_ptr(), ids.read_ptr());
|
130
|
+
})
|
121
131
|
.define_method(
|
122
132
|
"search",
|
123
133
|
[](faiss::Index &self, numo::SFloat objects, size_t k) {
|
@@ -186,4 +196,7 @@ void init_index(Rice::Module& m) {
|
|
186
196
|
[](faiss::ParameterSpace& self, faiss::Index* index, const std::string& name, double val) {
|
187
197
|
self.set_index_parameter(index, name, val);
|
188
198
|
});
|
199
|
+
|
200
|
+
Rice::define_class_under<faiss::IndexIDMap, faiss::Index>(m, "IndexIDMap")
|
201
|
+
.define_constructor(Rice::Constructor<faiss::IndexIDMap, faiss::Index*>());
|
189
202
|
}
|
data/lib/faiss/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: faiss
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kane
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-04-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rice
|
@@ -319,7 +319,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
319
319
|
- !ruby/object:Gem::Version
|
320
320
|
version: '0'
|
321
321
|
requirements: []
|
322
|
-
rubygems_version: 3.4.
|
322
|
+
rubygems_version: 3.4.10
|
323
323
|
signing_key:
|
324
324
|
specification_version: 4
|
325
325
|
summary: Efficient similarity search and clustering for Ruby
|