FoloToy/folotoy-server-self-hosting

roles.json,默认角色设置能正常工作。如果改为粤语就出问题。请帮忙看看。

Closed this issue · 5 comments

我在compose 设置如下,在家用nas设置服务器。
SPEECH_UDP_SERVER_HOST: 192.168.5.179
SPEECH_UDP_SERVER_PORT: 8085
AZURE_STT_KEY: 11exxx9507e4xxxxx2d5c67a4
AZURE_STT_SERVICE_REGION: eastus
MOONSHOT_API_BASE: https://api.moonshot.cn/v1
MOONSHOT_MODEL: moonshot-v1-8k
MOONSHOT_KEY: sk-QM2o5xxxxaKA3FbobxxByAMEjt
AZURE_TTS_KEY: 4600429eba19xxxx0xxxxxx4xx3b
AZURE_TTS_SERVICE_REGION: eastasia
TTS_TYPE: azure-tts
LLM_TYPE: moonshot
STT_TYPE: azure-stt
然后roles.json,用github复制过来的,是能正常工作的

{
"1": {
"start_text": "你好,我是陪伴兔,请问有什么我可以帮助你的吗?",
"prompt": "你扮演一个孩子的小伙伴,名字叫陪伴兔,性格和善,说话活泼可爱,对孩子充满爱心,经常赞赏和鼓励孩子,用5岁孩子容易理解语言提供有趣和创新的回答,每次回复根据聊天主题询问她的看法以激发她的思考和好奇心。"
},
"2": {
"start_text": "你好,俺是东北兔,请问有什么俺可以帮助你的吗?",
"prompt": "你是一个知识渊博,乐于助人的智能机器人,你的名字叫“东北兔”,你的任务是陪我聊天,请用简短的对话方式,用中文讲一段话,每次回答不超过50个字!"
},
"3": {
"start_text": "Hi, I'm Fofo. Nice to meet you.",
"prompt": "You're a knowledgeable and helpful AI named "Fofo". Your task is to chat with me. Please respond in English, keeping your answers brief – no more than 50 words each time!"
},
"4": {
"start_text": "你好,额是夸夸兔,请问有什么额可以帮助你的吗? ",
"prompt": "夸夸我"
},
"5": {
"start_text": "你好,我是口算兔,我们一起来玩玩口算游戏吧?",
"prompt": "我是一个6岁小朋友,你陪我玩口算游戏。你出题,我回答结果。如果答对了你就说好棒,答错了你就告诉我正确答案,并且鼓励我。你一题一题的出,我一个个回答。不要有太多的解释说明。明白了吗?"
},
"6": {
"start_text": "你好,我是**兔,请问有什么我可以帮助你的吗?",
"prompt": "你是一个知识渊博,乐于助人的智能机器人,你的名字叫“**兔”,你的任务是陪我聊天,请用简短的对话方式,用中文讲一段话,每次回答不超过50个字!"
},
"7": {
"start_text": "你好,我是小兔,请问有什么我可以帮助你的吗?",
"prompt": "你是一个知识渊博,乐于助人的智能机器人,你的名字叫“小兔”,你的任务是陪我聊天,请用简短的对话方式,用中文讲一段话,每次回答不超过50个字!"
}
}

但我另外设置roles.json。因为我想设置为粤语,设置如下。就是出现错误。对应语言代码,我是在azure上查询的

分别是yue-CN, 和 zh-HK.

不能正常工作,请查看是什么问题?

    "start_text": "你好,我是小兔兔,请问有什么我可以帮助你的吗?",

"prompt": "你扮演一个孩子的小伙伴,名字叫小兔兔,性格和善,说话活泼可爱,对孩子充满爱心,经常赞赏和鼓励孩子,用6岁孩子容易理解语言提供有趣和创新的回答,每次回复根据聊天主题询问她的看法以激发她的思考和好奇心,现在她来到了你身边问了第一个问题:[你是谁]",
"max_message_count": 3,
"stt_type": "azure-stt",
"llm_type": "moonshot",
"tts_type": "azure-tts",
"stt_config": {
"language": "yue-CN",
"key": "11exxxxxxxxx4",
"service_region": "eastus"
},
"llm_config": {
"api_base": "https://api.moonshot.cn/v1",
"model": "moonshot-v1-8k",
"key": "sk-QMxxxxxxxxx"
},
"tts_config": {
"key": "46004xxxxx",
"service_region": "eastasia",
"voice_name": "zh-HK"
}
}

