### Install faster-whisper from Master Branch Source: https://github.com/guillaumekln/faster-whisper/blob/master/README.md Installs the faster-whisper library directly from the master branch of its GitHub repository. This allows for installation of the latest development version. ```bash pip install --force-reinstall "faster-whisper @ https://github.com/SYSTRAN/faster-whisper/archive/refs/heads/master.tar.gz" ``` -------------------------------- ### Install faster-whisper from PyPI Source: https://github.com/guillaumekln/faster-whisper/blob/master/README.md Installs the faster-whisper library using pip from the Python Package Index. This is the standard method for installing the latest stable release. ```bash pip install faster-whisper ``` -------------------------------- ### Install faster-whisper for Development Source: https://github.com/guillaumekln/faster-whisper/blob/master/CONTRIBUTING.md Installs the faster-whisper library in editable mode, including development dependencies. This is essential for making and testing changes locally. ```bash git clone https://github.com/SYSTRAN/faster-whisper.git cd faster-whisper/ pip install -e .[dev] ``` -------------------------------- ### Install faster-whisper from Specific Commit Source: https://github.com/guillaumekln/faster-whisper/blob/master/README.md Installs a specific version of the faster-whisper library from a given commit hash in its GitHub repository. This is useful for reproducible builds. ```bash pip install --force-reinstall "faster-whisper @ https://github.com/SYSTRAN/faster-whisper/archive/a4f1cc8f11433e454c3934442b5e1a4ed5e865c3.tar.gz" ``` -------------------------------- ### Transcription with Distil-Whisper Model (Python) Source: https://github.com/guillaumekln/faster-whisper/blob/master/README.md Demonstrates using a Distil-Whisper model (e.g., distil-large-v3) with Faster-Whisper. This example shows how to specify the model size and optionally set the language and condition on previous text. ```python from faster_whisper import WhisperModel model_size = "distil-large-v3" model = WhisperModel(model_size, device="cuda", compute_type="float16") segments, info = model.transcribe("audio.mp3", beam_size=5, language="en", condition_on_previous_text=False) for segment in segments: print("[%.2fs -> %.2fs] %s" % (segment.start, segment.end, segment.text)) ``` -------------------------------- ### Perform High-Throughput Batched Transcription Source: https://context7.com/guillaumekln/faster-whisper/llms.txt Utilizes the BatchedInferencePipeline to process audio in parallel batches for increased performance. Includes examples for standard batching, word timestamps, language detection per segment, and custom clip processing. ```python from faster_whisper import WhisperModel, BatchedInferencePipeline model = WhisperModel("large-v3", device="cuda", compute_type="float16") batched_model = BatchedInferencePipeline(model=model) # Transcribe with batched processing segments, info = batched_model.transcribe("audio.mp3", batch_size=16) # Batched transcription with word timestamps segments, info = batched_model.transcribe("audio.mp3", batch_size=16, word_timestamps=True) # Disable VAD and provide custom clip timestamps segments, info = batched_model.transcribe( "audio.mp3", vad_filter=False, clip_timestamps=[{"start": 0.0, "end": 30.0}, {"start": 45.0, "end": 90.0}] ) ``` -------------------------------- ### Get Speech Timestamps Source: https://context7.com/guillaumekln/faster-whisper/llms.txt Extracts speech timestamps directly from audio for custom processing using VAD. ```APIDOC ## Get speech timestamps directly (for custom processing) ### Description This example demonstrates how to decode audio and extract speech timestamps using the `decode_audio` and `get_speech_timestamps` functions. ### Method N/A (Python function calls) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example ```python from faster_whisper import decode_audio audio = decode_audio("audio.mp3", sampling_rate=16000) speech_chunks = get_speech_timestamps(audio, vad_options, sampling_rate=16000) for chunk in speech_chunks: start_time = chunk["start"] / 16000 end_time = chunk["end"] / 16000 print(f"Speech detected: {start_time:.2f}s -> {end_time:.2f}s") ``` ### Response #### Success Response (200) N/A (Python output) #### Response Example ``` Speech detected: 1.23s -> 5.67s Speech detected: 8.90s -> 12.34s ``` ``` -------------------------------- ### Word-Level Timestamps (Python) Source: https://github.com/guillaumekln/faster-whisper/blob/master/README.md Enables and retrieves word-level timestamps during transcription. The `word_timestamps=True` argument modifies the output to include start and end times for each word. ```python segments, _ = model.transcribe("audio.mp3", word_timestamps=True) for segment in segments: for word in segment.words: print("[%.2fs -> %.2fs] %s" % (word.start, word.end, word.word)) ``` -------------------------------- ### Initialize and Load WhisperModel Source: https://context7.com/guillaumekln/faster-whisper/llms.txt Demonstrates how to instantiate the WhisperModel class with different configurations, including device selection (CPU/GPU), quantization types, and multi-GPU support. ```python from faster_whisper import WhisperModel # Load model on GPU with FP16 precision model = WhisperModel("large-v3", device="cuda", compute_type="float16") # Load model on CPU with INT8 quantization for lower memory model_cpu = WhisperModel("medium", device="cpu", compute_type="int8") # Load model with automatic device selection model_auto = WhisperModel("small", device="auto", compute_type="default") # Load model on multiple GPUs for parallel processing model_multi_gpu = WhisperModel( "large-v3", device="cuda", device_index=[0, 1, 2, 3], compute_type="float16", num_workers=4 ) # Load from local directory model_local = WhisperModel("/path/to/converted/model", device="cuda") # Load from Hugging Face Hub with authentication model_hf = WhisperModel( "username/custom-whisper-model", device="cuda", use_auth_token="hf_your_token_here" ) ``` -------------------------------- ### Basic Transcription with Faster-Whisper (Python) Source: https://github.com/guillaumekln/faster-whisper/blob/master/README.md Demonstrates basic audio transcription using the WhisperModel. It shows how to initialize the model for GPU or CPU usage with different compute types and transcribe an audio file. The detected language and transcription segments are then printed. ```python from faster_whisper import WhisperModel model_size = "large-v3" # Run on GPU with FP16 model = WhisperModel(model_size, device="cuda", compute_type="float16") # or run on GPU with INT8 # model = WhisperModel(model_size, device="cuda", compute_type="int8_float16") # or run on CPU with INT8 # model = WhisperModel(model_size, device="cpu", compute_type="int8") segments, info = model.transcribe("audio.mp3", beam_size=5) print("Detected language '%s' with probability %f" % (info.language, info.language_probability)) for segment in segments: print("[%.2fs -> %.2fs] %s" % (segment.start, segment.end, segment.text)) ``` -------------------------------- ### Configure Logging and Progress Monitoring Source: https://context7.com/guillaumekln/faster-whisper/llms.txt Explains how to set up Python logging for the faster_whisper library to monitor progress and debug issues. Includes enabling progress bars and attaching custom log handlers. ```python import logging from faster_whisper import WhisperModel # Configure logging level logging.basicConfig() logging.getLogger("faster_whisper").setLevel(logging.DEBUG) model = WhisperModel("large-v3", device="cuda", compute_type="float16") # Transcribe with progress bar segments, info = model.transcribe("long_audio.mp3", log_progress=True) segments = list(segments) # Custom log handler handler = logging.FileHandler("transcription.log") handler.setFormatter(logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")) logging.getLogger("faster_whisper").addHandler(handler) segments, info = model.transcribe("audio.mp3", vad_filter=True) ``` -------------------------------- ### Load Converted Whisper Model Source: https://github.com/guillaumekln/faster-whisper/blob/master/README.md Demonstrates how to initialize the WhisperModel class using a converted model stored locally or hosted on the Hugging Face Hub. ```python # Load from local directory model = faster_whisper.WhisperModel("whisper-large-v3-ct2") # Load from Hugging Face Hub model = faster_whisper.WhisperModel("username/whisper-large-v3-ct2") ``` -------------------------------- ### Configure Faster-Whisper Logging (Python) Source: https://github.com/guillaumekln/faster-whisper/blob/master/README.md Sets up Python's logging module to display DEBUG level messages from the faster_whisper library. This is useful for troubleshooting and monitoring the transcription process. ```python import logging logging.basicConfig() logging.getLogger("faster_whisper").setLevel(logging.DEBUG) ``` -------------------------------- ### Perform Basic Audio Transcription Source: https://context7.com/guillaumekln/faster-whisper/llms.txt Shows how to use the transcribe method to convert audio files into text segments. Covers options for language specification, translation tasks, and beam search parameter tuning. ```python from faster_whisper import WhisperModel model = WhisperModel("large-v3", device="cuda", compute_type="float16") # Basic transcription from file segments, info = model.transcribe("audio.mp3", beam_size=5) print(f"Detected language: {info.language} (probability: {info.language_probability:.2f})") print(f"Audio duration: {info.duration:.2f}s") # Iterate through segments (transcription runs during iteration) for segment in segments: print(f"[{segment.start:.2fs} -> {segment.end:.2fs}] {segment.text}") # Force complete transcription by converting to list segments, info = model.transcribe("audio.mp3") segments = list(segments) # Transcription runs here # Transcribe with specific language segments, info = model.transcribe("french_audio.mp3", language="fr") # Translate to English segments, info = model.transcribe("german_audio.mp3", task="translate") # Use initial prompt for context segments, info = model.transcribe( "meeting.mp3", initial_prompt="This is a technical meeting about machine learning and neural networks." ) # Transcribe with custom beam search parameters segments, info = model.transcribe( "audio.mp3", beam_size=10, best_of=5, patience=1.5, length_penalty=1.0, temperature=[0.0, 0.2, 0.4, 0.6, 0.8, 1.0] ) ``` -------------------------------- ### Batched Transcription with Faster-Whisper (Python) Source: https://github.com/guillaumekln/faster-whisper/blob/master/README.md Shows how to perform batched transcription using the BatchedInferencePipeline. This can improve throughput for multiple audio files or segments. The pipeline is initialized with a pre-configured WhisperModel. ```python from faster_whisper import WhisperModel, BatchedInferencePipeline model = WhisperModel("turbo", device="cuda", compute_type="float16") batched_model = BatchedInferencePipeline(model=model) segments, info = batched_model.transcribe("audio.mp3", batch_size=16) for segment in segments: print("[%.2fs -> %.2fs] %s" % (segment.start, segment.end, segment.text)) ``` -------------------------------- ### Manage models with available_models and download_model Source: https://context7.com/guillaumekln/faster-whisper/llms.txt Utility functions to list available model identifiers and download them from the Hugging Face Hub with support for custom directories, authentication, and revisions. ```python from faster_whisper import available_models, download_model # List all available model sizes models = available_models() # Download model to specific directory with authentication model_path = download_model( "username/private-whisper-model", use_auth_token="hf_your_token_here" ) ``` -------------------------------- ### Force Transcription Completion (Python) Source: https://github.com/guillaumekln/faster-whisper/blob/master/README.md Illustrates how to ensure the entire transcription process completes by converting the generator output of segments into a list. This forces the transcription to run to completion. ```python segments, _ = model.transcribe("audio.mp3") segments = list(segments) # The transcription will actually run here. ``` -------------------------------- ### Integrate Distil-Whisper Models Source: https://context7.com/guillaumekln/faster-whisper/llms.txt Shows how to load and use Distil-Whisper models for faster inference. Highlights the compatibility with the batched pipeline and recommended settings for English-only models. ```python from faster_whisper import WhisperModel, BatchedInferencePipeline model = WhisperModel("distil-large-v3", device="cuda", compute_type="float16") # Standard transcription segments, info = model.transcribe("english_audio.mp3", beam_size=5, language="en") # Batched transcription with distil model batched_model = BatchedInferencePipeline(model=model) segments, info = batched_model.transcribe("audio.mp3", batch_size=16, language="en") ``` -------------------------------- ### Validate Code Changes with Testing and Linting Tools Source: https://github.com/guillaumekln/faster-whisper/blob/master/CONTRIBUTING.md Runs the existing test suite and applies code formatting and linting checks. These steps ensure code quality and consistency, mirroring the checks performed in the CI pipeline. ```bash pytest tests/ ``` ```bash black . isort . flake8 . ``` -------------------------------- ### Detect Audio Language Source: https://context7.com/guillaumekln/faster-whisper/llms.txt Demonstrates how to identify the language of an audio file without full transcription. Covers basic detection, top-N probability sorting, and VAD-filtered detection. ```python from faster_whisper import WhisperModel model = WhisperModel("large-v3", device="cuda", compute_type="float16") # Detect language from audio file language, probability, all_probs = model.detect_language("audio.mp3") # Detect language with VAD filtering language, probability, all_probs = model.detect_language( "audio.mp3", vad_filter=True, vad_parameters={"threshold": 0.5} ) ``` -------------------------------- ### Configure Voice Activity Detection (VAD) in Faster-Whisper Source: https://context7.com/guillaumekln/faster-whisper/llms.txt Demonstrates how to enable and customize VAD filtering during transcription. It shows basic usage, dictionary-based parameter customization, and the use of the VadOptions class for granular control. ```python # Enable VAD filter with default settings segments, info = model.transcribe("audio.mp3", vad_filter=True) # Customize VAD parameters via dictionary segments, info = model.transcribe( "audio.mp3", vad_filter=True, vad_parameters={ "threshold": 0.5, "min_speech_duration_ms": 250, "min_silence_duration_ms": 500, "speech_pad_ms": 400, "max_speech_duration_s": 30, } ) # Use VadOptions class for more control vad_options = VadOptions( threshold=0.6, neg_threshold=0.35, min_speech_duration_ms=100, min_silence_duration_ms=1000, speech_pad_ms=200, max_speech_duration_s=float("inf") ) segments, info = model.transcribe("audio.mp3", vad_filter=True, vad_parameters=vad_options) ``` -------------------------------- ### Enable Word-Level Timestamps Source: https://context7.com/guillaumekln/faster-whisper/llms.txt Explains how to extract precise timing for individual words. Includes configuration for punctuation handling and hallucination prevention using silence thresholds. ```python from faster_whisper import WhisperModel model = WhisperModel("large-v3", device="cuda", compute_type="float16") # Enable word-level timestamps segments, info = model.transcribe("audio.mp3", word_timestamps=True) for segment in segments: print(f"Segment: [{segment.start:.2f}s -> {segment.end:.2f}s]") for word in segment.words: print(f" [{word.start:.2f}s -> {word.end:.2f}s] {word.word} (prob: {word.probability:.2f})") # Customize punctuation handling for word timestamps segments, info = model.transcribe( "audio.mp3", word_timestamps=True, prepend_punctuations="\"'¿([{-", append_punctuations="\"'.。,,!!??::)]}、" ) # Handle potential hallucinations with silence threshold segments, info = model.transcribe( "audio.mp3", word_timestamps=True, hallucination_silence_threshold=2.0 # Skip silent periods > 2 seconds ) ``` -------------------------------- ### Configure Voice Activity Detection with VadOptions Source: https://context7.com/guillaumekln/faster-whisper/llms.txt Configures Silero VAD parameters to control speech detection sensitivity, segment duration, and padding, which can be passed to the transcribe method. ```python from faster_whisper import WhisperModel from faster_whisper.vad import VadOptions # Create custom VAD options vad_options = VadOptions( threshold=0.5, min_speech_duration_ms=250, speech_pad_ms=400 ) model = WhisperModel("large-v3", device="cuda", compute_type="float16") segments, info = model.transcribe("audio.mp3", vad_filter=True, vad_parameters=vad_options) ``` -------------------------------- ### Logging Configuration Source: https://context7.com/guillaumekln/faster-whisper/llms.txt Configure logging to monitor transcription progress and debug issues by setting log levels and handlers. ```APIDOC ## Logging Configuration ### Description Configure logging to monitor transcription progress and debug issues. You can set the logging level for the `faster_whisper` library and add custom log handlers. ### Method N/A (Python logging configuration) ### Endpoint N/A ### Parameters N/A ### Request Example ```python import logging from faster_whisper import WhisperModel # Configure logging level logging.basicConfig() logging.getLogger("faster_whisper").setLevel(logging.DEBUG) model = WhisperModel("large-v3", device="cuda", compute_type="float16") # Transcribe with progress bar segments, info = model.transcribe("long_audio.mp3", log_progress=True) segments = list(segments) # Progress bar shows during iteration # Custom log handler handler = logging.FileHandler("transcription.log") handler.setFormatter(logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")) logging.getLogger("faster_whisper").addHandler(handler) # Transcription details will be logged segments, info = model.transcribe("audio.mp3", vad_filter=True) ``` ### Response #### Success Response (200) N/A (Logs are written to console or file) #### Response Example ``` 2023-10-27 10:00:00,123 - faster_whisper - DEBUG - Processing chunk 0/100 2023-10-27 10:00:05,456 - faster_whisper - INFO - Transcription complete. ``` ``` -------------------------------- ### Extract Speech Timestamps with VAD Source: https://context7.com/guillaumekln/faster-whisper/llms.txt Demonstrates how to decode audio and extract specific speech timestamps using VAD options. This is useful for custom audio processing pipelines where only speech segments are required. ```python from faster_whisper import decode_audio audio = decode_audio("audio.mp3", sampling_rate=16000) speech_chunks = get_speech_timestamps(audio, vad_options, sampling_rate=16000) for chunk in speech_chunks: start_time = chunk["start"] / 16000 end_time = chunk["end"] / 16000 print(f"Speech detected: {start_time:.2f}s -> {end_time:.2f}s") ``` -------------------------------- ### Detect language from numpy array Source: https://context7.com/guillaumekln/faster-whisper/llms.txt Demonstrates how to perform language detection on a decoded numpy audio array using a loaded Whisper model. ```python import numpy as np from faster_whisper import decode_audio audio = decode_audio("audio.mp3", sampling_rate=16000) language, probability, all_probs = model.detect_language(audio=audio) ``` -------------------------------- ### Decode audio files with decode_audio Source: https://context7.com/guillaumekln/faster-whisper/llms.txt Provides methods to decode audio files into numpy arrays, supporting custom sampling rates, stereo splitting, and file-like objects for integration with transcription models. ```python from faster_whisper import decode_audio from faster_whisper import WhisperModel # Basic audio decoding audio = decode_audio("audio.mp3") # Decode with custom sampling rate and split stereo left_channel, right_channel = decode_audio("stereo_audio.mp3", split_stereo=True) # Use decoded audio with WhisperModel model = WhisperModel("large-v3", device="cuda", compute_type="float16") audio = decode_audio("audio.mp3", sampling_rate=16000) segments, info = model.transcribe(audio, beam_size=5) ``` -------------------------------- ### Format timestamps with format_timestamp Source: https://context7.com/guillaumekln/faster-whisper/llms.txt Converts numeric seconds into human-readable strings, useful for generating SRT subtitle files from transcription segments. ```python from faster_whisper import format_timestamp, WhisperModel # Basic formatting print(format_timestamp(65.5)) # Output: "01:05.500" # Generate SRT subtitles model = WhisperModel("large-v3", device="cuda", compute_type="float16") segments, info = model.transcribe("audio.mp3") for i, segment in enumerate(segments, start=1): start = format_timestamp(segment.start, always_include_hours=True, decimal_marker=",") end = format_timestamp(segment.end, always_include_hours=True, decimal_marker=",") print(f"{i}\n{start} --> {end}\n{segment.text.strip()}\n") ``` -------------------------------- ### BatchedInferencePipeline Source: https://github.com/guillaumekln/faster-whisper/blob/master/README.md Perform batched transcription for improved performance on large audio files. ```APIDOC ## POST /batched_transcribe ### Description Runs transcription in batches, which is more efficient for long audio files. ### Method Python Method: `batched_model.transcribe(audio, batch_size=16)` ### Parameters #### Arguments - **audio** (str) - Required - Path to the audio file. - **batch_size** (int) - Optional - Number of segments to process in parallel. ### Request Example ```python from faster_whisper import BatchedInferencePipeline batched_model = BatchedInferencePipeline(model=model) segments, info = batched_model.transcribe("audio.mp3", batch_size=16) ``` ``` -------------------------------- ### Convert Whisper Model to CTranslate2 Format Source: https://github.com/guillaumekln/faster-whisper/blob/master/README.md Uses the ct2-transformers-converter tool to convert a Hugging Face Transformers Whisper model into a quantized CTranslate2 format. This allows for faster inference using the faster-whisper library. ```bash pip install transformers[torch]>=4.23 ct2-transformers-converter --model openai/whisper-large-v3 --output_dir whisper-large-v3-ct2 --copy_files tokenizer.json preprocessor_config.json --quantization float16 ``` -------------------------------- ### WhisperModel.transcribe Source: https://github.com/guillaumekln/faster-whisper/blob/master/README.md Transcribe audio files using the WhisperModel class. This method supports various configurations including device selection, beam size, and language settings. ```APIDOC ## POST /transcribe ### Description Transcribes an audio file into text segments using the loaded Whisper model. ### Method Python Method: `model.transcribe(audio, beam_size=5, language=None, vad_filter=False, word_timestamps=False)` ### Parameters #### Arguments - **audio** (str/file) - Required - Path to the audio file or file-like object. - **beam_size** (int) - Optional - Number of beams for beam search decoding. - **language** (str) - Optional - Language code for the input audio. - **vad_filter** (bool) - Optional - Whether to enable Silero VAD to filter out non-speech segments. - **word_timestamps** (bool) - Optional - Whether to return word-level timestamps. ### Request Example ```python segments, info = model.transcribe("audio.mp3", beam_size=5, vad_filter=True) ``` ### Response #### Success Response - **segments** (generator) - A generator yielding transcription segments. - **info** (object) - Metadata including detected language and probability. #### Response Example ```python for segment in segments: print(f"[{segment.start} -> {segment.end}] {segment.text}") ``` ``` -------------------------------- ### Bias Transcription with Hotwords Source: https://context7.com/guillaumekln/faster-whisper/llms.txt Shows how to improve recognition of technical terms, proper nouns, or domain-specific vocabulary by providing a hotwords string to the transcribe method. This can be used with both standard models and batched inference pipelines. ```python from faster_whisper import WhisperModel, BatchedInferencePipeline model = WhisperModel("large-v3", device="cuda", compute_type="float16") # Use hotwords for technical terms segments, info = model.transcribe( "tech_meeting.mp3", hotwords="Kubernetes Docker PostgreSQL microservices API GraphQL" ) # Hotwords with batched pipeline batched_model = BatchedInferencePipeline(model=model) segments, info = batched_model.transcribe( "medical_audio.mp3", batch_size=16, hotwords="myocardial infarction electrocardiogram echocardiography" ) # Combine with initial prompt for better context segments, info = model.transcribe( "legal_deposition.mp3", initial_prompt="This is a legal deposition regarding patent infringement.", hotwords="plaintiff defendant injunction intellectual property USPTO" ) ``` -------------------------------- ### VAD Filter for Silence Removal (Python) Source: https://github.com/guillaumekln/faster-whisper/blob/master/README.md Activates the Voice Activity Detection (VAD) filter to remove silent parts of the audio during transcription. The default minimum silence duration is 2 seconds, but it can be customized using `vad_parameters`. ```python segments, _ = model.transcribe("audio.mp3", vad_filter=True) # Customizing VAD parameters segments, _ = model.transcribe( "audio.mp3", vad_filter=True, vad_parameters=dict(min_silence_duration_ms=500), ) ``` -------------------------------- ### Hotwords - Bias Transcription Toward Specific Terms Source: https://context7.com/guillaumekln/faster-whisper/llms.txt Improves recognition of domain-specific vocabulary, proper nouns, or technical terms by using the `hotwords` parameter during transcription. ```APIDOC ## Hotwords - Bias Transcription Toward Specific Terms ### Description Use hotwords to bias the transcription model towards recognizing specific terms, improving accuracy for domain-specific vocabulary, proper nouns, or technical jargon. ### Method `transcribe` (WhisperModel and BatchedInferencePipeline) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example ```python from faster_whisper import WhisperModel, BatchedInferencePipeline model = WhisperModel("large-v3", device="cuda", compute_type="float16") # Use hotwords for technical terms segments, info = model.transcribe( "tech_meeting.mp3", hotwords="Kubernetes Docker PostgreSQL microservices API GraphQL" ) # Hotwords for proper nouns segments, info = model.transcribe( "interview.mp3", hotwords="OpenAI ChatGPT Anthropic Claude LLaMA" ) # Hotwords with batched pipeline batched_model = BatchedInferencePipeline(model=model) segments, info = batched_model.transcribe( "medical_audio.mp3", batch_size=16, hotwords="myocardial infarction electrocardiogram echocardiography" ) # Combine with initial prompt for better context segments, info = model.transcribe( "legal_deposition.mp3", initial_prompt="This is a legal deposition regarding patent infringement.", hotwords="plaintiff defendant injunction intellectual property USPTO" ) ``` ### Response #### Success Response (200) - **segments** (generator) - Yields transcription segments. - **info** (dict) - Contains transcription information like language and duration. #### Response Example N/A (output is streamed via segments generator) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.