linyilyi / voice-assistant Goto Github PK
View Code? Open in Web Editor NEWA simple toy demo of a local voice assistant with whisper and large language model.
License: Apache License 2.0
A simple toy demo of a local voice assistant with whisper and large language model.
License: Apache License 2.0
模型放在脚本同级的models文件夹里了,为什么脚本报错找不到模型呢。。。
这个工程很棒,我优化了其中的一些细节。
这是改动后的main.py文件,这个改动还需要pynput包以及在初次使用时在mac里按提示打开相应的权限。
main.txt
推荐项目
📈RainbowGPT现在包括一个强大的股票分析模块,集成各种技术,提供对股市的全面见解。
⚡RainbowGPT结合了AI Agent代理、GPT-4、GPT3.5、ChatGlm3、Qwen LLM、ChromaDB矢量数据库、Langchain知识库问答检索和谷歌搜索引擎。
项目地址: RainbowGPT 彩虹GPT
类别:Python
项目描述:
🔄 知识库 QA 搜索最有效的使用是将稀疏检索器(例如 BM25)与密集检索器(例如嵌入相似性)相结合。这种“混合搜索”最佳地利用了两种检索器的互补优势来获取全面的知识。
📊 探索股票分析模块并为您的投资决策解锁宝贵的见解! 🚀 #StockAnalysis #RainbowGPT #AIInvesting
🌐 免费使用GPT API
我们致力于根据使用情况扩展容量,并在未经官方批准的情况下免费提供 API。如果您觉得这个项目有帮助,请考虑给我们一个⭐。
该API Key用于转发API请求。将 Host 更改为 api.chatanywhere.com.cn (国内使用首选)或 api.chatanywhere.cn (国际使用,国内用户需要全球代理)。
首先喜欢林亦的视频
遇到的问题:运行main.py后,显示Listening...但是我说话,它没有反应
已进行如下操作:
git clone项目到本地后(M1 max 32G MAC),conda了一个虚拟环境
新建了models文件夹,文件夹里放了yi-chat-6b.Q8_0.gguf 和 新建的whisper-large-v3文件夹,whisper-large-v3文件夹里放了下载下来的config.json和weights.npz
修改load_models.py 里 model_path = "/Users/mymac/voice-assistant/models/whisper-large-v3"
---希望有朋友可以解答疑惑,谢谢
Traceback (most recent call last):
File "/Users/xxx/Project/voice-assistant/main.py", line 155, in <module>
llm = LlamaCpp(
^^^^^^^^^
File "/Users/xxx/miniconda/envs/VoiceAI/lib/python3.11/site-packages/langchain_core/load/serializable.py", line 97, in __init__
super().__init__(**kwargs)
File "/Users/xxx/miniconda/envs/VoiceAI/lib/python3.11/site-packages/pydantic/v1/main.py", line 341, in __init__
raise validation_error
pydantic.v1.error_wrappers.ValidationError: 1 validation error for LlamaCpp
__root__
Could not load Llama model from path: /Users/xxx/Project/voice-assistant/yi-chat-6B-GGUF/yi-chat-6b.Q8_0.gguf. Received error (type=value_error)
System envrioment:
uname -a
Darwin ady.local 22.6.0 Darwin Kernel Version 22.6.0: Wed Jul 5 22:21:56 PDT 2023; root:xnu-8796.141.3~6/RELEASE_X86_64 x86_64
搞不定啊,纯新手,求大佬的指导视频。
如题,期待。
在加载模型的时候出现下面的报错有没有大佬也遇到过😭
Could not load Llama model from path: yi-chat-6b.Q2_K.gguf. Received error (type=value_error)
This doesn't seem to be the chat version provided in README.md, I don't think TheBloke provided the 6B chat version of gguf format yet.
This seems to be the chat version, I haven't tested it yet
https://huggingface.co/XeIaso/yi-chat-6B-GGUF/blob/main/yi-chat-6b.Q8_0.gguf
请问为什么停在llm(prompt.format(question=question), max_tokens=500)就不执行了呢
事情是这样的,我在b站看到这个项目,十分感兴趣。但作为一个小白,题主所写对我来说十分笼统,在尝试两天后我任然无法解决其中的bug。看到有许多小白和我一样不知所措,为此我打算分享我目前得到的成果,以供大家讨论并应对具体的事项。
系统:mac 13.4和14.2,我在调试过程中还升级了一次lol
芯片:m1芯片,21年机型
anaconda链接在此:
https://www.anaconda.com
12.16更新:anaconda在删除后让我成功避免了一些错误,因此下载miniconda是推荐的
https://docs.conda.io/projects/miniconda/en/latest/
brew选择国内源下载
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
遇到弹出填y,这主要是建立一个虚拟环境,之后你会发现你前面的括号内容发生变化了
打开anaconda,在环境中找到voice ai,以后就不用再配置环境了,在这里启动终端就可以💗
如 cd ~/desktop/program/voice-assistant-main(文件路径)
这里cd是打开文件夹的命令,打开后这一点要是没弄清楚,小白很容易在后一步卡住。我是图省事就放桌面了,同时hear和models我也放在voice-assistant-main中,这也可能导致我之后的错误。
要是出现pip命令找不到就尝试pip3
这一步最容易出现的错误是mlx下载错误,我查mlx下载手册(https://ml-explore.github.io/mlx/build/html/install.html)显示使用pip install mlx 需要用native Python >= 3.8,MacOS >= 13.3,但这个环境python = 3.11,就找不到资源。
但我按照mlx文档所说的步骤构建native环境,发现torch不支持这个平台,也会报错所以进退两难了。
我的做法是打开requirements.txt,删除mlx,尝试通过源码导入,但也失败了,这个我们之后再说。
这一点我基本不会报错,等一会就好了。
brew install portaudio
pip install pyaudio
复制代码输入就好,这里我也不会报错错。
这里我找到了镜像源
https://hf-mirror.com/01-ai/Yi-34B-Chat
有多种gguf能够下载,我下载的是这个
https://hf-mirror.com/TheBloke/Yi-34B-GGUF/blob/main/yi-34b.Q4_K_M.gguf
下载完毕后,我放到voice-assistant-main中建立的models文件(这是我新建的文件夹)
同时按照题主描述下载hear并执行sudo bash install.sh,这大概是我最先成功的事情。
重头戏来了,如果你前面msl没有报错,那你是比我幸运得多的幸运儿,恭喜你可以运行程序了(大概?)
注意看你是否还在voice-assistant-main,如果没在则用cd折跃;如果在的话,执行python main.py(这是我在题主视频里看到的)
若你得到以上输出,那么我也无能为力,因为我也止步于此!如果你能运行,那么恭喜你,也欢迎你向我分享你的喜悦与运行方法。
这个问题的描述是这样的,主要与pyaudio有关
主要是在执行导入pyaudio时执行__init__.py第111行出错输出的,我重复了很多遍还是无法解决
以下是我找到的试图解决这个问题的方法,但都对我无效,希望能祝你度此难关。
https://blog.csdn.net/qq_41185868/article/details/107056843
https://blog.csdn.net/u012965373/article/details/131407998
https://zhuanlan.zhihu.com/p/269415073
所以我希望大家一起讨论,看看能不能解决这个问题,如果是bug的话就只能等更新了,不发出来我心痒痒。
这是我第一次写issue,我也才接触github两天,其中肯定有许多错误。若果有什么错误或者遗漏,也请经快与我讨论。
写到最后才发现题主是我校友[捂脸],献丑了…… 也希望题主能够早日更新,早日实现“让大家分分钟拥有自己的ai语音助手”的承诺。
The problem seems to be caused by the "hear" module, which is discussed at sveinbjornt/hear#20. (I tried other time zones and languages, same problem) Switch to whisper can be a solution? Any ideas?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.