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
C++ algoliadatastoreelasticsearchenterprise-searchfacetingfull-text-searchfuzzy-searchgeosearchin-memoryinstantsearchmerchandisingpineconesearchsearch-enginesemantic-searchsimilarity-searchsite-searchsynonymstypo-tolerancevector-search
Force whisper to not transcribe punctuations (#1771)
Ozan Armağan002b188b5681
diff --git a/bazel/whisper.patch b/bazel/whisper.patchindex 78e6d669..93ed9add 100644--- a/bazel/whisper.patch+++ b/bazel/whisper.patch@@ -220,7 +220,7 @@ index 64f4e45..85fb039 100644GGML_API bool ggml_is_numa(void); // true if init detected that system has >1 NUMA nodediff --git a/whisper.cpp b/whisper.cpp-index f6ba822..5279268 100644+index f6ba822..485c013 100644--- a/whisper.cpp+++ b/whisper.cpp@@ -10,6 +10,7 @@@@ -245,3 +245,12 @@ index f6ba822..5279268 100644backend_gpu = ggml_backend_cuda_init(0);if (!backend_gpu) {WHISPER_LOG_ERROR("%s: ggml_backend_cuda_init() failed\n", __func__);+@@ -4483,7 +4488,7 @@ static const std::vector<std::string> non_speech_tokens = {+ "\"", "#", "(", ")", "*", "+", "/", ":", ";", "<", "=", ">", "@", "[", "\\", "]", "^",+ "_", "`", "{", "|", "}", "~", "「", "」", "『", "』", "<<", ">>", "<<<", ">>>", "--",+ "---", "-(", "-[", "('", "(\"", "((", "))", "(((", ")))", "[[", "]]", "{{", "}}", "♪♪",+- "♪♪♪","♩", "♪", "♫", "♬", "♭", "♮", "♯"++ "♪♪♪","♩", "♪", "♫", "♬", "♭", "♮", "♯", "!", ".", ",", "?", "!", "¡", "¿", "‼", "⁉",+ };++ // process the logits for the selected decoderdiff --git a/src/aq_model.cpp b/src/aq_model.cppindex 58798d58..0eb5c7b9 100644--- a/src/aq_model.cpp+++ b/src/aq_model.cpp@@ -88,6 +88,7 @@ Option<std::string> WhisperModel::transcribe(const std::string& audio_base64) {ss << whisper_full_get_segment_text(ctx, i);}- return Option<std::string>(ss.str());+ std::string result = ss.str();+ return Option<std::string>(StringUtils::trim(result));}diff --git a/test/collection_vector_search_test.cpp b/test/collection_vector_search_test.cppindex 45a893be..cea2f0cb 100644--- a/test/collection_vector_search_test.cpp+++ b/test/collection_vector_search_test.cpp@@ -4058,7 +4058,7 @@ TEST_F(CollectionVectorTest, TestVoiceQuery) {ASSERT_TRUE(results.ok());auto results_json = results.get();- ASSERT_EQ(" Smartphone.", results_json["request_params"]["voice_query"]["transcribed_query"].get<std::string>());+ ASSERT_EQ("Smartphone", results_json["request_params"]["voice_query"]["transcribed_query"].get<std::string>());ASSERT_EQ(1, results_json["hits"].size());ASSERT_EQ("1", results_json["hits"][0]["document"]["id"].get<std::string>());}