From 510bb7e684a14cadcd8990932e15bc7a7f80690d Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Tue, 27 Jun 2023 15:59:50 -0700 Subject: [PATCH] Use typing union in text_search for python 3.8 compatible type hinting --- src/khoj/search_type/text_search.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/khoj/search_type/text_search.py b/src/khoj/search_type/text_search.py index 83f15918..0af5b0fc 100644 --- a/src/khoj/search_type/text_search.py +++ b/src/khoj/search_type/text_search.py @@ -2,7 +2,7 @@ import logging import math from pathlib import Path -from typing import List, Tuple, Type +from typing import List, Tuple, Type, Union # External Packages import torch @@ -105,7 +105,7 @@ def compute_embeddings( async def query( raw_query: str, model: TextSearchModel, - question_embedding: torch.Tensor | None = None, + question_embedding: Union[torch.Tensor, None] = None, rank_results: bool = False, score_threshold: float = -math.inf, dedupe: bool = True,