[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/elisa 860936af49 5/7: Disable batch embeddings by defau
From: |
ELPA Syncer |
Subject: |
[elpa] externals/elisa 860936af49 5/7: Disable batch embeddings by default |
Date: |
Sat, 23 Nov 2024 12:57:57 -0500 (EST) |
branch: externals/elisa
commit 860936af490b1392c9477603005941f6ec0ba321
Author: Sergey Kostyaev <kostyaev.sergey2@wb.ru>
Commit: Sergey Kostyaev <kostyaev.sergey2@wb.ru>
Disable batch embeddings by default
---
README.org | 4 ++++
elisa.el | 8 +++++++-
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/README.org b/README.org
index b1176d571d..acf155f1e0 100644
--- a/README.org
+++ b/README.org
@@ -305,6 +305,10 @@ Example configuration.
* Type: String
* Description: Template used for rewriting prompts for better retrieval.
++ ~elisa-batch-embeddings-enabled~:
+ * Type: Boolean
+ * Description: Enable batch embeddings if supported.
+
**** Web Search and Integration
+ ~elisa-searxng-url~:
diff --git a/elisa.el b/elisa.el
index 91d829e397..70932a9c9a 100644
--- a/elisa.el
+++ b/elisa.el
@@ -275,6 +275,10 @@ If set, all quotes with similarity less than threshold
will be filtered out."
"Supported complex document file extensions."
:type '(repeat string))
+(defcustom elisa-batch-embeddings-enabled nil
+ "Enable batch embeddings if supported."
+ :type 'boolean)
+
(defun elisa-supported-complex-document-p (path)
"Check if PATH contain supported complex document."
(cl-find (file-name-extension path)
@@ -467,7 +471,8 @@ FOREIGN KEY(collection_id) REFERENCES collections(rowid)
"Calculate embeddings for CHUNKS.
Return list of vectors."
(let ((provider elisa-embeddings-provider))
- (if (member 'embeddings-batch (llm-capabilities provider))
+ (if (and elisa-batch-embeddings-enabled
+ (member 'embeddings-batch (llm-capabilities provider)))
(llm-batch-embeddings provider chunks)
(mapcar (lambda (chunk) (llm-embedding provider chunk)) chunks))))
@@ -1259,6 +1264,7 @@ Call ON-DONE callback with result as an argument after
FUNC evaluation done."
,(async-inject-variables "elisa-find-executable")
,(async-inject-variables "elisa-tar-executable")
,(async-inject-variables "elisa-prompt-rewriting-enabled")
+ ,(async-inject-variables "elisa-batch-embeddings-enabled")
,(async-inject-variables "elisa-rewrite-prompt-template")
,(async-inject-variables "elisa-semantic-split-function")
,(async-inject-variables
"elisa-webpage-extraction-function")
- [elpa] externals/elisa updated (4a4d1db359 -> 1c1e0f1715), ELPA Syncer, 2024/11/23
- [elpa] externals/elisa 5d1c1c0f0b 3/7: Fix elisp-check errors, ELPA Syncer, 2024/11/23
- [elpa] externals/elisa 1c1e0f1715 7/7: Bump version, ELPA Syncer, 2024/11/23
- [elpa] externals/elisa 9273c84961 4/7: Update required llm dependency, ELPA Syncer, 2024/11/23
- [elpa] externals/elisa 24b0ba8f2e 6/7: Merge pull request #28 from s-kostyaev/add-batch-embeddings-calculation, ELPA Syncer, 2024/11/23
- [elpa] externals/elisa a4f34972bb 1/7: Improve embeddings calculation in Elisa, ELPA Syncer, 2024/11/23
- [elpa] externals/elisa a22b96e601 2/7: Speed up semantic splitting using batch embeddings, ELPA Syncer, 2024/11/23
- [elpa] externals/elisa 860936af49 5/7: Disable batch embeddings by default,
ELPA Syncer <=