Coder Social home page Coder Social logo

localchatllm-edu's Introduction

LocalChatLLM-edu

此项目基于 LocalChatLLM,旨在通过开箱即用的本地化离线自然语言语音交互形式,实现儿童陪伴聊天早教等功能。

主要技术栈

  • Python
  • ollama
  • qwen
  • whisper
  • pyttsx3

功能实现

  • LLM自然语言对话 - ollama|qwen
  • 语音输入 - whisper
  • 语音合成 - pyttsx3
  • 大模型实现自然语言合成
  • 语音唤醒
  • 自动结束录音 (静音检测)
  • 局域网分布式运行

部署

  1. clone 本仓库:
git clone https://github.com/Gloridust/LocalChatLLM-edu.git
cd ./LocalChatLLM-edu
  1. 从官网安装 ollama

  2. 安装Python依赖库:

pip install -r requirements.txt

如果出现异常,首先尝试一步一步安装,检查哪一步出问题了:

pip install ollama
pip install pyaudio
pip install pydub
pip install ffmpeg
pip install pyttsx3
pip install openai-whisper

参考 Openai-Whisper 的官方文档,你需要根据不同的系统用以下命令安装ffmpeg:

# on Ubuntu or Debian
sudo apt update && sudo apt install ffmpeg

# on Arch Linux
sudo pacman -S ffmpeg

# on MacOS using Homebrew (https://brew.sh/)
brew install ffmpeg

# on Windows using Chocolatey (https://chocolatey.org/)
choco install ffmpeg

# on Windows using Scoop (https://scoop.sh/)
scoop install ffmpeg

如果您在上述 'pip install' 命令中看到安装错误,请按安装 Rust 开发环境。此外,您可能需要配置 PATH 环境变量,例如 'export PATH="$HOME/.cargo/bin:$PATH"' 。如果没有名为 "setuptools_rust "的模块,安装失败,则需要先安装 'setuptools_rust' :

pip install setuptools-rust
  1. 拉取定制模型:
ollama create localchatllm-edu -f ./modelfile_cn
  1. 初始化并尝试运行whisper:
whisper audio.wav --model base

大功告成!

运行

python start.py

程序录音5秒钟,然后等待生成回答。在朗读完生成的回答后,会再次进入录音状态,以此循环。

鸣谢

localchatllm-edu's People

Contributors

gloridust avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.