This app is a simulation of a Voice search feature provided by search engines like Google, DuckDuckGo using OpenAI's Whisper model.
This ⚡ Lightning app ⚡ was generated automatically with:
lightning init app LAI_voice_search_openai_whisper_demoPrerequisites
- Create a conda/venv environment
We use conda here but you can use whichever tool you're comfortable with
conda create --yes --name oaiwhisper python=3.8 conda activate oaiwhisper- Install FFMPEG
FFMPEG is necessary for the audio processing
- For Windows: Follow these steps
- For Ubuntu/Debian:
sudo apt-get update sudo apt-get install -y ffmpeg- Install packages
pip install -r requirements.txt- Install app
First, install LAI_voice_search_openai_whisper_demo (warning: this app has not been officially approved on the lightning gallery):
lightning install app https://github.com/theUser/LAI_voice_search_openai_whisper_demo- Run locally
Once the app is installed, run it locally with:
lightning run app LAI_voice_search_openai_whisper_demo/app.pyIf the above does not work, manually setup the environment:
git clone https://github.com/Nachimak28/LAI-voice-search-openai-whisper-demo cd LAI-voice-search-openai-whisper-demo conda create --yes --name oaiwhisper python=3.8 conda activate oaiwhisper python -m pip install -r requirements.txt python -m pip install lightning python -m lightning run app app.py # to run on lightning cloud python -m lightning run app app.py --cloud Run it on the lightning cloud with:
lightning run app LAI_voice_search_openai_whisper_demo/app.py --cloudRun flake to make sure all your styling is consistent (it keeps your team from going insane)
flake8 .To test, follow the README.md instructions in the tests folder.
- Obtain the Speech-to-text (transcription) output using Whisper
- Use this transcribed output string as an input for duckduckgo search
- Once the web search results are obtained, render using HTML
-
Why use DuckDuckGo(DDG) and not Google search? Ans: Google has a lot of rate limiting applied and frequent searches via code lead to getting blocked resulting in status code: 429 - Too many requests. Apparently DDG does not have super strict rate limiting.
-
Why Lightning.ai ? Ans: Provisioning the infra and deployment is automated, all one needs to do is focus on business logic. Also HF spaces are too crowded with mutiple such demos.
- Update code to accept microphone input as soon as Gradio bug is resolved
- Write unit tests
- Run given test
- Add comments and prepare code for submission to Lightning Gallery