sinapsis-huggingface 0.2.0__tar.gz → 0.2.1__tar.gz

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 (45) hide show
  1. sinapsis_huggingface-0.2.1/PKG-INFO +297 -0
  2. sinapsis_huggingface-0.2.1/packages/sinapsis_huggingface.egg-info/PKG-INFO +297 -0
  3. {sinapsis_huggingface-0.2.0 → sinapsis_huggingface-0.2.1}/packages/sinapsis_huggingface.egg-info/requires.txt +1 -1
  4. {sinapsis_huggingface-0.2.0 → sinapsis_huggingface-0.2.1}/packages/sinapsis_huggingface_diffusers/src/sinapsis_huggingface_diffusers/templates/base_diffusers.py +2 -2
  5. {sinapsis_huggingface-0.2.0 → sinapsis_huggingface-0.2.1}/packages/sinapsis_huggingface_diffusers/src/sinapsis_huggingface_diffusers/templates/image_to_image_diffusers.py +1 -1
  6. {sinapsis_huggingface-0.2.0 → sinapsis_huggingface-0.2.1}/packages/sinapsis_huggingface_diffusers/src/sinapsis_huggingface_diffusers/templates/image_to_video_gen_xl_diffusers.py +1 -1
  7. {sinapsis_huggingface-0.2.0 → sinapsis_huggingface-0.2.1}/packages/sinapsis_huggingface_diffusers/src/sinapsis_huggingface_diffusers/templates/inpainting_diffusers.py +1 -1
  8. {sinapsis_huggingface-0.2.0 → sinapsis_huggingface-0.2.1}/packages/sinapsis_huggingface_embeddings/src/sinapsis_huggingface_embeddings/templates/hugging_face_embedding_extractor.py +2 -2
  9. {sinapsis_huggingface-0.2.0 → sinapsis_huggingface-0.2.1}/packages/sinapsis_huggingface_embeddings/src/sinapsis_huggingface_embeddings/templates/speaker_embedding_from_audio.py +2 -1
  10. {sinapsis_huggingface-0.2.0 → sinapsis_huggingface-0.2.1}/packages/sinapsis_huggingface_embeddings/src/sinapsis_huggingface_embeddings/templates/speaker_embedding_from_dataset.py +2 -4
  11. {sinapsis_huggingface-0.2.0 → sinapsis_huggingface-0.2.1}/packages/sinapsis_huggingface_grounding_dino/src/sinapsis_huggingface_grounding_dino/templates/grounding_dino.py +2 -1
  12. {sinapsis_huggingface-0.2.0 → sinapsis_huggingface-0.2.1}/packages/sinapsis_huggingface_grounding_dino/src/sinapsis_huggingface_grounding_dino/templates/grounding_dino_classification.py +0 -7
  13. {sinapsis_huggingface-0.2.0 → sinapsis_huggingface-0.2.1}/packages/sinapsis_huggingface_transformers/src/sinapsis_huggingface_transformers/templates/base_transformers.py +2 -2
  14. {sinapsis_huggingface-0.2.0 → sinapsis_huggingface-0.2.1}/packages/sinapsis_huggingface_transformers/src/sinapsis_huggingface_transformers/templates/image_to_text_transformers.py +1 -1
  15. {sinapsis_huggingface-0.2.0 → sinapsis_huggingface-0.2.1}/packages/sinapsis_huggingface_transformers/src/sinapsis_huggingface_transformers/templates/pali_gemma/pali_gemma_base.py +2 -2
  16. {sinapsis_huggingface-0.2.0 → sinapsis_huggingface-0.2.1}/packages/sinapsis_huggingface_transformers/src/sinapsis_huggingface_transformers/templates/pali_gemma/pali_gemma_detection.py +1 -1
  17. {sinapsis_huggingface-0.2.0 → sinapsis_huggingface-0.2.1}/packages/sinapsis_huggingface_transformers/src/sinapsis_huggingface_transformers/templates/pali_gemma/pali_gemma_inference.py +1 -1
  18. {sinapsis_huggingface-0.2.0 → sinapsis_huggingface-0.2.1}/packages/sinapsis_huggingface_transformers/src/sinapsis_huggingface_transformers/templates/speech_to_text_transformers.py +1 -1
  19. {sinapsis_huggingface-0.2.0 → sinapsis_huggingface-0.2.1}/packages/sinapsis_huggingface_transformers/src/sinapsis_huggingface_transformers/templates/summarization_transformers.py +1 -1
  20. {sinapsis_huggingface-0.2.0 → sinapsis_huggingface-0.2.1}/packages/sinapsis_huggingface_transformers/src/sinapsis_huggingface_transformers/templates/text_to_speech_transformers.py +1 -1
  21. {sinapsis_huggingface-0.2.0 → sinapsis_huggingface-0.2.1}/packages/sinapsis_huggingface_transformers/src/sinapsis_huggingface_transformers/templates/translation_transformers.py +1 -1
  22. {sinapsis_huggingface-0.2.0 → sinapsis_huggingface-0.2.1}/pyproject.toml +3 -3
  23. sinapsis_huggingface-0.2.0/PKG-INFO +0 -959
  24. sinapsis_huggingface-0.2.0/packages/sinapsis_huggingface.egg-info/PKG-INFO +0 -959
  25. {sinapsis_huggingface-0.2.0 → sinapsis_huggingface-0.2.1}/LICENSE +0 -0
  26. {sinapsis_huggingface-0.2.0 → sinapsis_huggingface-0.2.1}/README.md +0 -0
  27. {sinapsis_huggingface-0.2.0 → sinapsis_huggingface-0.2.1}/packages/sinapsis_huggingface.egg-info/SOURCES.txt +0 -0
  28. {sinapsis_huggingface-0.2.0 → sinapsis_huggingface-0.2.1}/packages/sinapsis_huggingface.egg-info/dependency_links.txt +0 -0
  29. {sinapsis_huggingface-0.2.0 → sinapsis_huggingface-0.2.1}/packages/sinapsis_huggingface.egg-info/top_level.txt +0 -0
  30. {sinapsis_huggingface-0.2.0 → sinapsis_huggingface-0.2.1}/packages/sinapsis_huggingface_diffusers/src/sinapsis_huggingface_diffusers/__init__.py +0 -0
  31. {sinapsis_huggingface-0.2.0 → sinapsis_huggingface-0.2.1}/packages/sinapsis_huggingface_diffusers/src/sinapsis_huggingface_diffusers/templates/__init__.py +0 -0
  32. {sinapsis_huggingface-0.2.0 → sinapsis_huggingface-0.2.1}/packages/sinapsis_huggingface_diffusers/src/sinapsis_huggingface_diffusers/templates/text_to_image_diffusers.py +0 -0
  33. {sinapsis_huggingface-0.2.0 → sinapsis_huggingface-0.2.1}/packages/sinapsis_huggingface_embeddings/src/sinapsis_huggingface_embeddings/__init__.py +0 -0
  34. {sinapsis_huggingface-0.2.0 → sinapsis_huggingface-0.2.1}/packages/sinapsis_huggingface_embeddings/src/sinapsis_huggingface_embeddings/templates/__init__.py +0 -0
  35. {sinapsis_huggingface-0.2.0 → sinapsis_huggingface-0.2.1}/packages/sinapsis_huggingface_grounding_dino/src/sinapsis_huggingface_grounding_dino/__init__.py +0 -0
  36. {sinapsis_huggingface-0.2.0 → sinapsis_huggingface-0.2.1}/packages/sinapsis_huggingface_grounding_dino/src/sinapsis_huggingface_grounding_dino/helpers/__init__.py +0 -0
  37. {sinapsis_huggingface-0.2.0 → sinapsis_huggingface-0.2.1}/packages/sinapsis_huggingface_grounding_dino/src/sinapsis_huggingface_grounding_dino/helpers/grounding_dino_keys.py +0 -0
  38. {sinapsis_huggingface-0.2.0 → sinapsis_huggingface-0.2.1}/packages/sinapsis_huggingface_grounding_dino/src/sinapsis_huggingface_grounding_dino/templates/__init__.py +0 -0
  39. {sinapsis_huggingface-0.2.0 → sinapsis_huggingface-0.2.1}/packages/sinapsis_huggingface_transformers/src/sinapsis_huggingface_transformers/__init__.py +0 -0
  40. {sinapsis_huggingface-0.2.0 → sinapsis_huggingface-0.2.1}/packages/sinapsis_huggingface_transformers/src/sinapsis_huggingface_transformers/helpers/__init__.py +0 -0
  41. {sinapsis_huggingface-0.2.0 → sinapsis_huggingface-0.2.1}/packages/sinapsis_huggingface_transformers/src/sinapsis_huggingface_transformers/helpers/text_to_sentences.py +0 -0
  42. {sinapsis_huggingface-0.2.0 → sinapsis_huggingface-0.2.1}/packages/sinapsis_huggingface_transformers/src/sinapsis_huggingface_transformers/templates/__init__.py +0 -0
  43. {sinapsis_huggingface-0.2.0 → sinapsis_huggingface-0.2.1}/packages/sinapsis_huggingface_transformers/src/sinapsis_huggingface_transformers/thirdparty/__init__.py +0 -0
  44. {sinapsis_huggingface-0.2.0 → sinapsis_huggingface-0.2.1}/packages/sinapsis_huggingface_transformers/src/sinapsis_huggingface_transformers/thirdparty/helpers.py +0 -0
  45. {sinapsis_huggingface-0.2.0 → sinapsis_huggingface-0.2.1}/setup.cfg +0 -0
