sinapsis-huggingface 0.2.12__py3-none-any.whl → 0.2.14__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (17) hide show
  1. {sinapsis_huggingface-0.2.12.dist-info → sinapsis_huggingface-0.2.14.dist-info}/METADATA +14 -1
  2. {sinapsis_huggingface-0.2.12.dist-info → sinapsis_huggingface-0.2.14.dist-info}/RECORD +17 -12
  3. {sinapsis_huggingface-0.2.12.dist-info → sinapsis_huggingface-0.2.14.dist-info}/top_level.txt +1 -0
  4. sinapsis_huggingface_diffusers/src/sinapsis_huggingface_diffusers/templates/base_diffusers.py +1 -1
  5. sinapsis_huggingface_grounding_dino/src/sinapsis_huggingface_grounding_dino/templates/grounding_dino.py +1 -1
  6. sinapsis_huggingface_hub/src/sinapsis_huggingface_hub/__init__.py +0 -0
  7. sinapsis_huggingface_hub/src/sinapsis_huggingface_hub/helpers/__init__.py +0 -0
  8. sinapsis_huggingface_hub/src/sinapsis_huggingface_hub/helpers/tags.py +7 -0
  9. sinapsis_huggingface_hub/src/sinapsis_huggingface_hub/templates/__init__.py +19 -0
  10. sinapsis_huggingface_hub/src/sinapsis_huggingface_hub/templates/huggingface_downloader.py +71 -0
  11. sinapsis_huggingface_transformers/src/sinapsis_huggingface_transformers/templates/image_to_text_transformers.py +3 -0
  12. sinapsis_huggingface_transformers/src/sinapsis_huggingface_transformers/templates/pali_gemma/pali_gemma_base.py +1 -1
  13. sinapsis_huggingface_transformers/src/sinapsis_huggingface_transformers/templates/speech_to_text_transformers.py +1 -0
  14. sinapsis_huggingface_transformers/src/sinapsis_huggingface_transformers/templates/summarization_transformers.py +6 -0
  15. sinapsis_huggingface_transformers/src/sinapsis_huggingface_transformers/templates/text_to_speech_transformers.py +4 -0
  16. {sinapsis_huggingface-0.2.12.dist-info → sinapsis_huggingface-0.2.14.dist-info}/WHEEL +0 -0
  17. {sinapsis_huggingface-0.2.12.dist-info → sinapsis_huggingface-0.2.14.dist-info}/licenses/LICENSE +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sinapsis-huggingface
3
- Version: 0.2.12
3
+ Version: 0.2.14
4
4
  Summary: Package for HuggingFace-based templates
5
5
  Author-email: SinapsisAI <dev@sinapsis.tech>
6
6
  Project-URL: Homepage, https://sinapsis.tech
@@ -23,6 +23,7 @@ Requires-Dist: sinapsis-huggingface-diffusers[all]; extra == "all"
23
23
  Requires-Dist: sinapsis-huggingface-embeddings; extra == "all"
24
24
  Requires-Dist: sinapsis-huggingface-grounding-dino; extra == "all"
25
25
  Requires-Dist: sinapsis-huggingface-transformers; extra == "all"
26
+ Requires-Dist: sinapsis-huggingface-hub[all]; extra == "all"
26
27
  Requires-Dist: sinapsis-huggingface[gradio-app,sinapsis-data-writers]; extra == "all"
27
28
  Provides-Extra: sinapsis-data-writers
28
29
  Requires-Dist: sinapsis-data-writers>=0.1.0; extra == "sinapsis-data-writers"
@@ -60,6 +61,7 @@ This repo consists of different packages to handle huggingface tools for differe
60
61
  * <code>sinapsis-huggingface-embeddings</code>
61
62
  * <code>sinapsis-huggingface-grounding-dino</code>
62
63
  * <code>sinapsis-huggingface-transformers</code>
64
+ * <code>sinapsis-huggingface-hub</code>
63
65
 
64
66
  Install using your package manager of choice. We encourage the use of <code>uv</code>
65
67
 
