From 333ce12eb2dcfa947c464934c3dfda59c38f2d6e Mon Sep 17 00:00:00 2001 From: Louis Dureuil Date: Wed, 20 Dec 2023 10:17:49 +0100 Subject: [PATCH] Fixed issue where the default revision is always the one we picked for the default model --- milli/src/vector/settings.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/milli/src/vector/settings.rs b/milli/src/vector/settings.rs index 912cdf953..1826c040d 100644 --- a/milli/src/vector/settings.rs +++ b/milli/src/vector/settings.rs @@ -228,6 +228,12 @@ impl From for crate::vector::hf::EmbedderOptions { let mut this = Self::default(); if let Some(model) = model.set() { this.model = model; + // Reset the revision if we are setting the model. + // This allows the following: + // "huggingFace": {} -> default model with default revision + // "huggingFace": { "model": "name-of-the-default-model" } -> default model without a revision + // "huggingFace": { "model": "some-other-model" } -> most importantly, other model without a revision + this.revision = None; } if let Some(revision) = revision.set() { this.revision = Some(revision);