Skip to main content

Mistral Voxtral plugin for the cjm-transcription-plugin-system library - provides local speech-to-text transcription through 🤗 Transformers with configurable model selection and parameter control.

Project description

cjm-transcription-plugin-voxtral-hf

Install

pip install cjm_transcription_plugin_voxtral_hf

Project Structure

nbs/
└── plugin.ipynb # Plugin implementation for Mistral Voxtral transcription through Hugging Face Transformers

Total: 1 notebook

Module Dependencies

graph LR
    plugin[plugin<br/>Voxtral HF Plugin]

No cross-module dependencies detected.

CLI Reference

No CLI commands found in this project.

Module Overview

Detailed documentation for each module in the project:

Voxtral HF Plugin (plugin.ipynb)

Plugin implementation for Mistral Voxtral transcription through Hugging Face Transformers

Import

from cjm_transcription_plugin_voxtral_hf.plugin import (
    VoxtralHFPlugin
)

Functions

@patch
def supports_streaming(
    self:VoxtralHFPlugin
) -> bool
    "Check if this plugin supports streaming transcription."
@patch
def execute_stream(
    self:VoxtralHFPlugin,
    audio: Union[AudioData, str, Path],  # Audio data or path to audio file
    **kwargs  # Additional plugin-specific parameters
) -> Generator[str, None, TranscriptionResult]:  # Yields text chunks, returns final result
    """
    Stream transcription results chunk by chunk.
    
    Args:
        audio: Audio data or path to audio file
        **kwargs: Additional plugin-specific parameters
        
    Yields:
        str: Partial transcription text chunks as they become available
        
    Returns:
        TranscriptionResult: Final complete transcription with metadata
    """

Classes

class VoxtralHFPlugin:
    def __init__(self):
        """Initialize the Voxtral HF plugin with default configuration."""
        self.logger = logging.getLogger(f"{__name__}.{type(self).__name__}")
        self.config = {}
        self.model = None
        self.processor = None
        self.device = None
        self.dtype = None
    
    @property
    def name(
        self
    ) -> str:  # Returns the plugin name
    "Mistral Voxtral transcription plugin via Hugging Face Transformers."
    
    def __init__(self):
            """Initialize the Voxtral HF plugin with default configuration."""
            self.logger = logging.getLogger(f"{__name__}.{type(self).__name__}")
            self.config = {}
            self.model = None
            self.processor = None
            self.device = None
            self.dtype = None
        
        @property
        def name(
            self
        ) -> str:  # Returns the plugin name
        "Initialize the Voxtral HF plugin with default configuration."
    
    def name(
            self
        ) -> str:  # Returns the plugin name
        "Get the plugin name identifier."
    
    def version(
            self
        ) -> str:  # Returns the plugin version
        "Get the plugin version string."
    
    def supported_formats(
            self
        ) -> List[str]:  # Returns list of supported audio formats
        "Get the list of supported audio file formats."
    
    def get_config_schema(
            self
        ) -> Dict[str, Any]:  # Returns the configuration schema dictionary
        "Return configuration schema for Voxtral HF."
    
    def get_current_config(
            self
        ) -> Dict[str, Any]:  # Returns the current configuration dictionary
        "Return current configuration."
    
    def initialize(
            self,
            config: Optional[Dict[str, Any]] = None  # Configuration dictionary to initialize the plugin
        ) -> None
        "Initialize the plugin with configuration."
    
    def execute(
            self,
            audio: Union[AudioData, str, Path],  # Audio data or path to audio file to transcribe
            **kwargs #  Additional arguments to override config
        ) -> TranscriptionResult:  # Returns transcription result with text and metadata
        "Transcribe audio using Voxtral."
    
    def is_available(
            self
        ) -> bool:  # Returns True if Voxtral and its dependencies are available
        "Check if Voxtral is available."
    
    def cleanup(
            self
        ) -> None
        "Clean up resources with aggressive memory management."

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

cjm_transcription_plugin_voxtral_hf-0.0.2.tar.gz (14.7 kB view details)

Uploaded Source

Built Distribution

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

File details

Details for the file cjm_transcription_plugin_voxtral_hf-0.0.2.tar.gz.

File metadata

File hashes

Hashes for cjm_transcription_plugin_voxtral_hf-0.0.2.tar.gz
Algorithm Hash digest
SHA256 fcbe97d51bb59fc0e49f7f242e9f56015f40b8f8475eb13e137c1ce419ac1d7b
MD5 6cb8c0d5cf3e08abddfedab1cb52b847
BLAKE2b-256 8f96f2e87a522e9c098cc5a94ff5c3b5eee39cc3310f91561951feff62e43af1

See more details on using hashes here.

File details

Details for the file cjm_transcription_plugin_voxtral_hf-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for cjm_transcription_plugin_voxtral_hf-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 53e62a309ede7e3e4e9c6fb41178bcc4c98c07d1d736dc5d2a8ea912000fbc7c
MD5 a2ec5e85dcc7d3b75ad8c7cf4e3279ad
BLAKE2b-256 5925624cd6dfc77ec327b388d6fd3950cb71d4625f3828fcfe95e7b9d86d473d

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