zhuchuangang / chat_speech

ChatGLM-6B+PaddleSpeech | 语音对话机器人
Apache License 2.0
8 stars 1 forks source link

不管语音输入还是文字输入,Web界面在接收输入后,转换输出应答和语音时,Python程序就自动退出了,Web反馈未连接,三个输出框都报error #1

Closed wikeeyang closed 1 year ago

wikeeyang commented 1 year ago

环境: Windows 11 x64 NVIDIA P3200 6GB显卡,驱动程序最新版。 32GB 内存 Python 3.9.6 CUDA 11.7/11.8都有 cuDNN 8.4.1/8.5.0/8.8.1/8.9都有,通过改path路径切换 ChatGLM-6b-int4 PaddleSpeech 没有使用anconda,自己通过bat脚本,切换Python环境,机器上有3.9/3.10/3.11多个环境,切换都正常,不会干扰。 之前已经调好对话模型各种环境,试过ChatGLM-6B及int4、闻达RWKV、Replitcode、GPT4ALL等,在多个Python环境中也都没问题,PaddlePaddle2.4.2,在CUDA11.7、cuDNN8.4.1官方要求环境下,手工安装,PaddleSpeech也是手工安装测试,完全正常,根据版主Readme对照,环境基本具备。 依据版主提示进行文字转语音命令行测试,虽有警告信息,但结果正常。如下:(根据警告信息,cuDNN环境升为8.5)。

D:\AITest\PaddleSpeech\ChatGLM6B-Speech>paddlespeech tts --input "今天天气不好,我们暂时就先不约了,等什么时候有时间了,我给你打电话" --output opoint.wav C:\Python\Python39\lib\site-packages\pkg_resources__init.py:121: DeprecationWarning: pkg_resources is deprecated as an API warnings.warn("pkg_resources is deprecated as an API", DeprecationWarning) C:\Python\Python39\lib\site-packages\pkg_resources__init.py:2870: DeprecationWarning: Deprecated call to pkg_resources.declare_namespace('google'). Implementing implicit namespace packages (as specified in PEP 420) is preferred to pkg_resources.declare_namespace. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages declare_namespace(pkg) C:\Python\Python39\lib\site-packages\pkg_resources__init__.py:2870: DeprecationWarning: Deprecated call to pkg_resources.declare_namespace('mpl_toolkits'). Implementing implicit namespace packages (as specified in PEP 420) is preferred to pkg_resources.declare_namespace. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages declare_namespace(pkg) C:\Python\Python39\lib\site-packages\pkg_resources\init__.py:2870: DeprecationWarning: Deprecated call to pkg_resources.declare_namespace('google'). Implementing implicit namespace packages (as specified in PEP 420) is preferred to pkg_resources.declare_namespace. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages declare_namespace(pkg) C:\Python\Python39\lib\site-packages\librosa\core\constantq.py:1059: DeprecationWarning: np.complex is a deprecated alias for the builtin complex. To silence this warning, use complex by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.complex128 here. Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations dtype=np.complex, C:\Python\Python39\lib\site-packages_distutils_hack\init__.py:33: UserWarning: Setuptools is replacing distutils. warnings.warn("Setuptools is replacing distutils.") W0509 07:36:24.462970 14632 gpu_resources.cc:61] Please NOTE: device: 0, GPU Compute Capability: 6.1, Driver API Version: 12.0, Runtime API Version: 11.7 W0509 07:36:24.494622 14632 gpu_resources.cc:91] device: 0, cuDNN Version: 8.5. D:\AITest\PaddleSpeech\ChatGLM6B-Speech\opoint.wav

针对版主脚本,仅修改ChatGLM-6B-int4模型路径,我将所有模型文件,分类放在硬盘一个目录下。以及Gradio调用的IP地址和端口。 tokenizer = AutoTokenizer.from_pretrained("D:\AITest\Model\chatglm-6b-int4", trust_remote_code=True, revision="") model = AutoModel.from_pretrained("D:\AITest\Model\chatglm-6b-int4", trust_remote_code=True, revision="").half().cuda()

