mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 20:37:15 +02:00
Add Ollama dimension inference and add clearer errors
Instead of the user manually specifying the model dimensions it will now automatically get determined Just like with hf.rs the word "test" gets embedded to determine the dimensions of the output Add a dedicated error type for if the model doesn't exist (don't automatically pull it though) and set the fault of that error to be the user
This commit is contained in:
parent
d3004d8040
commit
88bc9556a9
4 changed files with 96 additions and 36 deletions
|
@ -1179,8 +1179,8 @@ pub fn validate_embedding_settings(
|
|||
}
|
||||
}
|
||||
EmbedderSource::Ollama => {
|
||||
// Existence & corrent dimensions of models cannot easily be checked here.
|
||||
check_set(&dimensions, "dimensions", inferred_source, name)?;
|
||||
// Dimensions get inferred, only model name is required
|
||||
check_unset(&dimensions, "dimensions", inferred_source, name)?;
|
||||
check_set(&model, "model", inferred_source, name)?;
|
||||
check_unset(&api_key, "apiKey", inferred_source, name)?;
|
||||
check_unset(&revision, "revision", inferred_source, name)?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue