Skip to content

Commit ac3a9ce

Browse files
committed
noindex
1 parent 74d0d9d commit ac3a9ce

4 files changed

Lines changed: 15 additions & 17 deletions

File tree

FlagEmbedding/abc/inference/AbsEmbedder.py

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ class AbsEmbedder(ABC):
3333
batch_size (int, optional): Batch size for inference. Defaults to :data:`256`.
3434
query_max_length (int, optional): Maximum length for query. Defaults to :data:`512`.
3535
passage_max_length (int, optional): Maximum length for passage. Defaults to :data:`512`.
36-
instruction (Optional[str], optional): Instruction for embedding with :attr:`instruction_format`. Defaults to :data:`None`.
37-
instruction_format (str, optional): Instruction format when using :attr:`instruction`. Defaults to :data:`"{}{}"`.
3836
convert_to_numpy (bool, optional): If True, the output embedding will be a Numpy array. Otherwise, it will be a Torch Tensor.
3937
Defaults to :data:`True`.
4038
kwargs (Dict[Any], optional): Additional parameters for HuggingFace Transformers config or children classes.
@@ -139,10 +137,10 @@ def encode_queries(
139137
140138
Args:
141139
queries (Union[List[str], str]): Input queries to encode.
142-
batch_size (Optional[int], optional): Number of sentences for each iter. Defaults to None.
143-
max_length (Optional[int], optional): Maximum length of tokens. Defaults to None.
140+
batch_size (Optional[int], optional): Number of sentences for each iter. Defaults to :data:`None`.
141+
max_length (Optional[int], optional): Maximum length of tokens. Defaults to :data:`None`.
144142
convert_to_numpy (Optional[bool], optional): If True, the output embedding will be a Numpy array. Otherwise, it will
145-
be a Torch Tensor. Defaults to None.
143+
be a Torch Tensor. Defaults to :data:`None`.
146144
147145
Returns:
148146
Union[torch.Tensor, np.ndarray]: Return the embedding vectors in a numpy array or tensor.
@@ -173,10 +171,10 @@ def encode_corpus(
173171
174172
Args:
175173
corpus (Union[List[str], str]): Input corpus to encode.
176-
batch_size (Optional[int], optional): Number of sentences for each iter. Defaults to None.
177-
max_length (Optional[int], optional): Maximum length of tokens. Defaults to None.
174+
batch_size (Optional[int], optional): Number of sentences for each iter. Defaults to :data:`None`.
175+
max_length (Optional[int], optional): Maximum length of tokens. Defaults to :data:`None`.
178176
convert_to_numpy (Optional[bool], optional): If True, the output embedding will be a Numpy array. Otherwise, it will
179-
be a Torch Tensor. Defaults to None.
177+
be a Torch Tensor. Defaults to :data:`None`.
180178
181179
Returns:
182180
Union[torch.Tensor, np.ndarray]: Return the embedding vectors in a numpy array or tensor.
@@ -212,12 +210,12 @@ def encode(
212210
213211
Args:
214212
sentences (Union[List[str], str]): Input sentences to encode.
215-
batch_size (Optional[int], optional): Number of sentences for each iter. Defaults to None.
216-
max_length (Optional[int], optional): Maximum length of tokens. Defaults to None.
213+
batch_size (Optional[int], optional): Number of sentences for each iter. Defaults to :data:`None`.
214+
max_length (Optional[int], optional): Maximum length of tokens. Defaults to :data:`None`.
217215
convert_to_numpy (Optional[bool], optional): If True, the output embedding will be a Numpy array. Otherwise, it will
218-
be a Torch Tensor. Defaults to None.
219-
instruction (Optional[str], optional): The text of instruction. Defaults to None.
220-
instruction_format (Optional[str], optional): Format for instruction. Defaults to None.
216+
be a Torch Tensor. Defaults to :data:`None`.
217+
instruction (Optional[str], optional): The text of instruction. Defaults to :data:`None`.
218+
instruction_format (Optional[str], optional): Format for instruction. Defaults to :data:`None`.
221219
222220
Returns:
223221
Union[torch.Tensor, np.ndarray]: return the embedding vectors in a numpy array or tensor.

FlagEmbedding/abc/inference/AbsReranker.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ class AbsReranker(ABC):
2828
with :attr:`query_instruction_format`. Defaults to :data:`None`.
2929
query_instruction_format: (str, optional): The template for :attr:`query_instruction_for_rerank`. Defaults to :data:`"{}{}"`.
3030
passage_instruction_for_rerank (Optional[str], optional): Passage instruction for reranking. Defaults to :data:`None`.
31-
passage_instruction_format (str, optional): Passage instruction format when using `passage_instruction_for_rerank`.
31+
passage_instruction_format (str, optional): Passage instruction format when using :attr:`passage_instruction_for_rerank`.
3232
Defaults to :data:`"{}{}"`.
3333
devices (Optional[Union[str, int, List[str], List[int]]], optional): Devices to use for model inference. Defaults to :data:`None`.
3434
batch_size (int, optional): Batch size for inference. Defaults to :data:`128`.
3535
query_max_length (int, optional): Maximum length for query. Defaults to :data:`None`.
36-
passage_max_length (int, optional): Maximum length for passage. Defaults to :data:`512`.
36+
max_length (int, optional): Maximum length. Defaults to :data:`512`.
3737
normalize (bool, optional): If true, normalize the result. Defaults to :data:`False`.
3838
kwargs (Dict[Any], optional): Additional parameters for HuggingFace Transformers config or children classes.
3939
"""

FlagEmbedding/inference/auto_embedder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def from_finetuned(
5555
ValueError
5656
5757
Returns:
58-
AbsEmbedder: The model class to load model, which is child class of :clsss:`AbsEmbedder`.
58+
AbsEmbedder: The model class to load model, which is child class of :class:`AbsEmbedder`.
5959
"""
6060
model_name = os.path.basename(model_name_or_path)
6161
if model_name.startswith("checkpoint-"):

FlagEmbedding/inference/auto_reranker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def from_finetuned(
4444
ValueError
4545
4646
Returns:
47-
AbsReranker: The reranker class to load model, which is child class of :clsss:`AbsReranker`.
47+
AbsReranker: The reranker class to load model, which is child class of :class:`AbsReranker`.
4848
"""
4949
model_name = os.path.basename(model_name_or_path)
5050
if model_name.startswith("checkpoint-"):

0 commit comments

Comments
 (0)