From 1eb30f2766e3fd2515aa2db85b96a448c26898bc Mon Sep 17 00:00:00 2001 From: Siraj R Aizlewood <siraj@aurelio.ai> Date: Thu, 25 Jan 2024 13:53:14 +0400 Subject: [PATCH] MyPy Fixes --- semantic_router/layer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/semantic_router/layer.py b/semantic_router/layer.py index 3d6ac5f2..297f6a3f 100644 --- a/semantic_router/layer.py +++ b/semantic_router/layer.py @@ -341,7 +341,7 @@ class RouteLayer: config = self.to_config() config.to_file(file_path) - def get_route_thresholds(self) -> Dict[str, float]: + def get_route_thresholds(self) -> Dict[str, Optional[float]]: return {route.name: route.score_threshold for route in self.routes} def fit( @@ -390,7 +390,7 @@ class TestRouteSelection: ): # Define the range of threshold values for each route route_names = [route.name for route in self.route_layer.routes] - best_accuracy = 0 + best_accuracy = 0.0 best_thresholds = {} # Evaluate the performance for each random sample for _ in tqdm(range(num_samples), desc=f"Processing {num_samples} Samples."): -- GitLab