Voice to recipe
This is a submission for the Hacktoberfest Weekend Challenge: Build for a Friend What I Built Demo • it runs locally via the terminal. Code import os from faster_whisper import WhisperModel import requests import json # 1. LOCAL TRANSCRIPTION (Whisper) def transcribe_audio ( audio_path ): print ( " Transcribing audio locally... " ) model = WhisperModel ( " base " , device = " cpu " , compute_type…
This submission for the Hacktoberfest Weekend Challenge demonstrates a Voice-to-Recipe Heirloom Kit designed to preserve family cooking stories offline. The system utilizes a local Whisper model to transcribe audio files and an Ollama + Llama 3 local AI model to structure the transcribed content into a beautifully organized recipe.
The code first checks if an audio file named "grandpas_spaghetti_story.mp3" exists in the directory. If it does, the transcribe_audio function is called to convert the audio into text. Then, the structure_recipe function takes the raw transcript and uses an Ollama + Llama 3 model to format it into a structured recipe containing title, description, ingredients, and step-by-step instructions.
The final structured recipe is saved in a markdown file named "heirloom_recipe.md". The system emphasizes that open-weight local models ensure personal family stories remain 100% private and can be used free of charge without relying on cloud API costs.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.