Skip to content
Snippets Groups Projects
Unverified Commit c651b4af authored by James Briggs's avatar James Briggs
Browse files

lint

parent 7679e261
Branches
Tags
No related merge requests found
import numpy as np
from collections import Counter
from semantic_router.encoders import BaseEncoder
from semantic_router.route import Route
from numpy.linalg import norm
import string import string
from collections import Counter
from typing import Dict from typing import Dict
import numpy as np
from numpy import ndarray from numpy import ndarray
from numpy.linalg import norm
from semantic_router.encoders import BaseEncoder
from semantic_router.route import Route
class TfidfEncoder(BaseEncoder): class TfidfEncoder(BaseEncoder):
......
...@@ -27,13 +27,13 @@ class HybridRouteLayer: ...@@ -27,13 +27,13 @@ class HybridRouteLayer:
): ):
self.encoder = encoder self.encoder = encoder
self.score_threshold = self.encoder.score_threshold self.score_threshold = self.encoder.score_threshold
if sparse_encoder is None: if sparse_encoder is None:
logger.warning("No sparse_encoder provided. Using default BM25Encoder.") logger.warning("No sparse_encoder provided. Using default BM25Encoder.")
self.sparse_encoder = BM25Encoder() self.sparse_encoder = BM25Encoder()
else: else:
self.sparse_encoder = sparse_encoder self.sparse_encoder = sparse_encoder
self.alpha = alpha self.alpha = alpha
self.routes = routes self.routes = routes
if isinstance(self.sparse_encoder, TfidfEncoder) and hasattr( if isinstance(self.sparse_encoder, TfidfEncoder) and hasattr(
......
import numpy as np
import pytest import pytest
from semantic_router.encoders import TfidfEncoder from semantic_router.encoders import TfidfEncoder
from semantic_router.route import Route from semantic_router.route import Route
import numpy as np
@pytest.fixture @pytest.fixture
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment