mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 20:37:15 +02:00
Allow explicit dimensions
for ollama
This commit is contained in:
parent
6c598fa06d
commit
7a347966da
4 changed files with 36 additions and 26 deletions
|
@ -202,22 +202,6 @@ impl Default for EmbedderOptions {
|
|||
}
|
||||
}
|
||||
|
||||
impl EmbedderOptions {
|
||||
/// Default options for the Hugging Face embedder
|
||||
pub fn huggingface() -> Self {
|
||||
Self::HuggingFace(hf::EmbedderOptions::new())
|
||||
}
|
||||
|
||||
/// Default options for the OpenAI embedder
|
||||
pub fn openai(api_key: Option<String>) -> Self {
|
||||
Self::OpenAi(openai::EmbedderOptions::with_default_model(api_key))
|
||||
}
|
||||
|
||||
pub fn ollama(api_key: Option<String>, url: Option<String>) -> Self {
|
||||
Self::Ollama(ollama::EmbedderOptions::with_default_model(api_key, url))
|
||||
}
|
||||
}
|
||||
|
||||
impl Embedder {
|
||||
/// Spawns a new embedder built from its options.
|
||||
pub fn new(options: EmbedderOptions) -> std::result::Result<Self, NewEmbedderError> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue