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

Fix error message when Huggingface is down (#1586)

Ozan Armağaneb6ab0039794
diff --git a/src/embedder_manager.cpp b/src/embedder_manager.cpp
index 06e80aea..5d75862b 100644
--- a/src/embedder_manager.cpp
+++ b/src/embedder_manager.cpp
@@ -485,6 +485,10 @@ Option<nlohmann::json> EmbedderManager::get_public_model_config(const std::strin
return Option<nlohmann::json>(config);
}
+ if(res >= 500) {
+ return Option<nlohmann::json>(res, "Model repository is down. Status code: " + std::to_string(res));
+ }
+
return Option<nlohmann::json>(404, "Model not found");
}