fixed setting different clip, removed unused stubs (#2987)

This commit is contained in:
Mert
2023-06-27 13:21:50 -04:00
committed by GitHub
parent b3e97a1a0c
commit 4d3ce0a65e
5 changed files with 6 additions and 25 deletions

View File

@@ -1,3 +1,3 @@
from .clip import CLIPSTTextEncoder, CLIPSTVisionEncoder
from .clip import CLIPSTEncoder
from .facial_recognition import FaceRecognizer
from .image_classification import ImageClassifier

View File

@@ -1,6 +1,6 @@
from __future__ import annotations
from abc import abstractmethod, ABC
from abc import ABC, abstractmethod
from pathlib import Path
from typing import Any

View File

@@ -25,13 +25,3 @@ class CLIPSTEncoder(InferenceModel):
def predict(self, image_or_text: Image | str) -> list[float]:
return self.model.encode(image_or_text).tolist()
# stubs to allow different behavior between the two in the future
# and handle loading different image and text clip models
class CLIPSTVisionEncoder(CLIPSTEncoder):
_model_type = ModelType.CLIP_VISION
class CLIPSTTextEncoder(CLIPSTEncoder):
_model_type = ModelType.CLIP_TEXT