@@ -0,0 +1,297 @@
1
+ Metadata-Version: 2.4
2
+ Name: sinapsis-huggingface
3
+ Version: 0.2.1
4
+ Summary: Package for HuggingFace-based templates
5
+ Author-email: SinapsisAI <dev@sinapsis.tech>
6
+ Project-URL: Homepage, https://sinapsis.tech
7
+ Project-URL: Documentation, https://docs.sinapsis.tech/docs
8
+ Project-URL: Tutorials, https://docs.sinapsis.tech/tutorials
9
+ Project-URL: Repository, https://github.com/Sinapsis-AI/sinapsis-huggingface.git
10
+ Requires-Python: >=3.10
11
+ Description-Content-Type: text/markdown
12
+ License-File: LICENSE
13
+ Requires-Dist: sinapsis>=0.1.1
14
+ Provides-Extra: gradio-app
15
+ Requires-Dist: sinapsis-data-readers[opencv]>=0.1.0; extra == "gradio-app"
16
+ Requires-Dist: sinapsis-data-visualization[visualization-matplotlib]>=0.1.0; extra == "gradio-app"
17
+ Requires-Dist: sinapsis-huggingface-diffusers[all]; extra == "gradio-app"
18
+ Requires-Dist: sinapsis-huggingface-grounding-dino; extra == "gradio-app"
19
+ Requires-Dist: sinapsis-ultralytics>=0.1.0; extra == "gradio-app"
20
+ Requires-Dist: sinapsis[webapp]>=0.2.7; extra == "gradio-app"
21
+ Provides-Extra: all
22
+ Requires-Dist: sinapsis-huggingface-diffusers[all]; extra == "all"
23
+ Requires-Dist: sinapsis-huggingface-embeddings; extra == "all"
24
+ Requires-Dist: sinapsis-huggingface-grounding-dino; extra == "all"
25
+ Requires-Dist: sinapsis-huggingface-transformers; extra == "all"
26
+ Requires-Dist: sinapsis-huggingface[gradio-app,sinapsis-data-writers]; extra == "all"
27
+ Provides-Extra: sinapsis-data-writers
28
+ Requires-Dist: sinapsis-data-writers>=0.1.0; extra == "sinapsis-data-writers"
29
+ Dynamic: license-file
30
+
31
+ <h1 align="center">
32
+ <br>
33
+ <br>
34
+ <a href="https://sinapsis.tech/">
35
+ <img
36
+ src="https://github.com/Sinapsis-AI/brand-resources/blob/main/sinapsis_logo/4x/logo.png?raw=true"
37
+ alt="" width="300">
38
+ </a>
39
+ <br>
40
+ Sinapsis Hugging Face
41
+ <br>
42
+ </h1>
43
+
44
+ <h4 align="center">Package providing seamless integration with Hugging Face models, specializing in zero-shot object detection, classification, segmentation, generative workflows, and embeddings. It leverages state-of-the-art tools like Grounding DINO, Hugging Face Diffusers, and Transformers, enabling efficient implementation and customization.</h4>
45
+
46
+ <p align="center">
47
+ <a href="#installation">🐍 Installation</a> •
48
+ <a href="#packages">📦 Packages</a> •
49
+ <a href="#webapps">🌐 Webapps</a> •
50
+ <a href="#webapps">📙 Documentation</a> •
51
+ <a href="#packages">🔍 License</a>
52
+ </p>
53
+
54
+
55
+ <h2 id="installation">🐍 Installation</h2>
56
+
57
+ This repo consists of different packages to handle huggingface tools for different tasks:
58
+
59
+ * <code>sinapsis-huggingface-diffusers</code>
60
+ * <code>sinapsis-huggingface-embeddings</code>
61
+ * <code>sinapsis-huggingface-grounding-dino</code>
62
+ * <code>sinapsis-huggingface-transformers</code>
63
+
64
+ Install using your package manager of choice. We encourage the use of <code>uv</code>
65
+
66
+ Example with <code>uv</code>:
67
+
68
+ ```bash
69
+ uv pip install sinapsis-huggingface-diffusers --extra-index-url https://pypi.sinapsis.tech
70
+ ```
71
+ or with raw <code>pip</code>:
72
+ ```bash
73
+ pip install sinapsis-huggingface-diffusers --extra-index-url https://pypi.sinapsis.tech
74
+ ```
75
+
76
+
77
+ Change the name of the package for the one you want to install.
78
+
79
+ > [!IMPORTANT]
80
+ > Templates in each package may require extra dependencies. For development, we recommend installing the package with all the optional dependencies:
81
+ >
82
+ with <code>uv</code>:
83
+
84
+ ```bash
85
+ uv pip install sinapsis-huggingface-diffusers[all] --extra-index-url https://pypi.sinapsis.tech
86
+ ```
87
+ or with raw <code>pip</code>:
88
+ ```bash
89
+ pip install sinapsis-huggingface-diffusers[all] --extra-index-url https://pypi.sinapsis.tech
90
+ ```
91
+ Change the name of the package accordingly
92
+
93
+ > [!TIP]
94
+ > You can also install all the packages within this project:
95
+
96
+ ```bash
97
+ uv pip install sinapsis-huggingface[all] --extra-index-url https://pypi.sinapsis.tech
98
+ ```
99
+
100
+ <h2 id="packages">📦 Packages</h2>
101
+
102
+ This repository is structured into modular packages, each designed for specific Hugging Face model integrations. These packages provide ready-to-use templates for tasks like text generation, embeddings, object detection, and diffusion-based image processing.
103
+
104
+ Each package can be used independently or combined to create more complex workflows. Below is an overview of the available packages:
105
+ <details>
106
+ <summary id="uv"><strong><span style="font-size: 1.4em;">Sinapsis Hugging Face Diffusers</span></strong></summary>
107
+
108
+ This sinapsis package provides a powerful and flexible implementation of Hugging Face's diffusers library. It includes:
109
+
110
+ - Templates for tasks like **text-to-image**, **image-to-image**, **inpainting**, and **image-to-video generation**.
111
+ - Support for state-of-the-art models like **Stable Diffusion** and other diffusion-based architectures.
112
+ - Robust pipelines for generating and transforming visual content.
113
+
114
+ For specific instructions and further details, see the [README.md](https://github.com/Sinapsis-AI/sinapsis-huggingface/blob/main/packages/sinapsis_huggingface_diffusers/README.md).
115
+ </details>
116
+ <details>
117
+ <summary id="uv"><strong><span style="font-size: 1.4em;">Sinapsis Hugging Face Embeddings</span></strong></summary>
118
+
119
+ This package provides templates for generating and managing embeddings using Hugging Face models:
120
+
121
+ - **Speaker Embeddings**: Extract embeddings from audio packets or pre-defined Hugging Face datasets and attach them to audio or text packets.
122
+ - **Text Embeddings**: Generate embeddings for documents, with support for customizable chunking and metadata handling.
123
+
124
+ For more details, see the [README.md](https://github.com/Sinapsis-AI/sinapsis-huggingface/blob/main/packages/sinapsis_huggingface_embeddings/README.md).
125
+
126
+ </details>
127
+ <details>
128
+ <summary id="uv"><strong><span style="font-size: 1.4em;">Sinapsis Hugging Face Grounding DINO</span></strong></summary>
129
+
130
+ This sinapsis package provides **zero-shot detection and classification** capabilities using Hugging Face's Grounding DINO. It includes:
131
+
132
+ - Ready-to-use inference templates for object detection tasks and classification pipelines.
133
+ - Template for fine-tuning Grounding DINO checkpoints on specific datasets.
134
+
135
+ For detailed instructions and additional information, see the [README.md](https://github.com/Sinapsis-AI/sinapsis-huggingface/blob/main/packages/sinapsis_huggingface_grounding_dino/README.md).
136
+
137
+
138
+ </details>
139
+ <details>
140
+ <summary id="uv"><strong><span style="font-size: 1.4em;">Sinapsis Hugging Face Transformers</span></strong></summary>
141
+
142
+ This sinapsis package offers advanced capabilities for **text, speech, and image processing tasks**. It includes a variety of customizable inference templates designed for seamless integration into machine learning workflows:
143
+
144
+ - **Text-to-Speech (TTS) Template**: Convert text into high-quality, natural-sounding speech.
145
+ - **Speech-to-Text (STT) Template**: Transcribe spoken audio into text with support for multiple languages.
146
+ - **Translation Template**: Translate text from one language to another with support for various source and target languages.
147
+ - **Summarization Template**: Condense long-form content into concise summaries.
148
+ - **Image-to-Text Template**: Generate textual descriptions from input images.
149
+
150
+ For more details and specific templates, see the [README.md](https://github.com/Sinapsis-AI/sinapsis-huggingface/blob/main/packages/sinapsis_huggingface_transformers/README.md).
151
+
152
+ </details>
153
+
154
+ For more details, see the [official documentation](https://docs.sinapsis.tech/docs)
155
+
156
+ <h2 id="webapps">🌐 Webapps</h2>
157
+
158
+ The **Sinapsis web applications** provide an interactive way to explore and experiment with AI models. They allow users to generate outputs, test different inputs, and visualize results in real time, making it easy to experience the capabilities of each model. Below are the available webapps and instructions to launch them.
159
+
160
+ > [!IMPORTANT]
161
+ > To run any of the apps, you first need to clone this repo:
162
+
163
+ ```bash
164
+ git clone git@github.com:Sinapsis-ai/sinapsis-huggingface.git
165
+ cd sinapsis-huggingface
166
+ ```
167
+
168
+ > [!NOTE]
169
+ > If you'd like to enable external app sharing in Gradio, `export GRADIO_SHARE_APP=True`
170
+
171
+ > [!NOTE]
172
+ > Agent configuration can be changed through the AGENT_CONFIG_PATH env var. You can check the available configurations in each package configs folder.
173
+
174
+ > [!IMPORTANT]
175
+ > Please make sure you have a valid huggingface access token in order to run the paligemma webapp. For further instructions on how to create an access token see
176
+ https://huggingface.co/docs/transformers.js/en/guides/private
177
+
178
+
179
+
180
+
181
+ <details>
182
+ <summary id="docker"><strong><span style="font-size: 1.4em;">🐳 Build with Docker</span></strong></summary>
183
+
184
+ **IMPORTANT** The docker image depends on the sinapsis-nvidia:base image. To build it, refer to the [official sinapsis documentation](https://github.com/Sinapsis-AI/sinapsis/blob/main/README.md#docker)
185
+
186
+
187
+ 1. **Build the sinapsis-huggingface image**:
188
+ ```bash
189
+ docker compose -f docker/compose.yaml build
190
+ ```
191
+ 2. **Start the container**:
192
+
193
+ For Diffusers app
194
+ ```bash
195
+ docker compose -f docker/compose_diffusers.yaml up sinapsis-huggingface-diffusers-gradio -d
196
+ ```
197
+ For Grounding-Dino app
198
+ ```bash
199
+ docker compose -f docker/compose_vision.yaml up sinapsis-huggingface-vision-gradio -d
200
+ ```
201
+ For Paligemma app
202
+
203
+ ```bash
204
+ export HF_TOKEN="your_huggingface_token"
205
+ docker compose -f docker/compose_pali_gemma.yaml up sinapsis-huggingface-paligemma-gradio -d
206
+ ```
207
+ 3. **Check the status**:
208
+
209
+ For Diffusers app
210
+ ```bash
211
+ docker logs -f sinapsis-huggingface-diffusers-gradio
212
+ ```
213
+ For Grounding-Dino app
214
+ ```bash
215
+ docker logs -f sinapsis-huggingface-vision-gradio
216
+ ```
217
+ For Paligemma app
218
+ ```bash
219
+ docker logs -f sinapsis-huggingface-paligemma-gradio
220
+ ```
221
+ **NOTE**: If using the vision app, please change the name of the service accordingly
222
+
223
+ 4. **The logs will display the URL to access the webapp, e.g.,**:
224
+ ```bash
225
+ Running on local URL: http://127.0.0.1:7860
226
+ ```
227
+ **NOTE**: The local URL can be different, please check the logs
228
+
229
+ 5. **To stop the app**:
230
+
231
+ For Diffusers app
232
+ ```bash
233
+ docker compose -f docker/compose_diffusers.yaml down
234
+ ```
235
+ For Grounding-Dino app
236
+ ```bash
237
+ docker compose -f docker/compose_vision.yaml down
238
+ ```
239
+ For Paligemma app
240
+ ```bash
241
+ docker compose -f docker/compose_pali_gemma.yaml down
242
+ ```
243
+ </details>
244
+
245
+ <details>
246
+ <summary id="uv"><strong><span style="font-size: 1.4em;">📦 UV</span></strong></summary>
247
+
248
+ 1. Create the virtual environment and sync the dependencies:
249
+
250
+ ```bash
251
+ uv sync --frozen
252
+ ```
253
+
254
+ 2. Install the dependencies:
255
+
256
+ ```bash
257
+ uv pip install sinapsis-huggingface[all] --extra-index-url https://pypi.sinapsis.tech
258
+ ```
259
+ 3. Run the webapp.
260
+
261
+ For Diffusers app
262
+ ```bash
263
+ uv run webapps/diffusers_demo.py
264
+ ```
265
+ For Grounding-Dino app
266
+ ```bash
267
+ uv run webapps/vision_demo.py
268
+ ```
269
+ For Paligemma app
270
+ ```bash
271
+ export HF_TOKEN="your_huggingface_token"
272
+ uv run webapps/paligemma_demo.py
273
+ ```
274
+
275
+ 4. The terminal will display the URL to access the webapp, e.g., :
276
+ ```bash
277
+ Running on local URL: http://127.0.0.1:7860
278
+ ```
279
+
280
+ </details>
281
+
282
+
283
+ <h2 id="documentation">📙 Documentation</h2>
284
+
285
+ Documentation is available on the [sinapsis website](https://docs.sinapsis.tech/docs)
286
+
287
+ Tutorials for different projects within sinapsis are available at [sinapsis tutorials page](https://docs.sinapsis.tech/tutorials)
288
+
289
+ <h2 id="license">🔍 License</h2>
290
+
291
+ This project is licensed under the AGPLv3 license, which encourages open collaboration and sharing. For more details, please refer to the [LICENSE](LICENSE) file.
292
+
293
+ For commercial use, please refer to our [official Sinapsis website](https://sinapsis.tech) for information on obtaining a commercial license.
294
+
295
+
296
+
297
+
@@ -0,0 +1,297 @@
1
+ Metadata-Version: 2.4
2
+ Name: sinapsis-huggingface
3
+ Version: 0.2.1
4
+ Summary: Package for HuggingFace-based templates
5
+ Author-email: SinapsisAI <dev@sinapsis.tech>
6
+ Project-URL: Homepage, https://sinapsis.tech
7
+ Project-URL: Documentation, https://docs.sinapsis.tech/docs
8
+ Project-URL: Tutorials, https://docs.sinapsis.tech/tutorials
9
+ Project-URL: Repository, https://github.com/Sinapsis-AI/sinapsis-huggingface.git
10
+ Requires-Python: >=3.10
11
+ Description-Content-Type: text/markdown
12
+ License-File: LICENSE
13
+ Requires-Dist: sinapsis>=0.1.1
14
+ Provides-Extra: gradio-app
15
+ Requires-Dist: sinapsis-data-readers[opencv]>=0.1.0; extra == "gradio-app"
16
+ Requires-Dist: sinapsis-data-visualization[visualization-matplotlib]>=0.1.0; extra == "gradio-app"
17
+ Requires-Dist: sinapsis-huggingface-diffusers[all]; extra == "gradio-app"
18
+ Requires-Dist: sinapsis-huggingface-grounding-dino; extra == "gradio-app"
19
+ Requires-Dist: sinapsis-ultralytics>=0.1.0; extra == "gradio-app"
20
+ Requires-Dist: sinapsis[webapp]>=0.2.7; extra == "gradio-app"
21
+ Provides-Extra: all
22
+ Requires-Dist: sinapsis-huggingface-diffusers[all]; extra == "all"
23
+ Requires-Dist: sinapsis-huggingface-embeddings; extra == "all"
24
+ Requires-Dist: sinapsis-huggingface-grounding-dino; extra == "all"
25
+ Requires-Dist: sinapsis-huggingface-transformers; extra == "all"
26
+ Requires-Dist: sinapsis-huggingface[gradio-app,sinapsis-data-writers]; extra == "all"
27
+ Provides-Extra: sinapsis-data-writers
28
+ Requires-Dist: sinapsis-data-writers>=0.1.0; extra == "sinapsis-data-writers"
29
+ Dynamic: license-file
30
+
31
+ <h1 align="center">
32
+ <br>
33
+ <br>
34
+ <a href="https://sinapsis.tech/">
35
+ <img
36
+ src="https://github.com/Sinapsis-AI/brand-resources/blob/main/sinapsis_logo/4x/logo.png?raw=true"
37
+ alt="" width="300">
38
+ </a>
39
+ <br>
40
+ Sinapsis Hugging Face
41
+ <br>
42
+ </h1>
43
+
44
+ <h4 align="center">Package providing seamless integration with Hugging Face models, specializing in zero-shot object detection, classification, segmentation, generative workflows, and embeddings. It leverages state-of-the-art tools like Grounding DINO, Hugging Face Diffusers, and Transformers, enabling efficient implementation and customization.</h4>
45
+
46
+ <p align="center">
47
+ <a href="#installation">🐍 Installation</a> •
48
+ <a href="#packages">📦 Packages</a> •
49
+ <a href="#webapps">🌐 Webapps</a> •
50
+ <a href="#webapps">📙 Documentation</a> •
51
+ <a href="#packages">🔍 License</a>
52
+ </p>
53
+
54
+
55
+ <h2 id="installation">🐍 Installation</h2>
56
+
57
+ This repo consists of different packages to handle huggingface tools for different tasks:
58
+
59
+ * <code>sinapsis-huggingface-diffusers</code>
60
+ * <code>sinapsis-huggingface-embeddings</code>
61
+ * <code>sinapsis-huggingface-grounding-dino</code>
62
+ * <code>sinapsis-huggingface-transformers</code>
63
+
64
+ Install using your package manager of choice. We encourage the use of <code>uv</code>
65
+
66
+ Example with <code>uv</code>:
67
+
68
+ ```bash
69
+ uv pip install sinapsis-huggingface-diffusers --extra-index-url https://pypi.sinapsis.tech
70
+ ```
71
+ or with raw <code>pip</code>:
72
+ ```bash
73
+ pip install sinapsis-huggingface-diffusers --extra-index-url https://pypi.sinapsis.tech
74
+ ```
75
+
76
+
77
+ Change the name of the package for the one you want to install.
78
+
79
+ > [!IMPORTANT]
80
+ > Templates in each package may require extra dependencies. For development, we recommend installing the package with all the optional dependencies:
81
+ >
82
+ with <code>uv</code>:
83
+
84
+ ```bash
85
+ uv pip install sinapsis-huggingface-diffusers[all] --extra-index-url https://pypi.sinapsis.tech
86
+ ```
87
+ or with raw <code>pip</code>:
88
+ ```bash
89
+ pip install sinapsis-huggingface-diffusers[all] --extra-index-url https://pypi.sinapsis.tech
90
+ ```
91
+ Change the name of the package accordingly
92
+
93
+ > [!TIP]
94
+ > You can also install all the packages within this project:
95
+
96
+ ```bash
97
+ uv pip install sinapsis-huggingface[all] --extra-index-url https://pypi.sinapsis.tech
98
+ ```
99
+
100
+ <h2 id="packages">📦 Packages</h2>
101
+
102
+ This repository is structured into modular packages, each designed for specific Hugging Face model integrations. These packages provide ready-to-use templates for tasks like text generation, embeddings, object detection, and diffusion-based image processing.
103
+
104
+ Each package can be used independently or combined to create more complex workflows. Below is an overview of the available packages:
105
+ <details>
106
+ <summary id="uv"><strong><span style="font-size: 1.4em;">Sinapsis Hugging Face Diffusers</span></strong></summary>
107
+
108
+ This sinapsis package provides a powerful and flexible implementation of Hugging Face's diffusers library. It includes:
109
+
110
+ - Templates for tasks like **text-to-image**, **image-to-image**, **inpainting**, and **image-to-video generation**.
111
+ - Support for state-of-the-art models like **Stable Diffusion** and other diffusion-based architectures.
112
+ - Robust pipelines for generating and transforming visual content.
113
+
114
+ For specific instructions and further details, see the [README.md](https://github.com/Sinapsis-AI/sinapsis-huggingface/blob/main/packages/sinapsis_huggingface_diffusers/README.md).
115
+ </details>
116
+ <details>
117
+ <summary id="uv"><strong><span style="font-size: 1.4em;">Sinapsis Hugging Face Embeddings</span></strong></summary>
118
+
119
+ This package provides templates for generating and managing embeddings using Hugging Face models:
120
+
121
+ - **Speaker Embeddings**: Extract embeddings from audio packets or pre-defined Hugging Face datasets and attach them to audio or text packets.
122
+ - **Text Embeddings**: Generate embeddings for documents, with support for customizable chunking and metadata handling.
123
+
124
+ For more details, see the [README.md](https://github.com/Sinapsis-AI/sinapsis-huggingface/blob/main/packages/sinapsis_huggingface_embeddings/README.md).
125
+
126
+ </details>
127
+ <details>
128
+ <summary id="uv"><strong><span style="font-size: 1.4em;">Sinapsis Hugging Face Grounding DINO</span></strong></summary>
129
+
130
+ This sinapsis package provides **zero-shot detection and classification** capabilities using Hugging Face's Grounding DINO. It includes:
131
+
132
+ - Ready-to-use inference templates for object detection tasks and classification pipelines.
133
+ - Template for fine-tuning Grounding DINO checkpoints on specific datasets.
134
+
135
+ For detailed instructions and additional information, see the [README.md](https://github.com/Sinapsis-AI/sinapsis-huggingface/blob/main/packages/sinapsis_huggingface_grounding_dino/README.md).
136
+
137
+
138
+ </details>
139
+ <details>
140
+ <summary id="uv"><strong><span style="font-size: 1.4em;">Sinapsis Hugging Face Transformers</span></strong></summary>
141
+
142
+ This sinapsis package offers advanced capabilities for **text, speech, and image processing tasks**. It includes a variety of customizable inference templates designed for seamless integration into machine learning workflows:
143
+
144
+ - **Text-to-Speech (TTS) Template**: Convert text into high-quality, natural-sounding speech.
145
+ - **Speech-to-Text (STT) Template**: Transcribe spoken audio into text with support for multiple languages.
146
+ - **Translation Template**: Translate text from one language to another with support for various source and target languages.
147
+ - **Summarization Template**: Condense long-form content into concise summaries.
148
+ - **Image-to-Text Template**: Generate textual descriptions from input images.
149
+
150
+ For more details and specific templates, see the [README.md](https://github.com/Sinapsis-AI/sinapsis-huggingface/blob/main/packages/sinapsis_huggingface_transformers/README.md).
151
+
152
+ </details>
153
+
154
+ For more details, see the [official documentation](https://docs.sinapsis.tech/docs)
155
+
156
+ <h2 id="webapps">🌐 Webapps</h2>
157
+
158
+ The **Sinapsis web applications** provide an interactive way to explore and experiment with AI models. They allow users to generate outputs, test different inputs, and visualize results in real time, making it easy to experience the capabilities of each model. Below are the available webapps and instructions to launch them.
159
+
160
+ > [!IMPORTANT]
161
+ > To run any of the apps, you first need to clone this repo:
162
+
163
+ ```bash
164
+ git clone git@github.com:Sinapsis-ai/sinapsis-huggingface.git
165
+ cd sinapsis-huggingface
166
+ ```
167
+
168
+ > [!NOTE]
169
+ > If you'd like to enable external app sharing in Gradio, `export GRADIO_SHARE_APP=True`
170
+
171
+ > [!NOTE]
172
+ > Agent configuration can be changed through the AGENT_CONFIG_PATH env var. You can check the available configurations in each package configs folder.
173
+
174
+ > [!IMPORTANT]
175
+ > Please make sure you have a valid huggingface access token in order to run the paligemma webapp. For further instructions on how to create an access token see
176
+ https://huggingface.co/docs/transformers.js/en/guides/private
177
+
178
+
179
+
180
+
181
+ <details>
182
+ <summary id="docker"><strong><span style="font-size: 1.4em;">🐳 Build with Docker</span></strong></summary>
183
+
184
+ **IMPORTANT** The docker image depends on the sinapsis-nvidia:base image. To build it, refer to the [official sinapsis documentation](https://github.com/Sinapsis-AI/sinapsis/blob/main/README.md#docker)
185
+
186
+
187
+ 1. **Build the sinapsis-huggingface image**:
188
+ ```bash
189
+ docker compose -f docker/compose.yaml build
190
+ ```
191
+ 2. **Start the container**:
192
+
193
+ For Diffusers app
194
+ ```bash
195
+ docker compose -f docker/compose_diffusers.yaml up sinapsis-huggingface-diffusers-gradio -d
196
+ ```
197
+ For Grounding-Dino app
198
+ ```bash
199
+ docker compose -f docker/compose_vision.yaml up sinapsis-huggingface-vision-gradio -d
200
+ ```
201
+ For Paligemma app
202
+
203
+ ```bash
204
+ export HF_TOKEN="your_huggingface_token"
205
+ docker compose -f docker/compose_pali_gemma.yaml up sinapsis-huggingface-paligemma-gradio -d
206
+ ```
207
+ 3. **Check the status**:
208
+
209
+ For Diffusers app
210
+ ```bash
211
+ docker logs -f sinapsis-huggingface-diffusers-gradio
212
+ ```
213
+ For Grounding-Dino app
214
+ ```bash
215
+ docker logs -f sinapsis-huggingface-vision-gradio
216
+ ```
217
+ For Paligemma app
218
+ ```bash
219
+ docker logs -f sinapsis-huggingface-paligemma-gradio
220
+ ```
221
+ **NOTE**: If using the vision app, please change the name of the service accordingly
222
+
223
+ 4. **The logs will display the URL to access the webapp, e.g.,**:
224
+ ```bash
225
+ Running on local URL: http://127.0.0.1:7860
226
+ ```
227
+ **NOTE**: The local URL can be different, please check the logs
228
+
229
+ 5. **To stop the app**:
230
+
231
+ For Diffusers app
232
+ ```bash
233
+ docker compose -f docker/compose_diffusers.yaml down
234
+ ```
235
+ For Grounding-Dino app
236
+ ```bash
237
+ docker compose -f docker/compose_vision.yaml down
238
+ ```
239
+ For Paligemma app
240
+ ```bash
241
+ docker compose -f docker/compose_pali_gemma.yaml down
242
+ ```
243
+ </details>
244
+
245
+ <details>
246
+ <summary id="uv"><strong><span style="font-size: 1.4em;">📦 UV</span></strong></summary>
247
+
248
+ 1. Create the virtual environment and sync the dependencies:
249
+
250
+ ```bash
251
+ uv sync --frozen
252
+ ```
253
+
254
+ 2. Install the dependencies:
255
+
256
+ ```bash
257
+ uv pip install sinapsis-huggingface[all] --extra-index-url https://pypi.sinapsis.tech
258
+ ```
259
+ 3. Run the webapp.
260
+
261
+ For Diffusers app
262
+ ```bash
263
+ uv run webapps/diffusers_demo.py
264
+ ```
265
+ For Grounding-Dino app
266
+ ```bash
267
+ uv run webapps/vision_demo.py
268
+ ```
269
+ For Paligemma app
270
+ ```bash
271
+ export HF_TOKEN="your_huggingface_token"
272
+ uv run webapps/paligemma_demo.py
273
+ ```
274
+
275
+ 4. The terminal will display the URL to access the webapp, e.g., :
276
+ ```bash
277
+ Running on local URL: http://127.0.0.1:7860
278
+ ```
279
+
280
+ </details>
281
+
282
+
283
+ <h2 id="documentation">📙 Documentation</h2>
284
+
285
+ Documentation is available on the [sinapsis website](https://docs.sinapsis.tech/docs)
286
+
287
+ Tutorials for different projects within sinapsis are available at [sinapsis tutorials page](https://docs.sinapsis.tech/tutorials)
288
+
289
+ <h2 id="license">🔍 License</h2>
290
+
291
+ This project is licensed under the AGPLv3 license, which encourages open collaboration and sharing. For more details, please refer to the [LICENSE](LICENSE) file.
292
+
293
+ For commercial use, please refer to our [official Sinapsis website](https://sinapsis.tech) for information on obtaining a commercial license.
294
+
295
+
296
+
297
+
@@ -8,12 +8,12 @@ sinapsis-huggingface-transformers
8
8
  sinapsis-huggingface[gradio-app,sinapsis-data-writers]
9
9
 
10
10
  [gradio-app]
11
- gradio==5.3.0
12
11
  sinapsis-data-readers[opencv]>=0.1.0
13
12
  sinapsis-data-visualization[visualization-matplotlib]>=0.1.0
14
13
  sinapsis-huggingface-diffusers[all]
15
14
  sinapsis-huggingface-grounding-dino
16
15
  sinapsis-ultralytics>=0.1.0
16
+ sinapsis[webapp]>=0.2.7
17
17
 
18
18
  [sinapsis-data-writers]
19
19
  sinapsis-data-writers>=0.1.0
@@ -9,8 +9,8 @@ import torch
9
9
  from diffusers import DiffusionPipeline
10
10
  from pydantic import BaseModel, ConfigDict
11
11
  from sinapsis_core.data_containers.data_packet import DataContainer, ImagePacket
12
- from sinapsis_core.template_base import (
13
- Template,
12
+ from sinapsis_core.template_base import Template
13
+ from sinapsis_core.template_base.base_models import (
14
14
  TemplateAttributes,
15
15
  TemplateAttributeType,
16
16
  )
@@ -8,7 +8,7 @@ import numpy as np
8
8
  from diffusers import AutoPipelineForImage2Image
9
9
  from PIL import Image
10
10
  from sinapsis_core.data_containers.data_packet import DataContainer, ImagePacket
11
- from sinapsis_core.template_base.template import TemplateAttributeType
11
+ from sinapsis_core.template_base.base_models import TemplateAttributeType
12
12
 
13
13
  from sinapsis_huggingface_diffusers.templates.base_diffusers import BaseDiffusers
14
14
 
@@ -1,7 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
 
3
3
  from diffusers import I2VGenXLPipeline
4
- from sinapsis_core.template_base.template import TemplateAttributeType
4
+ from sinapsis_core.template_base.base_models import TemplateAttributeType
5
5
 
6
6
  from sinapsis_huggingface_diffusers.templates.image_to_image_diffusers import (
7
7
  ImageToImageDiffusers,
@@ -7,7 +7,7 @@ import cv2
7
7
  import numpy as np
8
8
  from diffusers import AutoPipelineForInpainting
9
9
  from sinapsis_core.data_containers.data_packet import ImageAnnotations, ImagePacket
10
- from sinapsis_core.template_base.template import TemplateAttributeType
10
+ from sinapsis_core.template_base.base_models import TemplateAttributeType
11
11
 
12
12
  from sinapsis_huggingface_diffusers.templates.base_diffusers import (
13
13
  BaseDiffusersAttributes,
@@ -4,8 +4,8 @@ from llama_index.core.base.embeddings.base import Embedding
4
4
  from llama_index.core.schema import TextNode
5
5
  from llama_index.embeddings.huggingface import HuggingFaceEmbedding
6
6
  from sinapsis_core.data_containers.data_packet import DataContainer
7
- from sinapsis_core.template_base import (
8
- Template,
7
+ from sinapsis_core.template_base import Template
8
+ from sinapsis_core.template_base.base_models import (
9
9
  TemplateAttributes,
10
10
  TemplateAttributeType,
11
11
  )
@@ -8,7 +8,8 @@ import torch
8
8
  import torch.nn.functional as F
9
9
  import torchaudio
10
10
  from sinapsis_core.data_containers.data_packet import AudioPacket, DataContainer
11
- from sinapsis_core.template_base import Template, TemplateAttributes, TemplateAttributeType
11
+ from sinapsis_core.template_base import Template
12
+ from sinapsis_core.template_base.base_models import TemplateAttributes, TemplateAttributeType
12
13
  from sinapsis_core.utils.env_var_keys import SINAPSIS_CACHE_DIR
13
14
  from speechbrain.inference.speaker import EncoderClassifier
14
15