Skip to main content
[![sp](https://img.shields.io/badge/lang-sp-red.svg)](https://github.com/Sinapsis-AI/sinapsis-huggingface/blob/main/README.es.md)




Sinapsis Hugging Face Transformers

Templates for seamless integration with Transformers 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-transformers --extra-index-url https://pypi.sinapsis.tech

or with raw pip:

  pip install sinapsis-huggingface-transformers --extra-index-url https://pypi.sinapsis.tech

[!IMPORTANT] Templates may require extra optional dependencies. For development, we recommend installing the package with all the optional dependencies:

with uv:

  uv pip install sinapsis-huggingface-transformers[all] --extra-index-url https://pypi.sinapsis.tech

or with raw pip:

  pip install sinapsis-huggingface-transformers[all] --extra-index-url https://pypi.sinapsis.tech

📦 Features

Sinapsis Hugging Face Transformers provides customizable inference templates for a variety of tasks, including image captioning, object detection, instance segmentation, speech-to-text, and text-to-speech.

Templates:

  • ImageToTextTransformers: Generates textual descriptions from input images using Hugging Face image-to-text models.
  • PaliGemmaInference: Generate captions for images.
  • PaliGemmaDetection: Detect specific objects in images.
  • SpeechToTextTransformers: Converts spoken audio into text using automatic speech recognition (ASR) models.
  • SummarizationTransformers: Summarizes long text into concise summaries using Hugging Face summarization models.
  • TextToSpeechTransformers: Converts text into lifelike audio using text-to-speech (TTS) models.
  • TranslationTransformers: Translates text from a source language to a target language using Hugging Face translation models.

▶️ Example Usage

Below is an example YAML configuration for text-to-speech (TTS) conversion using the Suno Bark model.

Config
agent:
  name: test_agent

templates:
  - template_name: InputTemplate
    class_name: InputTemplate
    attributes: {}

  - template_name: TextInput
    class_name: TextInput
    attributes:
      text: Hello, my name is Suno. And, uh — and I like pizza. [laughs] But I also have other interests such as playing tic tac toe.

  - template_name: TextToSpeechTransformers
    class_name: TextToSpeechTransformers
    template_input: TextInput
    attributes:
      model_path: 'suno/bark'
      device: "cuda"
      torch_dtype: float32
      seed: 7
      use_embeddings: false
      n_words: 30
      inference_kwargs:
        generate_kwargs:
          do_sample: true
          temperature: 0.7

  - template_name: AudioWriterSoundfile
    class_name: AudioWriterSoundfile
    template_input: TextToSpeechTransformers
    attributes:
      root_dir: ./test
      save_dir: audios

[!IMPORTANT] The TextInput and AudioWriterSoundfile templates correspond to the sinapsis-data-readers and sinapsis-data-writers packages respectively. If you want to use the example, please make sure you install these packages.

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.

Metadata

Release files for sinapsis-huggingface-transformers 0.2.15

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sinapsis-huggingface-transformers 0.2.15
File Size Uploaded
sinapsis_huggingface_transformers-0.2.15.tar.gz 31.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sinapsis-huggingface-transformers 0.2.15
File Interpreter ABI Platform
sinapsis_huggingface_transformers-0.2.15-py3-none-any.whl Python 3 none any Details

Total release size: 71.8 kB

Release files / sinapsis_huggingface_transformers-0.2.15.tar.gz

Download URL sinapsis_huggingface_transformers-0.2.15.tar.gz
Size 31.4 kB
Tags Source
SHA-256 checksum
How to use checksums
f4198dd8d5ef7c987245d7513e868059723100289bc3e6b304ee47330297910b
BLAKE2b-256 checksum
How to use checksums
7cd2c9a248553ab94aa799a9bdaf6896aef81ec79c4657d961f12c58b8ca41ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.16

Release files / sinapsis_huggingface_transformers-0.2.15-py3-none-any.whl

Download URL sinapsis_huggingface_transformers-0.2.15-py3-none-any.whl
Size 40.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0f887381ba6b2dea30ff5ce55ea7a169d8302b011009a4d424d8650ca9809cea
BLAKE2b-256 checksum
How to use checksums
22a3dd505a3fcdba477b30b0e80245335db01eff278a5670650a5e6d7fc44203
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.16

Release history Release notifications | RSS feed

This release

0.2.15 This release

2 release files

0.2.13

2 release files

0.2.12

2 release files

0.2.10

2 release files

0.2.9

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page