Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Qwen-1_8B-Chat-Int8 调用失败。 #1725

Open
HougeLangley opened this issue Apr 19, 2024 · 1 comment
Open

[Bug]: Qwen-1_8B-Chat-Int8 调用失败。 #1725

HougeLangley opened this issue Apr 19, 2024 · 1 comment

Comments

@HougeLangley
Copy link
Contributor

Installation Method | 安装方法与平台

Pip Install (I used latest requirements.txt)

Version | 版本

Latest | 最新版

OS | 操作系统

Linux

Describe the bug | 简述

使用 git 版本的 gpt_academic ,在 virtualenv 环境中使用以下两个命令完成环境搭建

python -m pip install -r requirements.txt
pip install -r request_llms/requirements_qwen_local.txt

完成后,显卡显存是8G的 RTX4060 ,能正常加载模型,但报错。后续截图和详细回报。

终端运行命令时的提示:

(gpt_academic) ╭─hougelangley at Arch-Legion in ~/gpt_academic on master✘✘✘ 24-04-19 - 23:39:43
╰─(gpt_academic) ⠠⠵ python main.py
 [PROXY] 网络代理状态:未配置。无代理状态下很可能无法访问OpenAI家族的模型。建议:检查USE_PROXY选项是否修改。
所有对话记录将自动保存在本地目录gpt_log/admin/chat_secrets.log, 请注意自我隐私保护哦!
代理配置 无, 代理所在地:China - China Mobile communications corporation
 [API_KEY] 本项目现已支持OpenAI和Azure的api-key。也支持同时填写多个api-key,如API_KEY="openai-key1,openai-key2,azure-key3"
 [API_KEY] 您既可以在config.py中修改api-key(s),也可以在问题输入区输入临时的api-key(s),然后回车键提交后即可生效。
 [API_KEY] 您的 API_KEY 是: sk-O9rNizrw8AXQ*** API_KEY 导入成功
如果浏览器没有自动打开,请复制并转到以下URL:
	「暗色主题已启用(支持动态切换主题)」: http://localhost:3333
正在执行一些模块的预热 ...
正在加载tokenizer,如果是第一次运行,可能需要一点时间下载参数
加载tokenizer完毕
正在加载tokenizer,如果是第一次运行,可能需要一点时间下载参数
加载tokenizer完毕
2024-04-19 23:39:57,980 - modelscope - INFO - PyTorch version 2.2.0 Found.
2024-04-19 23:39:57,981 - modelscope - INFO - Loading ast index from /home/hougelangley/.cache/modelscope/ast_indexer
2024-04-19 23:39:57,995 - modelscope - INFO - Loading done! Current index file version is 1.13.3, with md5 8e7bc14175bf9508a0c14ca3444bf8bd and a total number of 972 components indexed

学术优化中窗口提示:

Traceback (most recent call last):
  File "./request_llms/local_llm_class.py", line 159, in run
    for response_full in self.llm_stream_generator(**kwargs):
  File "./request_llms/bridge_qwen_local.py", line 46, in llm_stream_generator
    for response in self._model.chat_stream(self._tokenizer, query, history=history):
  File "/home/hougelangley/.cache/huggingface/modules/transformers_modules/Qwen/Qwen-1_8B-Chat-Int8/2fb5c225fe592d8d891cbf6c1ed5924cabe48a18/modeling_qwen.py", line 1214, in stream_generator
    for token in self.generate_stream(
  File "./lib/python3.11/site-packages/torch/utils/_contextlib.py", line 35, in generator_context
    response = gen.send(None)
               ^^^^^^^^^^^^^^
  File "./lib/python3.11/site-packages/transformers_stream_generator/main.py", line 972, in sample_stream
    next_tokens = torch.multinomial(probs, num_samples=1).squeeze(1)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: probability tensor contains either `inf`, `nan` or element < 0

Screen Shot | 有帮助的截图

屏幕截图_20240419_234752

Terminal Traceback & Material to Help Reproduce Bugs | 终端traceback(如有) + 帮助我们复现的测试材料样本(如有)

No response

@HougeLangley
Copy link
Contributor Author

屏幕截图_20240419_234929

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant