Skip to content

Open Source alternative to Algolia + Pinecone and an Easier-to-Use alternative to ElasticSearch ⚡ 🔍 ✨ Fast, typo tolerant, in-memory fuzzy Search Engine for building delightful search experiences

Remove lock for text embedder

ozanarmagan16aa35374566
diff --git a/include/text_embedder.h b/include/text_embedder.h
index 38666a2e..50f635fb 100644
--- a/include/text_embedder.h
+++ b/include/text_embedder.h
@@ -34,5 +34,4 @@ class TextEmbedder {
std::string output_tensor_name;
static Option<bool> validate_remote_model(const nlohmann::json& model_config, unsigned int& num_dims);
static Option<bool> validate_local_or_public_model(const nlohmann::json& model_config, unsigned int& num_dims);
- std::mutex mutex_;
};
diff --git a/src/text_embedder.cpp b/src/text_embedder.cpp
index f33a55cf..e27fcb76 100644
--- a/src/text_embedder.cpp
+++ b/src/text_embedder.cpp
@@ -79,8 +79,6 @@ Option<std::vector<float>> TextEmbedder::Embed(const std::string& text) {
if(is_remote()) {
return remote_embedder_->Embed(text);
} else {
- // Cannot run same model in parallel, so lock the mutex
- std::unique_lock<std::mutex> lock(mutex_);
auto encoded_input = tokenizer_->Encode(text);
// create input tensor object from data values
Ort::AllocatorWithDefaultOptions allocator;