Don't accept dimensions of 0 (ever) or dimensions greater than the default dimensions of the model

This commit is contained in:
Louis Dureuil 2024-02-07 11:48:47 +01:00
parent 32ee05ccef
commit 88d03c56ab
No known key found for this signature in database
3 changed files with 28 additions and 0 deletions

View file

@ -348,6 +348,8 @@ impl ErrorCode for milli::Error {
| UserError::MissingFieldForSource { .. }
| UserError::InvalidOpenAiModel { .. }
| UserError::InvalidOpenAiModelDimensions { .. }
| UserError::InvalidOpenAiModelDimensionsMax { .. }
| UserError::InvalidSettingsDimensions { .. }
| UserError::InvalidPrompt(_) => Code::InvalidSettingsEmbedders,
UserError::TooManyEmbedders(_) => Code::InvalidSettingsEmbedders,
UserError::InvalidPromptForEmbeddings(..) => Code::InvalidSettingsEmbedders,