mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-15 15:45:27 +03:00
pass model size
This commit is contained in:
parent
cdb794ece8
commit
080598485f
@ -97,6 +97,7 @@ class Embeddings:
|
|||||||
"text_model_fp16.onnx": "https://huggingface.co/jinaai/jina-clip-v1/resolve/main/onnx/text_model_fp16.onnx",
|
"text_model_fp16.onnx": "https://huggingface.co/jinaai/jina-clip-v1/resolve/main/onnx/text_model_fp16.onnx",
|
||||||
},
|
},
|
||||||
embedding_function=jina_text_embedding_function,
|
embedding_function=jina_text_embedding_function,
|
||||||
|
model_size=config.model_size,
|
||||||
model_type="text",
|
model_type="text",
|
||||||
requestor=self.requestor,
|
requestor=self.requestor,
|
||||||
device="CPU",
|
device="CPU",
|
||||||
@ -118,6 +119,7 @@ class Embeddings:
|
|||||||
model_file=model_file,
|
model_file=model_file,
|
||||||
download_urls=download_urls,
|
download_urls=download_urls,
|
||||||
embedding_function=jina_vision_embedding_function,
|
embedding_function=jina_vision_embedding_function,
|
||||||
|
model_size=config.model_size,
|
||||||
model_type="vision",
|
model_type="vision",
|
||||||
requestor=self.requestor,
|
requestor=self.requestor,
|
||||||
device=self.config.device,
|
device=self.config.device,
|
||||||
|
|||||||
@ -41,6 +41,7 @@ class GenericONNXEmbedding:
|
|||||||
model_file: str,
|
model_file: str,
|
||||||
download_urls: Dict[str, str],
|
download_urls: Dict[str, str],
|
||||||
embedding_function: Callable[[List[np.ndarray]], np.ndarray],
|
embedding_function: Callable[[List[np.ndarray]], np.ndarray],
|
||||||
|
model_size: str,
|
||||||
model_type: str,
|
model_type: str,
|
||||||
requestor: InterProcessRequestor,
|
requestor: InterProcessRequestor,
|
||||||
tokenizer_file: Optional[str] = None,
|
tokenizer_file: Optional[str] = None,
|
||||||
@ -55,8 +56,7 @@ class GenericONNXEmbedding:
|
|||||||
self.model_type = model_type # 'text' or 'vision'
|
self.model_type = model_type # 'text' or 'vision'
|
||||||
self.providers, self.provider_options = get_ort_providers(
|
self.providers, self.provider_options = get_ort_providers(
|
||||||
force_cpu=device == "CPU",
|
force_cpu=device == "CPU",
|
||||||
requires_fp16=self.config.model_size == "large"
|
requires_fp16=model_size == "large" or self.model_type == "text",
|
||||||
or self.model_type == "text",
|
|
||||||
openvino_device=device,
|
openvino_device=device,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user