mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-09 21:29:11 +00:00
Use typing union in text_search for python 3.8 compatible type hinting
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
import logging
|
import logging
|
||||||
import math
|
import math
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import List, Tuple, Type
|
from typing import List, Tuple, Type, Union
|
||||||
|
|
||||||
# External Packages
|
# External Packages
|
||||||
import torch
|
import torch
|
||||||
@@ -105,7 +105,7 @@ def compute_embeddings(
|
|||||||
async def query(
|
async def query(
|
||||||
raw_query: str,
|
raw_query: str,
|
||||||
model: TextSearchModel,
|
model: TextSearchModel,
|
||||||
question_embedding: torch.Tensor | None = None,
|
question_embedding: Union[torch.Tensor, None] = None,
|
||||||
rank_results: bool = False,
|
rank_results: bool = False,
|
||||||
score_threshold: float = -math.inf,
|
score_threshold: float = -math.inf,
|
||||||
dedupe: bool = True,
|
dedupe: bool = True,
|
||||||
|
|||||||
Reference in New Issue
Block a user