gradio_app.launch(share=False, inbrowser=True, server_name="127.0.0.1", server_port=8888)

其它都未改。

执行及报错信息如下:

W0509 07:36:24.494622 14632 gpu_resources.cc:91] device: 0, cuDNN Version: 8.5. D:\AITest\PaddleSpeech\ChatGLM6B-Speech\opoint.wav D:\AITest\PaddleSpeech\ChatGLM6B-Speech>python mywebui.py C:\Python\Python39\lib\site-packages\librosa\core\constantq.py:1059: DeprecationWarning: np.complex is a deprecated alias for the builtin complex. To silence this warning, use complex by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.complex128 here. Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations dtype=np.complex, C:\Python\Python39\lib\site-packages_distutils_hack__init__.py:33: UserWarning: Setuptools is replacing distutils. warnings.warn("Setuptools is replacing distutils.") No compiled kernel found. Compiling kernels : C:\Users\Administrator.cache\huggingface\modules\transformers_modules\chatglm-6b-int4\quantization_kernels_parallel.c Compiling gcc -O3 -fPIC -pthread -fopenmp -std=c99 C:\Users\Administrator.cache\huggingface\modules\transformers_modules\chatglm-6b-int4\quantization_kernels_parallel.c -shared -o C:\Users\Administrator.cache\huggingface\modules\transformers_modules\chatglm-6b-int4\quantization_kernels_parallel.so Load kernel : C:\Users\Administrator.cache\huggingface\modules\transformers_modules\chatglm-6b-int4\quantization_kernels_parallel.so Setting CPU quantization kernel threads to 6 Using quantization cache Applying quantization to glm layers Running on local URL: http://127.0.0.1:8888

To create a public link, set share=True in launch(). [2023-05-09 08:20:53,875] [ WARNING] logging.py:295 - The dtype of attention mask (torch.int64) is not bool [2023-05-09 08:21:17,522] [ INFO] - Already cached C:\Users\Administrator.paddlenlp\models\bert-base-chinese\bert-base-chinese-vocab.txt [2023-05-09 08:21:17,539] [ INFO] - tokenizer config file saved in C:\Users\Administrator.paddlenlp\models\bert-base-chinese\tokenizer_config.json [2023-05-09 08:21:17,539] [ INFO] - Special tokens file saved in C:\Users\Administrator.paddlenlp\models\bert-base-chinese\special_tokens_map.json W0509 08:21:20.251111 16368 gpu_resources.cc:61] Please NOTE: device: 0, GPU Compute Capability: 6.1, Driver API Version: 12.0, Runtime API Version: 11.7 W0509 08:21:20.261677 16368 gpu_resources.cc:91] device: 0, cuDNN Version: 8.5.

D:\AITest\PaddleSpeech\ChatGLM6B-Speech>

屏幕截图: 运行中: image 报错后: image

烦请版主帮我分析分析可能出错的原因,谢谢!

wikeeyang commented 1 year ago

我分析了一下,语音输入时,录音和语音格式转换是正常的,但没有接收到ChatGLM-6B模型的输出文字和语音转换;文字输入时,也没有接收到模型的应答输出,以及将应答文字转换成语音;所以怀疑问题可能出在模型应答输出的信息接收和语音转换输出时,系统崩了、退出了。

语音输入接收的语音和转换的结果: image

文字输入则没有产生输出和结果: image

以上补充信息,供您参考,请帮忙分析一下,谢谢!

wikeeyang commented 1 year ago

已经通过分别在两台机器上部署ChatGLM-6B、PaddleSpeech,并改用API调用ChatGLM-6B问答的方式解决。

zhuchuangang commented 1 year ago

可能是显存不够,我用的是3060 12G的显卡,从chatglm的回复加生成语音的时间首次大概要30多秒以上,chatglm和paddlespeech都挺吃显存的。

SSSdeicy commented 5 months ago

这是来自QQ邮箱的假期自动回复邮件。   您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。