From ef315e4bf18e9c2e89a608cb2e57aa31969243eb Mon Sep 17 00:00:00 2001 From: Daehee Kim <76981513+DayNice@users.noreply.github.com> Date: Thu, 6 Nov 2025 21:08:37 +0900 Subject: [PATCH 1/2] Add `staticmethod` decorator to constructors --- python/python/embed_anything/_embed_anything.pyi | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/python/python/embed_anything/_embed_anything.pyi b/python/python/embed_anything/_embed_anything.pyi index 635713eb..c5482e7b 100644 --- a/python/python/embed_anything/_embed_anything.pyi +++ b/python/python/embed_anything/_embed_anything.pyi @@ -335,6 +335,7 @@ class ColpaliModel: revision: The revision of the model. """ + @staticmethod def from_pretrained(model_id: str, revision: str | None = None) -> ColpaliModel: """ Loads a pre-trained Colpali model from the Hugging Face model hub. @@ -347,6 +348,7 @@ class ColpaliModel: A ColpaliModel object. """ + @staticmethod def from_pretrained_onnx( model_id: str, revision: str | None = None ) -> ColpaliModel: @@ -400,8 +402,8 @@ class ColbertModel: Initializes the ColbertModel object. """ + @staticmethod def from_pretrained_onnx( - self, hf_model_id: str | None = None, revision: str | None = None, path_in_repo: str | None = None, @@ -437,6 +439,7 @@ class Reranker: Initializes the Reranker object. """ + @staticmethod def from_pretrained( model_id: str, revision: str | None = None, dtype: Dtype | None = None, path_in_repo: str | None = None ) -> Reranker: @@ -590,6 +593,7 @@ class EmbeddingModel: Represents an embedding model. """ + @staticmethod def from_pretrained_hf( model_id: str, revision: str | None = None, @@ -617,6 +621,7 @@ class EmbeddingModel: """ + @staticmethod def from_pretrained_cloud( model: WhichModel, model_id: str, api_key: str | None = None ) -> EmbeddingModel: @@ -657,6 +662,7 @@ class EmbeddingModel: ``` """ + @staticmethod def from_pretrained_onnx( model: WhichModel, model_name: Optional[ONNXModel] | None = None, @@ -875,6 +881,7 @@ class AudioDecoderModel: model_type: str quantized: bool + @staticmethod def from_pretrained_hf( model_id: str | None = None, revision: str | None = None, From 35b90b27067f7a213e4e2ef704db81414c748730 Mon Sep 17 00:00:00 2001 From: Daehee Kim <76981513+DayNice@users.noreply.github.com> Date: Thu, 6 Nov 2025 21:16:13 +0900 Subject: [PATCH 2/2] Remove duplicate declarations --- .../python/embed_anything/_embed_anything.pyi | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/python/python/embed_anything/_embed_anything.pyi b/python/python/embed_anything/_embed_anything.pyi index c5482e7b..18e96824 100644 --- a/python/python/embed_anything/_embed_anything.pyi +++ b/python/python/embed_anything/_embed_anything.pyi @@ -836,23 +836,6 @@ class EmbeddingModel: A list of EmbedData objects. """ - def embed_webpage( - self, - url: str, - config: TextEmbedConfig | None = None, - adapter: Adapter | None = None, - ) -> list[EmbedData]: - """ - Embeds the given webpage and returns a list of EmbedData objects. - - Args: - url: The URL of the webpage to embed. - config: The configuration for the embedding. - adapter: The adapter for the embedding. - - Returns: - A list of EmbedData objects. - """ class AudioDecoderModel: """ @@ -1012,5 +995,3 @@ class ONNXModel(Enum): SPLADEPPENV1 = "SPLADEPPENV1" SPLADEPPENV2 = "SPLADEPPENV2" - - ModernBERTBase = "ModernBERTBase"