Skip to main content

OpenAI Whisper plugin for the cjm-transcription-plugin-system library - provides local speech-to-text transcription with configurable model selection and parameter control.

Project description

cjm-transcription-plugin-whisper

Install

pip install cjm_transcription_plugin_whisper

Project Structure

nbs/
└── plugin.ipynb # Plugin implementation for OpenAI Whisper transcription

Total: 1 notebook across 1 directory

Module Dependencies

graph LR
    plugin[plugin<br/>Whisper 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:

Whisper Plugin (plugin.ipynb)

Plugin implementation for OpenAI Whisper transcription

Import

from cjm_transcription_plugin_whisper.plugin import (
    WhisperLocalPlugin
)

Classes

class WhisperLocalPlugin:
    def __init__(self):
        """Initialize the Whisper plugin with default configuration."""
        self.logger = logging.getLogger(f"{__name__}.{type(self).__name__}")
        self.config = {}
        self.model = None
        self.device = None
        self.model_dir = None
    
    @property
    def name(
        self
    ) -> str:  # Returns the plugin name
    "OpenAI Whisper transcription plugin."
    
    def __init__(self):
            """Initialize the Whisper plugin with default configuration."""
            self.logger = logging.getLogger(f"{__name__}.{type(self).__name__}")
            self.config = {}
            self.model = None
            self.device = None
            self.model_dir = None
        
        @property
        def name(
            self
        ) -> str:  # Returns the plugin name
        "Initialize the Whisper 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 Whisper."
    
    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
        ) -> TranscriptionResult:  # Returns transcription result with text and metadata
        "Transcribe audio using Whisper.

Args:
    audio: Audio data or path to audio file
    **kwargs: Additional arguments to override config
    
Returns:
    TranscriptionResult with transcribed text and metadata"
    
    def is_available(
            self
        ) -> bool:  # Returns True if Whisper and its dependencies are available
        "Check if Whisper is available."
    
    def cleanup(
            self
        ) -> None
        "Clean up resources."

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_whisper-0.0.1.tar.gz (13.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_whisper-0.0.1.tar.gz.

File metadata

File hashes

Hashes for cjm_transcription_plugin_whisper-0.0.1.tar.gz
Algorithm Hash digest
SHA256 eac4dcbd0d78ebda473046d17656880fd0f0bf93adb2d85cd76aee4783fc8fdb
MD5 42a1ead900c66cb1602a1e6ad12e6f52
BLAKE2b-256 379b68439845f2fd2ddca1908590048853c90930a4b390eba0ae3ea23fe17556

See more details on using hashes here.

File details

Details for the file cjm_transcription_plugin_whisper-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for cjm_transcription_plugin_whisper-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f4f083b998f65e1b33c5e28c094deb23cbf3ba3bcf53f58e9574b03cc133d35b
MD5 351466e956bb1b8848ed699d8a30cd23
BLAKE2b-256 36f74e1375d110b2364b8f28cbf049e14043f2408d74d9ce83f22f5f86b7fd6e

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