File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
autointent/modules/scoring/_knn Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 44
55import numpy as np
66import numpy .typing as npt
7+ from pydantic import PositiveInt
78
89from autointent import Context , Ranker
910from autointent .configs import CrossEncoderConfig , EmbedderConfig
@@ -35,10 +36,10 @@ class RerankScorer(KNNScorer):
3536
3637 def __init__ (
3738 self ,
38- k : int = 5 ,
39+ k : PositiveInt = 5 ,
3940 weights : WeightType = "distance" ,
4041 use_crosencoder_scores : bool = False ,
41- m : int | None = None ,
42+ m : PositiveInt | None = None ,
4243 cross_encoder_config : CrossEncoderConfig | str | dict [str , Any ] | None = None ,
4344 embedder_config : EmbedderConfig | str | dict [str , Any ] | None = None ,
4445 ) -> None :
@@ -61,9 +62,9 @@ def __init__(
6162 def from_context (
6263 cls ,
6364 context : Context ,
64- k : int = 5 ,
65+ k : PositiveInt = 5 ,
6566 weights : WeightType = "distance" ,
66- m : int | None = None ,
67+ m : PositiveInt | None = None ,
6768 cross_encoder_config : CrossEncoderConfig | str | None = None ,
6869 embedder_config : EmbedderConfig | str | None = None ,
6970 use_crosencoder_scores : bool = False ,
You can’t perform that action at this time.
0 commit comments