Skip to content

more flexibility on Audio Transcriber  #1

@ohjho

Description

@ohjho

first of all, just want to say this is a great package! 💯 Thanks for putting this out there ❤️

on to the audio transcription issue...

  • have you thought about using a "local" Transcriber like in openscenesense-ollama?
  • or alternatively, loading whisper using the huggingface serverless inference api (e.g. see below)
  • and an option to turn off audio transcription (which might be useful if the video has no audio track)
import requests

API_URL = "https://api-inference.huggingface.co/models/openai/whisper-small"
headers = {"Authorization": "Bearer hf_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}

def query(filename):
    with open(filename, "rb") as f:
        data = f.read()
    response = requests.post(API_URL, headers=headers, data=data)
    return response.json()

output = query("sample1.flac")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions