-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: distinguish embedding-only model
Signed-off-by: thxCode <thxcode0824@gmail.com>
- Loading branch information
Showing
4 changed files
with
45 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
diff --git a/include/llama.h b/include/llama.h | ||
index f23355a6..96e16d89 100644 | ||
--- a/include/llama.h | ||
+++ b/include/llama.h | ||
@@ -1178,6 +1178,8 @@ extern "C" { | ||
|
||
LLAMA_API void llama_dump_timing_info_yaml(FILE * stream, const struct llama_context * ctx); | ||
|
||
+ LLAMA_API bool llama_supports_embedding_only (const struct llama_context * ctx); | ||
+ | ||
#ifdef __cplusplus | ||
} | ||
#endif | ||
diff --git a/src/llama.cpp b/src/llama.cpp | ||
index a207451f..f635b15a 100644 | ||
--- a/src/llama.cpp | ||
+++ b/src/llama.cpp | ||
@@ -19158,3 +19158,7 @@ void llama_log_callback_default(ggml_log_level level, const char * text, void * | ||
fputs(text, stderr); | ||
fflush(stderr); | ||
} | ||
+ | ||
+bool llama_supports_embedding_only(const struct llama_context * ctx) { | ||
+ return !ctx->cparams.causal_attn; | ||
+} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters