diff --git a/server/utils/EmbeddingEngines/native/index.js b/server/utils/EmbeddingEngines/native/index.js index ae73c4896..5494c8869 100644 --- a/server/utils/EmbeddingEngines/native/index.js +++ b/server/utils/EmbeddingEngines/native/index.js @@ -107,14 +107,21 @@ class NativeEmbedder { ); let fetchResponse = await this.#fetchWithHost(); - if (fetchResponse.pipeline !== null) return fetchResponse.pipeline; + if (fetchResponse.pipeline !== null) { + this.modelDownloaded = true; + return fetchResponse.pipeline; + } this.log( `Failed to download model from primary URL. Using fallback ${fetchResponse.retry}` ); if (!!fetchResponse.retry) fetchResponse = await this.#fetchWithHost(fetchResponse.retry); - if (fetchResponse.pipeline !== null) return fetchResponse.pipeline; + if (fetchResponse.pipeline !== null) { + this.modelDownloaded = true; + return fetchResponse.pipeline; + } + throw fetchResponse.error; }