Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sinapsis_huggingface_embeddings-0.1.5.tar.gz (20.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sinapsis_huggingface_embeddings-0.1.5-py3-none-any.whl (21.6 kB view details)

Uploaded Python 3

File details

Details for the file sinapsis_huggingface_embeddings-0.1.5.tar.gz.

File metadata

File hashes

Hashes for sinapsis_huggingface_embeddings-0.1.5.tar.gz
Algorithm Hash digest
SHA256 a1fcaad6a943bab0861a9705e80ae812db75280990e5f3bbd039bf77f58d64f4
MD5 704330109bb81e422733b7a1853667b3
BLAKE2b-256 7715aa6c1e450d3316c7e500839ca636ea0b9c943e4d2d915c7a12f2c3f70ed8

See more details on using hashes here.

File details

Details for the file sinapsis_huggingface_embeddings-0.1.5-py3-none-any.whl.

File metadata

File hashes

Hashes for sinapsis_huggingface_embeddings-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 064f870acb9504a8bda4879a11e2a837fe5bc5c55708a0a6ba1500ef59a795c2
MD5 b4159211d83af39e8328909bef3ca7f3
BLAKE2b-256 70e897b3a58b6479d7576b2d7d64dd8d2fd37a1cb1f0dbe75db6ab053aa23fa3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page