Automatic Speech Recognition
WhisperKit
Core ML
Portuguese
Spanish
English
macos
apple-silicon
swift
live-captions
subtitles
speech-recognition
machine-translation
on-device
local-first
ollama
Instructions to use Veronyka/livecaption with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- WhisperKit
How to use Veronyka/livecaption with WhisperKit:
# Install CLI with Homebrew on macOS device brew install whisperkit-cli # View all available inference options whisperkit-cli transcribe --help # Download and run inference using whisper base model whisperkit-cli transcribe --audio-path /path/to/audio.mp3 # Or use your preferred model variant whisperkit-cli transcribe --model "large-v3" --model-prefix "distil" --audio-path /path/to/audio.mp3 --verbose
- Notebooks
- Google Colab
- Kaggle
File size: 1,235 Bytes
f1e4744 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | import json, time, urllib.request, sys
URL = "http://localhost:11434/api/chat"
MODEL = sys.argv[1] if len(sys.argv) > 1 else "hymt2-1.8b"
FRASES = [
"Bom dia a todos, vamos começar a live de hoje.",
"A gente vai falar sobre inteligência artificial e soberania de dados.",
"Se vocês estiverem me ouvindo, mandem um oi no chat.",
"O projeto roda no meu computador, sem depender de nenhuma empresa grande.",
"Isso não funcionou da outra vez, então eu resolvi criar o meu próprio sistema.",
"Pessoal, o link da pesquisa está na descrição, não esqueçam de responder.",
]
def traduz(t):
body = {"model": MODEL, "stream": False, "keep_alive": "30m",
"messages": [{"role": "user", "content":
f"Translate the following segment into Spanish, without additional explanation.\n\n{t}"}]}
r = urllib.request.Request(URL, json.dumps(body).encode(), {"Content-Type": "application/json"})
t0 = time.perf_counter()
out = json.load(urllib.request.urlopen(r, timeout=120))["message"]["content"].strip()
return out, time.perf_counter() - t0
for i, f in enumerate(FRASES):
out, dt = traduz(f)
print(f"[{dt:5.2f}s]{' (frio)' if i == 0 else ''} {f}\n -> {out}")
|