Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/marvin-vw/python-ollama-local
This Python script enables hands-free interaction with a local Llama2 language model. It captures voice commands from the microphone, sends them to Llama2 for natural language processing, and converts the model's textual responses into speech.
https://github.com/marvin-vw/python-ollama-local
edge-tts langchain llama2 ollama python
Last synced: 14 days ago
JSON representation
This Python script enables hands-free interaction with a local Llama2 language model. It captures voice commands from the microphone, sends them to Llama2 for natural language processing, and converts the model's textual responses into speech.
- Host: GitHub
- URL: https://github.com/marvin-vw/python-ollama-local
- Owner: Marvin-VW
- License: mit
- Created: 2024-01-04T11:45:41.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-01-04T12:49:52.000Z (12 months ago)
- Last Synced: 2024-10-18T22:05:04.667Z (2 months ago)
- Topics: edge-tts, langchain, llama2, ollama, python
- Language: Python
- Homepage:
- Size: 10.7 KB
- Stars: 2
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# python-ollama-local
## Overview
This project enables hands-free voice interactions through a local installation of the Llama2 language model. Users can provide voice commands, which are then processed by Llama2 for natural language understanding. The textual responses are converted into speech using the "edge-tts" tool, and the generated audio is played back sequentially.
## Requirements
Ensure you have the following Python libraries and tools installed:
- [ollama](https://github.com/jmorganca/ollama)
- [gtts](https://pypi.org/project/gTTS/): `pip install gtts`
- [pygame](https://pypi.org/project/pygame/): `pip install pygame`
- [langchain](https://pypi.org/project/langchain/): `pip install langchain`
- [speech_recognition](https://pypi.org/project/SpeechRecognition/): `pip install SpeechRecognition`## Usage
1. **Clone the Repository:**
```
git clone https://github.com/Marvin-VW/python-ollama-local/blob/main/main.py
cd voice-interaction-project
```2. **Install Dependencies:**
```
pip install -r requirements.txt
```3. **Run the Script:**
```
python voice_interaction.py
```## Features
- Captures voice commands from the microphone.
- Utilizes local Llama2 for natural language processing.
- Converts textual responses to speech using "edge-tts."
- Sequential playback of generated audio files.## Contribution
Feel free to contribute to the project by opening issues or submitting pull requests.
## License
This project is licensed under the [MIT License](LICENSE).