This app allows you to generate and record commands for a robot dog using OpenAI's GPT model. The commands are saved as both text and audio for future use, particularly for training purposes. The generated data is stored in Parquet files.
- Command Generation: Generates randomized robot dog commands using OpenAI's GPT model.
- Audio Recording: Records voice commands via a microphone.
- Data Storage: Saves the commands and audio in Parquet format for easy retrieval and analysis.
- Customizable Prompt: Users can modify the system prompt to control the type of commands generated.
To install the required packages, run:
pip install -r requirements.txt
The app uses a system_prompt.txt
file to define the type of instructions generated for the robot. This can be customized based on your needs. By default, the prompt is aimed at generating robot movement instructions.
The app will display the command, and you can record your voice command based on the provided instructions. The recorded data (both text and audio) is stored in a Parquet file in the audio folder in the root of the project when you click the Write to file button.
Once you're done recording a batch of commands, press the Write to file button. This will save the current set of commands and their corresponding audio files into a Parquet file named whisper_training_data_N.parquet
, where N
is the collection number to avoid overwriting previous files.
The application allows passing the path to a custom system prompt file via the --system-prompt-file
argument.
Example:
streamlit run app.py -- --system-prompt-file custom_prompt.txt
Ensure you have set your OPENAI_API_KEY
as an environment variable to enable the sentence generation.
export OPENAI_API_KEY="your-api-key"
-
Generate Commands:
- The app generates random commands for the robot based on the system prompt provided.
-
Record Audio:
- The user is prompted to record their voice corresponding to each command.
-
Save Data:
- The text and audio data are stored in Parquet format for training purposes.
You can run the app using the following command:
streamlit run app.py
You can also provide a custom system prompt file:
streamlit run app.py -- --system-prompt-file "custom_prompt.txt"
This project is licensed under the MIT License.