Download src/ea/minimal.py from devfloww/ea-models: direct link, hf CLI and curl.
- Browser
- Download file 667 Bytes
-
https://huggingface.co/devfloww/ea-models/resolve/main/src/ea/minimal.py
- Command line
-
hf download hf://devfloww/ea-models/src/ea/minimal.py
-
curl -L -o minimal.py https://huggingface.co/devfloww/ea-models/resolve/main/src/ea/minimal.py
667 Bytes
| import sounddevice as sd # records and plays audio (pure Python + tiny C) | |
| import soundfile as sf # saves audio to .wav files | |
| import whisper # OpenAI's speech-to-text (tiny model = CPU-friendly) | |
| from piper.voice import PiperVoice # super natural text-to-speech | |
| import tempfile # creates temporary files that auto-delete | |
| import os | |
| print("Loading whisper model") | |
| whisper_model = whisper.load_model("/models/whisper/tiny.pt") | |
| print("Model ready") | |
| print("Loading...") | |
| piper_voice = PiperVoice.load( | |
| "/models/piper/ryan-high.onnx", | |
| config_path="/models/piper/ryan-high-onnx.json" | |
| ) | |
| print("Piper ready...") |