From 941f200d6ac4c5b8c55252e61a41c8625d85d91a Mon Sep 17 00:00:00 2001 From: alisalim17 Date: Thu, 15 Feb 2024 19:42:38 +0400 Subject: [PATCH] making cohere encoder optional --- service/router.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/service/router.py b/service/router.py index 29a0cc83..fb966f39 100644 --- a/service/router.py +++ b/service/router.py @@ -24,7 +24,8 @@ def create_route_layer() -> RouteLayer: score_threshold=0.5, ) ] - encoder = CohereEncoder(cohere_api_key=config("COHERE_API_KEY")) + cohere_api_key = config("COHERE_API_KEY", None) + encoder = CohereEncoder(cohere_api_key=cohere_api_key) if cohere_api_key else None return RouteLayer(encoder=encoder, routes=routes)