mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-20 13:54:36 +01:00
Don't require download check
This commit is contained in:
@@ -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 = [
|
||||
"en",
|
||||
"es",
|
||||
|
||||
@@ -23,6 +23,7 @@ import { toast } from "sonner";
|
||||
import useSWR from "swr";
|
||||
import useSWRInfinite from "swr/infinite";
|
||||
import { useDocDomain } from "@/hooks/use-doc-domain";
|
||||
import { JINA_EMBEDDING_MODELS } from "@/lib/const";
|
||||
|
||||
const API_LIMIT = 25;
|
||||
|
||||
@@ -293,7 +294,12 @@ export default function Explore() {
|
||||
const modelVersion = config?.semantic_search.model || "jinav1";
|
||||
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(
|
||||
modelVersion === "jinav1"
|
||||
? "jinaai/jina-clip-v1-text_model_fp16.onnx"
|
||||
@@ -328,6 +334,10 @@ export default function Explore() {
|
||||
);
|
||||
|
||||
const allModelsLoaded = useMemo(() => {
|
||||
if (isGenaiEmbeddings) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return (
|
||||
textModelState === "downloaded" &&
|
||||
textTokenizerState === "downloaded" &&
|
||||
@@ -335,6 +345,7 @@ export default function Explore() {
|
||||
visionFeatureExtractorState === "downloaded"
|
||||
);
|
||||
}, [
|
||||
isGenaiEmbeddings,
|
||||
textModelState,
|
||||
textTokenizerState,
|
||||
visionModelState,
|
||||
@@ -358,10 +369,11 @@ export default function Explore() {
|
||||
!defaultViewLoaded ||
|
||||
(config?.semantic_search.enabled &&
|
||||
(!reindexState ||
|
||||
!textModelState ||
|
||||
!textTokenizerState ||
|
||||
!visionModelState ||
|
||||
!visionFeatureExtractorState))
|
||||
(!isGenaiEmbeddings &&
|
||||
(!textModelState ||
|
||||
!textTokenizerState ||
|
||||
!visionModelState ||
|
||||
!visionFeatureExtractorState))))
|
||||
) {
|
||||
return (
|
||||
<ActivityIndicator className="absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2" />
|
||||
|
||||
Reference in New Issue
Block a user