From 62752a3fc7b24cafa678a32676b5ae2a9ed353ff Mon Sep 17 00:00:00 2001 From: hrz <1710360675@qq.com> Date: Wed, 5 Feb 2025 09:06:52 +0800 Subject: [PATCH] =?UTF-8?q?update:=E9=99=8D=E4=BD=8E=E4=B8=80=E7=82=B9?= =?UTF-8?q?=E5=81=9C=E9=A1=BF=E6=97=B6=E9=95=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 13 ++++++++++++- README_en.md | 17 ++++++++++++++--- config.yaml | 4 ++-- core/connection.py | 2 +- 4 files changed, 29 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 96e9c608..504b5c61 100644 --- a/README.md +++ b/README.md @@ -223,7 +223,18 @@ https://espressif.github.io/esp-launchpad/ 建议:在配置文件里,将`LLM`设置成`DifyLLM`,然后通过`Dify`编排智能体实现。 -## 5、更多问题,可联系我们反馈 +## 5、我说话很慢,我停顿一下,小智老是抢我的话,咋办。 + +建议:在配置文件里,找到这一段,将`min_silence_duration_ms`值改大一点,比如改成`1000`。 +``` +VAD: + SileroVAD: + threshold: 0.5 + model_dir: models/snakers4_silero-vad + min_silence_duration_ms: 300 # 如果说话停顿比较长,可以把这个值设置大一些 +``` + +## 6、更多问题,可联系我们反馈 ![图片](docs/images/wechat.jpg) diff --git a/README_en.md b/README_en.md index fd07e8ca..c4372ffa 100644 --- a/README_en.md +++ b/README_en.md @@ -212,7 +212,7 @@ https://espressif.github.io/esp-launchpad/ ``` Open this -tutorial, [Flash Tools/Web -side Burning Folding Step (No IDF Development Environment)] (https://ccnphfhqs21z.feishu.cn/wiki/Zpz4wXBtdimBrLk25WdcXzxcnNS). +tutorial, [Flash Tools/Web -side Burning Folding Step (No IDF Development Environment)](https://ccnphfhqs21z.feishu.cn/wiki/Zpz4wXBtdimBrLk25WdcXzxcnNS). Turn to: `Method 2: ESP-LAUNCHPAD browser web-end burning`, start from `3. Burning firmware/download to the development board`, follow the tutorial operation. @@ -238,11 +238,22 @@ the model of other toll versions of `ChatGlm`. Suggestion: In the configuration file, set the `LLM` to`DifyLLM`, and then arrange the smart application by the `Dify`. -## 5、For more questions, contact us to feedback +## 5、I said very slowly, I paused, Xiaozhi always grabbed me, what to do. + +Suggestion: In the configuration file, find this section, change the `min_silence_duration_ms` value, such as change to` 1000`. +``` +VAD: + SileroVAD: + threshold: 0.5 + model_dir: models/snakers4_silero-vad + min_silence_duration_ms: 300 # 如果说话停顿比较长,可以把这个值设置大一些 +``` + +## 6、For more questions, contact us to feedback ![图片](docs/images/wechat.jpg) # Acknowledgments -- This project is inspired by the [Bailin Voice Dialogue Robot] (https://github.com/wwbin2017/bailing) project, and the +- This project is inspired by the [Bailin Voice Dialogue Robot](https://github.com/wwbin2017/bailing) project, and the basic idea of the project is completed. \ No newline at end of file diff --git a/config.yaml b/config.yaml index 61803252..a24236d5 100644 --- a/config.yaml +++ b/config.yaml @@ -18,7 +18,7 @@ xiaozhi: frame_duration: 60 prompt: | 你是一个叫小智/小志的台湾女孩,说话机车,声音好听,习惯简短表达,爱用网络梗。 - 请注意,要像一个人一样说话,请勿回复表情符号、代码、和xml标签。 + 请注意,要像一个人一样说话,请不要回复表情符号、代码、和xml标签。 当前时间是:{date_time},现在我正在和你进行语音聊天,我们开始吧。 # 使用完声音文件后删除文件(Delete the sound file when you are done using it) delete_audio: true @@ -39,7 +39,7 @@ VAD: SileroVAD: threshold: 0.5 model_dir: models/snakers4_silero-vad - min_silence_duration_ms: 1000 # 如果说话停顿比较长,可以把这个值设置大一些 + min_silence_duration_ms: 700 # 如果说话停顿比较长,可以把这个值设置大一些 LLM: DeepSeekLLM: diff --git a/core/connection.py b/core/connection.py index 65d0bbf6..919ee52c 100644 --- a/core/connection.py +++ b/core/connection.py @@ -102,7 +102,7 @@ class ConnectionHandler: if "{date_time}" in self.prompt: date_time = time.strftime("%Y-%m-%d %H:%M", time.localtime()) self.prompt = self.prompt.replace("{date_time}", date_time) - self.dialogue.put(Message(role="user", content=self.prompt)) + self.dialogue.put(Message(role="system", content=self.prompt)) def chat(self, query): self.dialogue.put(Message(role="user", content=query))