Enhancement Request for Broader Compatibility with Python Version in Type Annotations
Thanks for your release of new reranker model, but I noticed in https://github.com/FlagOpen/FlagEmbedding/blob/25c30a853d93434724929ac83136cd8dda24291a/FlagEmbedding/flag_reranker.py#L345-L348 Considering that many users and projects still operate on earlier Python versions(below 3.10), I believe adjusting the type hints to use the Union type from the typing module could significantly enhance the library's accessibility and compatibility. For instance:
def compute_score(self, sentence_pairs: Union[List[Tuple[str, str]], Tuple[str, str]], batch_size: int = 16,
max_length: int = 512, cutoff_layers: List[int] = None, prompt: str = None,
normalize: bool = False) -> Union[float, list[Any], list[Union[float, Any]], list[
list[Any], list[Union[float, Any]]], Any]:
Thank you for your suggestion, we will make modifications to this part.
This change seems to have been merged into the master branch, but the latest version(1.2.7) from pypi looks like still be the old one. Do you mind publishing a new version to pypi? @545999961
This change seems to have been merged into the master branch, but the latest version(1.2.7) from pypi looks like still be the old one. Do you mind publishing a new version to pypi? @545999961
Hi, @dcalsky , we have released a new version in pypi.