This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This script will transcribe an audio file (mp3, wav, etc.) to text and then clean the text using a local LLM model via Ollama. Technically, this script will work with any LLM that supports the standard OpenAI bindings with minor adjustments. | |
# GETTING STARTED: | |
# 1. Install required python packages (pip install openai python-dotenv) | |
# 2. Git clone a copy of ggerganov/whisper (https://github.com/ggerganov/whisper.cpp) | |
# 3. Build the whisper binary (see the whisper.cpp README for instructions) | |
# 4. Download one of the whisper models (largev2 is the most accurate for all languages, though the base model works reasonably well for English). | |
# 5. Install ffmpeg (brew install ffmpeg on macOS, apt-get install ffmpeg) | |
# 6. Install ollama (https://ollama.com/download) | |
# 7. Download an LLM model (https://ollama.com/library) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import arel | |
from fastapi import FastAPI, Request | |
from fastapi.templating import Jinja2Templates | |
app = FastAPI() | |
templates = Jinja2Templates("templates") | |
if _debug := os.getenv("DEBUG"): |