错误如下,如果我把roles.json又改为默认的,又能正常工作。
I: record start button pressed
FSM=====================idle_exit==================================
FSM=====================atob========================================
FSM=====================record_enter==================================
I: [EVENT] ROBOT_LISTEN
[I] AnalogAudio.h : 58 - bool audio_tools::AnalogAudioStream::begin(audio_tools::AnalogConfig)
[I] AnalogAudioESP32.h : 48 - virtual bool audio_tools::AnalogDriverESP32::begin(audio_tools::AnalogConfig)
[I] AudioTypes.h : 88 - sample_rate: 32000
[I] AudioTypes.h : 89 - channels: 1
[I] AudioTypes.h : 90 - bits_per_sample: 16
[I] AnalogAudioBase.h : 79 - input pin1: 35
[I] AnalogAudioESP32.h : 52 - auto_center
[I] AnalogAudioESP32.h : 95 - RX_MODE
[I] MyStreamCopy.h : 143 - StreamCopy::copy 1024 -> 1024 -> 1024 bytes - in 1 hops
[I] MyStreamCopy.h : 143 - StreamCopy::copy 1024 -> 1024 -> 1024 bytes - in 1 hops
[I] MyStreamCopy.h : 143 - StreamCopy::copy 1024 -> 1024 -> 1024 bytes - in 1 hops
[I] MyStreamCopy.h : 143 - StreamCopy::copy 1024 -> 1024 -> 1024 bytes - in 1 hops
[I] MyStreamCopy.h : 143 - StreamCopy::copy 1024 -> 1024 -> 1024 bytes - in 1 hops
[I] MyStreamCopy.h : 143 - StreamCopy::copy 1024 -> 1024 -> 1024 bytes - in 1 hops
[I] MyStreamCopy.h : 143 - StreamCopy::copy 1024 -> 1024 -> 1024 bytes - in 1 hops
[I] MyStreamCopy.h : 143 - StreamCopy::copy 1024 -> 1024 -> 1024 bytes - in 1 hops
[I] MyStreamCopy.h : 143 - StreamCopy::copy 1024 -> 1024 -> 1024 bytes - in 1 hops
[I] MyStreamCopy.h : 143 - StreamCopy::copy 1024 -> 1024 -> 1024 bytes - in 1 hops
[I] MyStreamCopy.h : 143 - StreamCopy::copy 1024 -> 1024 -> 1024 bytes - in 1 hops
[I] MyStreamCopy.h : 143 - StreamCopy::copy 1024 -> 1024 -> 1024 bytes - in 1 hops
[I] MyStreamCopy.h : 143 - StreamCopy::copy 1024 -> 1024 -> 1024 bytes - in 1 hops
[I] MyStreamCopy.h : 143 - StreamCopy::copy 1024 -> 1024 -> 1024 bytes - in 1 hops
[I] MyStreamCopy.h : 143 - StreamCopy::copy 1024 -> 1024 -> 1024 bytes - in 1 hops
[I] MyStreamCopy.h : 143 - StreamCopy::copy 1024 -> 1024 -> 1024 bytes - in 1 hops
[I] MyStreamCopy.h : 143 - StreamCopy::copy 1024 -> 1024 -> 1024 bytes - in 1 hops
[I] MyStreamCopy.h : 143 - StreamCopy::copy 1024 -> 1024 -> 1024 bytes - in 1 hops
[I] MyStreamCopy.h : 143 - StreamCopy::copy 1024 -> 1024 -> 1024 bytes - in 1 hops
[I] MyStreamCopy.h : 143 - StreamCopy::copy 1024 -> 1024 -> 1024 bytes - in 1 hops
[I] MyStreamCopy.h : 143 - StreamCopy::copy 1024 -> 1024 -> 1024 bytes - in 1 hops
[I] MyStreamCopy.h : 143 - StreamCopy::copy 1024 -> 1024 -> 1024 bytes - in 1 hops
[I] MyStreamCopy.h : 143 - StreamCopy::copy 1024 -> 1024 -> 1024 bytes - in 1 hops
[I] MyStreamCopy.h : 143 - StreamCopy::copy 1024 -> 1024 -> 1024 bytes - in 1 hops
[I] MyStreamCopy.h : 143 - StreamCopy::copy 1024 -> 1024 -> 1024 bytes - in 1 hops
[I] MyStreamCopy.h : 143 - StreamCopy::copy 1024 -> 1024 -> 1024 bytes - in 1 hops
[I] MyStreamCopy.h : 143 - StreamCopy::copy 1024 -> 1024 -> 1024 bytes - in 1 hops
[I] MyStreamCopy.h : 143 - StreamCopy::copy 1024 -> 1024 -> 1024 bytes - in 1 hops
[I] MyStreamCopy.h : 143 - StreamCopy::copy 1024 -> 1024 -> 1024 bytes - in 1 hops
[I] MyStreamCopy.h : 143 - StreamCopy::copy 1024 -> 1024 -> 1024 bytes - in 1 hops
[I] MyStreamCopy.h : 143 - StreamCopy::copy 1024 -> 1024 -> 1024 bytes - in 1 hops
[I] MyStreamCopy.h : 143 - StreamCopy::copy 1024 -> 1024 -> 1024 bytes - in 1 hops
[I] MyStreamCopy.h : 143 - StreamCopy::copy 1024 -> 1024 -> 1024 bytes - in 1 hops
[I] MyStreamCopy.h : 143 - StreamCopy::copy 1024 -> 1024 -> 1024 bytes - in 1 hops
[I] MyStreamCopy.h : 143 - StreamCopy::copy 1024 -> 1024 -> 1024 bytes - in 1 hops
[I] MyStreamCopy.h : 143 - StreamCopy::copy 1024 -> 1024 -> 1024 bytes - in 1 hops
[I] MyStreamCopy.h : 143 - StreamCopy::copy 1024 -> 1024 -> 1024 bytes - in 1 hops
I: record end button pressed
FSM=====================record_exit==================================
[I] AnalogAudio.h : 64 - virtual void audio_tools::AnalogAudioStream::end()
[I] AnalogAudioESP32.h : 137 - end
FSM=====================atob========================================
FSM=====================wait_enter==================================
I: [EVENT] ROBOT_THINK
I: local audio url:/audio/default/record-over.mp3
I: local audio change:0

