From 348963b617d685e127c9b8766642b93f5c96444d Mon Sep 17 00:00:00 2001 From: James Briggs <35938317+jamescalam@users.noreply.github.com> Date: Mon, 13 Nov 2023 07:38:27 -0800 Subject: [PATCH 1/2] bug fix missing encoder --- semantic_router/encoders/huggingface.py | 9 --------- semantic_router/schema.py | 2 -- 2 files changed, 11 deletions(-) delete mode 100644 semantic_router/encoders/huggingface.py diff --git a/semantic_router/encoders/huggingface.py b/semantic_router/encoders/huggingface.py deleted file mode 100644 index 258c5037..00000000 --- a/semantic_router/encoders/huggingface.py +++ /dev/null @@ -1,9 +0,0 @@ -from semantic_router.encoders import BaseEncoder - - -class HuggingFaceEncoder(BaseEncoder): - def __init__(self, name: str): - self.name = name - - def __call__(self, texts: list[str]) -> list[float]: - raise NotImplementedError diff --git a/semantic_router/schema.py b/semantic_router/schema.py index 439f2322..981d9862 100644 --- a/semantic_router/schema.py +++ b/semantic_router/schema.py @@ -6,7 +6,6 @@ from semantic_router.encoders import ( BaseEncoder, CohereEncoder, - HuggingFaceEncoder, OpenAIEncoder, ) @@ -18,7 +17,6 @@ class Decision(BaseModel): class EncoderType(Enum): - HUGGINGFACE = "huggingface" OPENAI = "openai" COHERE = "cohere" From f67e5d248767e73ca64cffaa4b29638e43eb7a25 Mon Sep 17 00:00:00 2001 From: James Briggs <35938317+jamescalam@users.noreply.github.com> Date: Mon, 13 Nov 2023 07:44:54 -0800 Subject: [PATCH 2/2] remove missing encoder type --- semantic_router/schema.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/semantic_router/schema.py b/semantic_router/schema.py index 981d9862..d13975c0 100644 --- a/semantic_router/schema.py +++ b/semantic_router/schema.py @@ -31,7 +31,7 @@ def __init__(self, type: str, name: str): self.type = EncoderType(type) self.name = name if self.type == EncoderType.HUGGINGFACE: - self.model = HuggingFaceEncoder(name) + raise NotImplementedError elif self.type == EncoderType.OPENAI: self.model = OpenAIEncoder(name) elif self.type == EncoderType.COHERE: