Templates to generate and/or extract text and image embeddings using HuggingFace
Project description
Sinapsis Hugging Face Embeddings
Templates for seamless integration with Hugging Face embedding models
🐍 Installation • 📦 Features • 📦 Example usage • 📙 Documentation • 🔍 License
🐍 Installation
Install using your package manager of choice. We encourage the use of uv
Example with uv:
uv pip install sinapsis-huggingface-embeddings --extra-index-url https://pypi.sinapsis.tech
or with raw pip:
pip install sinapsis-huggingface-embeddings --extra-index-url https://pypi.sinapsis.tech
Change the name of the package for the one you want to install.
[!IMPORTANT] Templates in each package may require extra dependencies. For development, we recommend installing the package with all the optional dependencies:
with uv:
uv pip install sinapsis-huggingface-embeddings[all] --extra-index-url https://pypi.sinapsis.tech
or with raw pip:
pip install sinapsis-huggingface-embeddings[all] --extra-index-url https://pypi.sinapsis.tech
📦 Features
The templates in this package include multiple templates tailored for different embedding-based tasks:
- SpeakerEmbeddingFromAudio: Extracts speaker embeddings from audio data and attaches them to text or audio packets.
- SpeakerEmbeddingFromDataset: Retrieves speaker embeddings from Hugging Face datasets and integrates them into a DataContainer.
- HuggingFaceEmbeddingNodeGenerator: Generates text embeddings, splits documents into chunks, and processes them with metadata.
▶️ Example Usage
Below is an example YAML configuration for extracting speaker embeddings from an audio file and attaching them to text packets.
Config
agent:
name: embeddings_agent
templates:
- template_name: InputTemplate
class_name: InputTemplate
attributes: {}
- template_name: TextInput
class_name: TextInput
template_input: InputTemplate
attributes:
text: This is a test to check how the model works with a normal voice like mine.
- template_name: AudioReaderSoundfile
class_name: AudioReaderSoundfile
template_input: TextInput
attributes:
audio_file_path: test.mp3
- template_name: SpeakerEmbeddingFromAudio
class_name: SpeakerEmbeddingFromAudio
template_input: AudioReaderSoundfile
attributes:
target_packet: texts
[!IMPORTANT] The TextInput and AudioReaderSoundfile templates correspond to the sinapsis-data-readers package. If you want to use the example, please make sure you install this package.
To run the config, use the CLI:
sinapsis run name_of_config.yml
📙 Documentation
Documentation is available on the sinapsis website
Tutorials for different projects within sinapsis are available at sinapsis tutorials page
🔍 License
This project is licensed under the AGPLv3 license, which encourages open collaboration and sharing. For more details, please refer to the LICENSE file.
For commercial use, please refer to our official Sinapsis website for information on obtaining a commercial license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sinapsis_huggingface_embeddings-0.1.7.tar.gz.
File metadata
- Download URL: sinapsis_huggingface_embeddings-0.1.7.tar.gz
- Upload date:
- Size: 20.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
137b1eb7d14e142b4c8b59bb621ccab9eb5226966b3be2f92c577da70579bc49
|
|
| MD5 |
364f4cd8c9340e1fddd0492c22e4930d
|
|
| BLAKE2b-256 |
0e56bfe50cee757b5989e44fac9b9eb49d656e0215dcdc354651189418e28b04
|
File details
Details for the file sinapsis_huggingface_embeddings-0.1.7-py3-none-any.whl.
File metadata
- Download URL: sinapsis_huggingface_embeddings-0.1.7-py3-none-any.whl
- Upload date:
- Size: 21.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4eb29d6a739e1534d37a7bf8f3a5959409d9be458a7eeee1eddb78cebb7b0f3f
|
|
| MD5 |
ae5e99a788c515b7fcf5db5f72e78351
|
|
| BLAKE2b-256 |
6b71e51398581cf1498fea412b84ed672fc01af11d1af2214957184df025bb08
|