Timeout for 30 seconds!
FSM=====================wait_exit==================================
FSM=====================atob========================================
FSM=====================idle_enter==================================
I: [EVENT] ROBOT_IDLE

azure tts 的voice name需要填完整,yue-ZH-xxx

改了,还是一样。改的如下,只有一个角色。问题和没改voice name一样的,

{
"start_text": "你好,我是小兔兔,请问有什么我可以帮助你的吗?",
"prompt": "你扮演一个孩子的小伙伴,名字叫小兔兔,性格和善,说话活泼可爱,对孩子充满爱心,经常赞赏和鼓励孩子,用6岁孩子容易理解语言提供有趣和创新的回答,每次回复根据聊天主题询问她的看法以激发她的思考和好奇心,现在她来到了你身边问了第一个问题:[你是谁]",
"max_message_count": 3,
"stt_type": "azure-stt",
"llm_type": "moonshot",
"tts_type": "azure-tts",
"stt_config": {
"language": "yue-HK",
"key": "11e21xxxxc67a4",
"service_region": "eastus"
},
"llm_config": {
"api_base": "https://api.moonshot.cn/v1",
"model": "moonshot-v1-8k",
"key": "sk-QM2o5Exxxxx"
},
"tts_config": {
"key": "460xxxxxx583b",
"service_region": "eastasia",
"voice_name": "zh-HK-WanLungNeural"
}
}

看下server的日志,用docker compose logs命令看。

已解决了,yue-HK的问题,。改了就行。

另外,azure-tts或stt,能在阿里云的vps访问到吗?谢谢。

已解决了,yue-HK的问题,。改了就行。

另外,azure-tts或stt,能在阿里云的vps访问到吗?谢谢。

可以的