@@ -151,6 +153,17 @@ For more details and specific templates, see the [README.md](https://github.com/
151
153
 
152
154
  </details>
153
155
 
156
+ <details>
157
+ <summary id="uv"><strong><span style="font-size: 1.4em;">Sinapsis Hugging Face Hub</span></strong></summary>
158
+
159
+ This sinapsis package offers templates to manage **datasets**, **models** and **spaces** with the Hugging Face Hub library. Currently it offers:
160
+
161
+ - **HuggingFaceDownloader**: Downloads a repository snapshot from the Hugging Face Hub.
162
+
163
+ For more details and specific templates, see the [README.md](https://github.com/Sinapsis-AI/sinapsis-huggingface/blob/main/packages/sinapsis_huggingface_hub/README.md).
164
+
165
+ </details>
166
+
154
167
  For more details, see the [official documentation](https://docs.sinapsis.tech/docs)
155
168
 
156
169
  <h2 id="webapps">🌐 Webapps</h2>
@@ -1,9 +1,9 @@
1
- sinapsis_huggingface-0.2.12.dist-info/licenses/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
1
+ sinapsis_huggingface-0.2.14.dist-info/licenses/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
2
2
  sinapsis_huggingface_diffusers/src/sinapsis_huggingface_diffusers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  sinapsis_huggingface_diffusers/src/sinapsis_huggingface_diffusers/helpers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  sinapsis_huggingface_diffusers/src/sinapsis_huggingface_diffusers/helpers/tags.py,sha256=TFmVD7r70vKmpNqSweVGme4riZZiRQWIfxySTexyJp8,522
5
5
  sinapsis_huggingface_diffusers/src/sinapsis_huggingface_diffusers/templates/__init__.py,sha256=9FHbS4hse9WIE-1a5jJlG-23gB3wahlULANJAWQ464c,947
6
- sinapsis_huggingface_diffusers/src/sinapsis_huggingface_diffusers/templates/base_diffusers.py,sha256=BBzbxwPYdt1rTInWzdj82Hd2f84Qi_Ki0FJO-xARoKM,11338
6
+ sinapsis_huggingface_diffusers/src/sinapsis_huggingface_diffusers/templates/base_diffusers.py,sha256=a-ZvbRgAdOY89z5GCcBjq02TTAPhbH9KN8KGoMFB-LE,11530
7
7
  sinapsis_huggingface_diffusers/src/sinapsis_huggingface_diffusers/templates/image_to_image_diffusers.py,sha256=Dj-ytpfsTMbsoN81xSwYr5be7nsg3rqznUFEsnceJbY,6548
8
8
  sinapsis_huggingface_diffusers/src/sinapsis_huggingface_diffusers/templates/image_to_video_gen_xl_diffusers.py,sha256=4X_iWj4mCzYPBWbWP3Zy0UJsMw-PPReroqiQ2Ieodz0,3746
9
9
  sinapsis_huggingface_diffusers/src/sinapsis_huggingface_diffusers/templates/inpainting_diffusers.py,sha256=5r7l4F_0A6V6waCSaitJhrdeXfZsdq2kAosO3o1LmXI,13932
@@ -19,25 +19,30 @@ sinapsis_huggingface_grounding_dino/src/sinapsis_huggingface_grounding_dino/help
19
19
  sinapsis_huggingface_grounding_dino/src/sinapsis_huggingface_grounding_dino/helpers/grounding_dino_keys.py,sha256=XacOtRkd099sM64pXg_N0oxtnBCQHgY6N6XAcI4WCzo,791
20
20
  sinapsis_huggingface_grounding_dino/src/sinapsis_huggingface_grounding_dino/helpers/tags.py,sha256=q_QiumP-iCGLbiV0LOSc-Y4anUASmPwgplhnCXEiuXI,368
21
21
  sinapsis_huggingface_grounding_dino/src/sinapsis_huggingface_grounding_dino/templates/__init__.py,sha256=PbNLyfrBTHZOmwF6mNFYLikFWEnVq9s-eFsRjFzIIWk,791
22
- sinapsis_huggingface_grounding_dino/src/sinapsis_huggingface_grounding_dino/templates/grounding_dino.py,sha256=Bljmlvhbeo4dV90MfEQAD4IbShSwoggwKZe_wPsBdME,15075
22
+ sinapsis_huggingface_grounding_dino/src/sinapsis_huggingface_grounding_dino/templates/grounding_dino.py,sha256=Qucb8JcicjgovT1p32JuxVQt5k0h4dn3syegWE7Hcug,15154
23
23
  sinapsis_huggingface_grounding_dino/src/sinapsis_huggingface_grounding_dino/templates/grounding_dino_classification.py,sha256=UeOarFsC8z0jg5WtOO9NAvhYnOFpEaLkM75fsGhRiZI,9171
24
+ sinapsis_huggingface_hub/src/sinapsis_huggingface_hub/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
25
+ sinapsis_huggingface_hub/src/sinapsis_huggingface_hub/helpers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
26
+ sinapsis_huggingface_hub/src/sinapsis_huggingface_hub/helpers/tags.py,sha256=1SzO5cGKKGufgTIsN1_RYzsDPs99iowI7K3M1ZwtQSI,120
27
+ sinapsis_huggingface_hub/src/sinapsis_huggingface_hub/templates/__init__.py,sha256=TsgxRtbtvFs2fwWLr5HuL3cLSll4Kbws-WOz1c7CZng,517
28
+ sinapsis_huggingface_hub/src/sinapsis_huggingface_hub/templates/huggingface_downloader.py,sha256=mizdvhBmPFldBcZvqUNpvWe87-9IxMG7g8x7HsJzNnU,3442
24
29
  sinapsis_huggingface_transformers/src/sinapsis_huggingface_transformers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
25
30
  sinapsis_huggingface_transformers/src/sinapsis_huggingface_transformers/helpers/__init__.py,sha256=RYEd6xTaVlItleSPoq9RVJIFgXfY6aOHqy2SIO7zwjc,168
26
31
  sinapsis_huggingface_transformers/src/sinapsis_huggingface_transformers/helpers/tags.py,sha256=F6zVOBh8mVnl9AG0s_t1ftZ-1Fg1RoO3zgng9PxfLWk,652
27
32
  sinapsis_huggingface_transformers/src/sinapsis_huggingface_transformers/helpers/text_to_sentences.py,sha256=teaJXoTAVzGwar9gxenBabkA9VBJd-VAxsNXlzkKMuU,1676
28
33
  sinapsis_huggingface_transformers/src/sinapsis_huggingface_transformers/templates/__init__.py,sha256=3BgUm6C_tRgzxh2ADMBcu6OHzR-U5Tl1eFVtU0PwxB0,1095
29
34
  sinapsis_huggingface_transformers/src/sinapsis_huggingface_transformers/templates/base_transformers.py,sha256=8vZBGQka2kSPYjbn5PbnT256_1UrJ099ygS6rQOMkmY,7647
30
- sinapsis_huggingface_transformers/src/sinapsis_huggingface_transformers/templates/image_to_text_transformers.py,sha256=6L4IUGv9l6Z3xQi5qZB70KPIa1BBUmckS1BhkmXbrjs,4272
31
- sinapsis_huggingface_transformers/src/sinapsis_huggingface_transformers/templates/speech_to_text_transformers.py,sha256=4lewS44TXjWoiPtcvNM9Xo1rvm8XkYTJtuduDXgbrXI,4062
32
- sinapsis_huggingface_transformers/src/sinapsis_huggingface_transformers/templates/summarization_transformers.py,sha256=XF7HYBNaEThyFJoqdWxb3mUqBtxEtnHN6mb6jwP_UEk,3732
33
- sinapsis_huggingface_transformers/src/sinapsis_huggingface_transformers/templates/text_to_speech_transformers.py,sha256=epvTmlxrRC1xeFiQzX0BJY9rHg6KtbYJSlKqbsLnE1k,6439
35
+ sinapsis_huggingface_transformers/src/sinapsis_huggingface_transformers/templates/image_to_text_transformers.py,sha256=PXAtazuTNkZkhcfzCCvGETkiKXycVXSGEvhtsC8Wewo,4363
36
+ sinapsis_huggingface_transformers/src/sinapsis_huggingface_transformers/templates/speech_to_text_transformers.py,sha256=y1FanicU5NpzIjxPor_8JNUBozGlmnQJkQW0FHAe6SE,4135
37
+ sinapsis_huggingface_transformers/src/sinapsis_huggingface_transformers/templates/summarization_transformers.py,sha256=jgYHvh5X7KnNqzZX_298_BOap3Ez86sWeOQtF81sm6g,3937
38
+ sinapsis_huggingface_transformers/src/sinapsis_huggingface_transformers/templates/text_to_speech_transformers.py,sha256=qcwzT7Vkag435gx2j8iQ0fa0k5S11OaCmLIr9eNm2Hs,6563
34
39
  sinapsis_huggingface_transformers/src/sinapsis_huggingface_transformers/templates/translation_transformers.py,sha256=36ZjRzd8GRKq8s_b3_zkyK8BE7pmvyrtqi1_UNA0Fjg,4014
35
- sinapsis_huggingface_transformers/src/sinapsis_huggingface_transformers/templates/pali_gemma/pali_gemma_base.py,sha256=rcmnEo2o_xm7wExWfJDD9b8KQy0cgd2VeUyGNG6t4Aw,5037
40
+ sinapsis_huggingface_transformers/src/sinapsis_huggingface_transformers/templates/pali_gemma/pali_gemma_base.py,sha256=18WkkpkfnPY39gpLRzgoISEkVxMgCXNOAhb9gumVO94,5104
36
41
  sinapsis_huggingface_transformers/src/sinapsis_huggingface_transformers/templates/pali_gemma/pali_gemma_detection.py,sha256=0bQB0rDU5foADo5IOe422UUJ1v6BZ3Q08esklwKOOQA,4210
37
42
  sinapsis_huggingface_transformers/src/sinapsis_huggingface_transformers/templates/pali_gemma/pali_gemma_inference.py,sha256=gC6RXqQi423uZr-GFpI_XzrRHjqMgJ7ry5MXC2-Y5N8,10894
38
43
  sinapsis_huggingface_transformers/src/sinapsis_huggingface_transformers/thirdparty/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
39
44
  sinapsis_huggingface_transformers/src/sinapsis_huggingface_transformers/thirdparty/helpers.py,sha256=IGeYd5U2xpimpwTQW_5xm1pUYB5tqHlpq-fjwBHI4gY,2187
40
- sinapsis_huggingface-0.2.12.dist-info/METADATA,sha256=6K09G3AfgWoygVQpT5w4P1Wz8b0hOZLlOId4pgTARdk,11401
41
- sinapsis_huggingface-0.2.12.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
42
- sinapsis_huggingface-0.2.12.dist-info/top_level.txt,sha256=ZxHwnMjSWRceQL_6-B7GJBPxQWdlwkba-SYMVufhj5s,133
43
- sinapsis_huggingface-0.2.12.dist-info/RECORD,,
45
+ sinapsis_huggingface-0.2.14.dist-info/METADATA,sha256=JYntG_I0McOEok0eENjgbeKcRvv2AA-O5h74fDVmiAA,12039
46
+ sinapsis_huggingface-0.2.14.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
47
+ sinapsis_huggingface-0.2.14.dist-info/top_level.txt,sha256=kb6h2cFbLt44Av6X418hZN7VYFbfBJCDpQGVETMvpvg,158
48
+ sinapsis_huggingface-0.2.14.dist-info/RECORD,,
@@ -1,4 +1,5 @@
1
1
  sinapsis_huggingface_diffusers
2
2
  sinapsis_huggingface_embeddings
3
3
  sinapsis_huggingface_grounding_dino
4
+ sinapsis_huggingface_hub
4
5
  sinapsis_huggingface_transformers
@@ -71,7 +71,7 @@ class BaseDiffusersAttributes(TemplateAttributes):
71
71
  Defaults to False.
72
72
  """
73
73
 
74
- model_path: str
74
+ model_path: Literal["stable-diffusion-v1-5/stable-diffusion-v1-5", "stabilityai/stable-diffusion-2-1", "CompVis/stable-diffusion-v1-4", "Qwen/Qwen-Image-Edit"] = "stable-diffusion-v1-5/stable-diffusion-v1-5"
75
75
  model_cache_dir: str = str(SINAPSIS_CACHE_DIR)
76
76
  device: Literal["cuda", "cpu"]
77
77
  torch_dtype: Literal["float16", "float32"] = "float16"
@@ -42,7 +42,7 @@ class GroundingBaseAttributes(TemplateAttributes):
42
42
  device (Literal["cuda", "cpu"]): Device to be used for inference.
43
43
  """
44
44
 
45
- model_path: str
45
+ model_path: Literal["IDEA-Research/grounding-dino-base"] = "IDEA-Research/grounding-dino-base"
46
46
  model_cache_dir: str = str(SINAPSIS_CACHE_DIR)
47
47
  inference_mode: Literal["object_detection", "zero_shot"]
48
48
  threshold: float = 0.25
@@ -0,0 +1,7 @@
1
+ # -*- coding: utf-8 -*-
2
+ from enum import Enum
3
+
4
+
5
+ class Tags(Enum):
6
+ HUGGINGFACE = "huggingface"
7
+ MODELS = "models"
@@ -0,0 +1,19 @@
1
+ # -*- coding: utf-8 -*-
2
+ import importlib
3
+ from typing import Callable
4
+
5
+ _root_lib_path = "sinapsis_huggingface_hub.templates"
6
+
7
+ _template_lookup = {
8
+ "HuggingFaceDownloader": f"{_root_lib_path}.huggingface_downloader",
9
+ }
10
+
11
+
12
+ def __getattr__(name: str) -> Callable:
13
+ if name in _template_lookup:
14
+ module = importlib.import_module(_template_lookup[name])
15
+ return getattr(module, name)
16
+ raise AttributeError(f"template `{name}` not found in {_root_lib_path}")
17
+
18
+
19
+ __all__ = list(_template_lookup.keys())
@@ -0,0 +1,71 @@
1
+ # -*- coding: utf-8 -*-
2
+
3
+ from typing import Literal
4
+
5
+ from huggingface_hub import snapshot_download
6
+ from pydantic import Field
7
+ from sinapsis_core.data_containers.data_packet import DataContainer
8
+ from sinapsis_core.template_base import Template
9
+ from sinapsis_core.template_base.base_models import TemplateAttributes, TemplateAttributeType, UIPropertiesMetadata
10
+ from sinapsis_core.utils.env_var_keys import SINAPSIS_CACHE_DIR
11
+ from sinapsis_huggingface_transformers.helpers.tags import Tags
12
+
13
+
14
+ class HuggingFaceDownloaderAttributes(TemplateAttributes):
15
+ """Defines the configuration for downloading a repository snapshot from the Hugging Face Hub.
16
+
17
+ Attributes:
18
+ repo_id (str): The repository ID from the Hub (e.g., "stabilityai/stable-diffusion-2-1").
19
+ repo_type (Literal["dataset", "space", "model"]): The type of the repository.
20
+ revision (str | None): The specific model version to use (e.g., a branch name, tag, or commit hash).
21
+ cache_dir (str): The directory where downloaded files will be cached.
22
+ allow_patterns (list[str] | str | None): A pattern or list of patterns to specify which files to download.
23
+ ignore_patterns (list[str] | str | None): A pattern or list of patterns to specify which files to ignore.
24
+ max_workers (int): The maximum number of threads to use for parallel downloads.
25
+ force_download (bool): If True, forces the repository to be re-downloaded even if it's already cached.
26
+ proxies (dict): A dictionary of proxy servers to use for the download.
27
+ local_files_only (bool): If True, the function will only look for the files in the cache and will not
28
+ access the network.
29
+ etag_timeout (float): The timeout in seconds for checking the ETag of the files.
30
+ resume_download (bool): If True, resumes an interrupted download.
31
+ """
32
+
33
+ repo_id: str
34
+ repo_type: Literal["dataset", "space", "model"] = "model"
35
+ revision: str | None = None
36
+ cache_dir: str = str(SINAPSIS_CACHE_DIR)
37
+ allow_patterns: list[str] | str | None = None
38
+ ignore_patterns: list[str] | str | None = None
39
+ max_workers: int = 8
40
+ force_download: bool = False
41
+ proxies: dict = Field(default_factory=dict)
42
+ local_files_only: bool = False
43
+ etag_timeout: float = 10.0
44
+ resume_download: bool = False
45
+
46
+
47
+ class HuggingFaceDownloader(Template):
48
+ """A Sinapsis Template that downloads a repository snapshot from the Hugging Face Hub."""
49
+
50
+ AttributesBaseModel = HuggingFaceDownloaderAttributes
51
+ UIProperties = UIPropertiesMetadata(
52
+ category="Hugging Face Hub",
53
+ tags=[Tags.HUGGINGFACE, Tags.MODELS],
54
+ )
55
+
56
+ def __init__(self, attributes: TemplateAttributeType) -> None:
57
+ super().__init__(attributes)
58
+ self.logger.info(f"Starting download of {self.attributes.repo_id} to {self.attributes.cache_dir}")
59
+ self.path = snapshot_download(**self.attributes.model_dump(exclude_none=True, exclude={"metadata"}))
60
+
61
+ def execute(self, container: DataContainer) -> DataContainer:
62
+ """Injects the local directory path of the downloaded repository into the data container.
63
+
64
+ Args:
65
+ container (DataContainer): The data container to which the directory path will be added.
66
+
67
+ Returns:
68
+ DataContainer: The updated data container, now containing the directory path.
69
+ """
70
+ self._set_generic_data(container, self.path)
71
+ return container
@@ -1,5 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
 
3
+ from typing import Literal
4
+
3
5
  import numpy as np
4
6
  from PIL import Image
5
7
  from pydantic import Field
@@ -40,6 +42,7 @@ class ImageToTextTransformersAttributes(TransformersBaseAttributes):
40
42
  such as `max_new_tokens`.
41
43
  """
42
44
 
45
+ model_path: Literal["Qwen/Qwen-Image"] = "Qwen/Qwen-Image"
43
46
  inference_kwargs: ImageToTextInferenceKwargs = Field(default_factory=ImageToTextInferenceKwargs)
44
47
 
45
48
 
@@ -33,7 +33,7 @@ class PaliGemmaBaseAttributes(TemplateAttributes):
33
33
  torch_dtype (Literal["float16", "float32"]): Model precision type. Defaults to float16.
34
34
  """
35
35
 
36
- model_path: str
36
+ model_path: Literal["google/paligemma2-3b-pt-224"] = "google/paligemma2-3b-pt-224"
37
37
  processor_path: str
38
38
  model_cache_dir: str = str(SINAPSIS_CACHE_DIR)
39
39
  device: Literal["cuda", "cpu"] = "cpu"
@@ -41,6 +41,7 @@ class SpeechToTextTransformersAttributes(TransformersBaseAttributes):
41
41
  such as `return_timestamps`.
42
42
  """
43
43
 
44
+ model_path: Literal["openai/whisper-small"] = "openai/whisper-small"
44
45
  inference_kwargs: SpeechToTextInferenceKwargs = Field(default_factory=SpeechToTextInferenceKwargs)
45
46
 
46
47
 
@@ -1,5 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
 
3
+ from typing import Literal
4
+
3
5
  from pydantic import Field
4
6
  from sinapsis_core.data_containers.data_packet import DataContainer
5
7
  from sinapsis_core.template_base.base_models import OutputTypes
@@ -40,6 +42,10 @@ class SummarizationTransformersAttributes(TransformersBaseAttributes):
40
42
  such as `clean_up_tokenization_spaces`.
41
43
  """
42
44
 
45
+ model_path: Literal[
46
+ "facebook/bart-large-cnn", "google/pegasus-xsum", "Falconsai/text_summarization", "facebook/bart-large-xsum"
47
+ ] = "facebook/bart-large-cnn"
48
+
43
49
  inference_kwargs: SummarizationInferenceKwargs = Field(default_factory=SummarizationInferenceKwargs)
44
50
 
45
51
 
@@ -1,4 +1,6 @@
1
1
  # -*- coding: utf-8 -*-
2
+ from typing import Literal
3
+
2
4
  import numpy as np
3
5
  import torch
4
6
  from sinapsis_core.data_containers.data_packet import AudioPacket, DataContainer, TextPacket
@@ -30,6 +32,8 @@ class TextToSpeechAttributes(TransformersBaseAttributes):
30
32
  based on punctuation.
31
33
  """
32
34
 
35
+ model_path: Literal["suno/bark", "suno/bark-small", "ResembleAI/chatterbox"] = "suno/bark"
36
+
33
37
  use_embeddings: bool = False
34
38
  sample_rate: int | None = None
35
39
  n_words: int | None = None