zhaoyingjun / chatbot

ChatGPT带火了聊天机器人,主流的趋势都调整到了GPT类模式,本项目也与时俱进,会在近期更新GPT类版本。基于本项目和自己的语料可以训练出自己想要的聊天机器人,用于智能客服、在线问答、闲聊等场景。
3.53k stars 1.02k forks source link

运行app.py时出现error calling function #170

Open pxlm570 opened 1 year ago

pxlm570 commented 1 year ago

运行app.py时出现error calling function,报错信息如下: 192.168.160.211 - - [24/Oct/2023 15:11:15] "GET / HTTP/1.1" 200 - 192.168.160.211 - - [24/Oct/2023 15:11:15] "GET /static/res/hd2.jpg HTTP/1.1" 404 - Building prefix dict from the default dictionary ... Loading model from cache C:\Users\86181\AppData\Local\Temp\jieba.cache Loading model cost 0.654 seconds. Prefix dict has been built successfully. [2023-10-24 15:11:19,667] ERROR in app: Exception on /message [POST] Traceback (most recent call last): File "D:\Anaconda\lib\site-packages\flask\app.py", line 2447, in wsgi_app response = self.full_dispatch_request() File "D:\Anaconda\lib\site-packages\flask\app.py", line 1952, in full_dispatch_request rv = self.handle_user_exception(e) File "D:\Anaconda\lib\site-packages\flask\app.py", line 1821, in handle_user_exception reraise(exc_type, exc_value, tb) File "D:\Anaconda\lib\site-packages\flask_compat.py", line 39, in reraise raise value File "D:\Anaconda\lib\site-packages\flask\app.py", line 1950, in full_dispatch_request rv = self.dispatch_request() File "D:\Anaconda\lib\site-packages\flask\app.py", line 1936, in dispatch_request return self.view_functionsrule.endpoint File "C:\Users\86181\Desktop\Seq2SeqChatbot\web\app.py", line 43, in reply res_msg = execute.predict(req_msg) File "C:\Users\86181\Desktop\Seq2SeqChatbot\execute.py", line 124, in predict checkpoint=torch.load(checkpoint_prefix) File "D:\Anaconda\lib\site-packages\torch\serialization.py", line 771, in load with _open_file_like(f, 'rb') as opened_file: File "D:\Anaconda\lib\site-packages\torch\serialization.py", line 270, in _open_file_like return _open_file(name_or_buffer, mode) File "D:\Anaconda\lib\site-packages\torch\serialization.py", line 251, in init super(_open_file, self).init(open(name, mode)) FileNotFoundError: [Errno 2] No such file or directory: 'model_data.pt' 192.168.160.211 - - [24/Oct/2023 15:11:19] "POST /message HTTP/1.1" 500 -

请问是'model_data.pt'存在问题吗,或者说问题出在execute.py中predict函数的checkpoint=torch.load(checkpoint_prefix)语句? 后面的报错"POST /message HTTP/1.1" 500 -指的是什么意思呢? 请问如何解决该问题?

pxlm570 commented 1 year ago

采用的是pytorch版本

Kai666333 commented 6 months ago

解决了吗

Fuji-021 commented 6 months ago

你好,请问现在解决了吗,大佬请问一下这个网页模型我该如何部署呢