Don't require download check

This commit is contained in:
Nicolas Mowen 2026-02-19 08:34:47 -07:00
parent 18e818a18d
commit 22cbc7ab2e
2 changed files with 20 additions and 5 deletions

View File

@ -1,3 +1,6 @@
/** ONNX embedding models that require local model downloads. GenAI providers are not in this list. */
export const JINA_EMBEDDING_MODELS = ["jinav1", "jinav2"] as const;
export const supportedLanguageKeys = [ export const supportedLanguageKeys = [
"en", "en",
"es", "es",

View File

@ -23,6 +23,7 @@ import { toast } from "sonner";
import useSWR from "swr"; import useSWR from "swr";
import useSWRInfinite from "swr/infinite"; import useSWRInfinite from "swr/infinite";
import { useDocDomain } from "@/hooks/use-doc-domain"; import { useDocDomain } from "@/hooks/use-doc-domain";
import { JINA_EMBEDDING_MODELS } from "@/lib/const";
const API_LIMIT = 25; const API_LIMIT = 25;
@ -293,7 +294,12 @@ export default function Explore() {
const modelVersion = config?.semantic_search.model || "jinav1"; const modelVersion = config?.semantic_search.model || "jinav1";
const modelSize = config?.semantic_search.model_size || "small"; const modelSize = config?.semantic_search.model_size || "small";
// Text model state // GenAI providers have no local models to download
const isGenaiEmbeddings =
typeof modelVersion === "string" &&
!(JINA_EMBEDDING_MODELS as readonly string[]).includes(modelVersion);
// Text model state (skipped for GenAI - no local models)
const { payload: textModelState } = useModelState( const { payload: textModelState } = useModelState(
modelVersion === "jinav1" modelVersion === "jinav1"
? "jinaai/jina-clip-v1-text_model_fp16.onnx" ? "jinaai/jina-clip-v1-text_model_fp16.onnx"
@ -328,6 +334,10 @@ export default function Explore() {
); );
const allModelsLoaded = useMemo(() => { const allModelsLoaded = useMemo(() => {
if (isGenaiEmbeddings) {
return true;
}
return ( return (
textModelState === "downloaded" && textModelState === "downloaded" &&
textTokenizerState === "downloaded" && textTokenizerState === "downloaded" &&
@ -335,6 +345,7 @@ export default function Explore() {
visionFeatureExtractorState === "downloaded" visionFeatureExtractorState === "downloaded"
); );
}, [ }, [
isGenaiEmbeddings,
textModelState, textModelState,
textTokenizerState, textTokenizerState,
visionModelState, visionModelState,
@ -358,10 +369,11 @@ export default function Explore() {
!defaultViewLoaded || !defaultViewLoaded ||
(config?.semantic_search.enabled && (config?.semantic_search.enabled &&
(!reindexState || (!reindexState ||
!textModelState || (!isGenaiEmbeddings &&
!textTokenizerState || (!textModelState ||
!visionModelState || !textTokenizerState ||
!visionFeatureExtractorState)) !visionModelState ||
!visionFeatureExtractorState))))
) { ) {
return ( return (
<ActivityIndicator className="absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2" /> <ActivityIndicator className="absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2" />