From 422f5f77c7e2b6c9162eef76bbca2cda5e80d3dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CDaniel=20Griffiths=E2=80=9D?= <Danielgriffiths1790@gmail.com> Date: Fri, 5 Jan 2024 09:52:50 +0000 Subject: [PATCH] fix: added default values to class variables --- semantic_router/encoders/tfidf.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/semantic_router/encoders/tfidf.py b/semantic_router/encoders/tfidf.py index 68baceaa..2782b1ed 100644 --- a/semantic_router/encoders/tfidf.py +++ b/semantic_router/encoders/tfidf.py @@ -4,11 +4,13 @@ from semantic_router.encoders import BaseEncoder from semantic_router.route import Route from numpy.linalg import norm import string +from typing import Dict +from numpy import ndarray class TfidfEncoder(BaseEncoder): - idf: np.ndarray - word_index: dict + idf: ndarray = np.array([]) + word_index: Dict = {} def __init__(self, name: str = "tfidf"): super().__init__(name=name) -- GitLab