Replies: 1 comment 1 reply
-
cpu不能用half,要用fp16 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
先是给模型取了个名字,取名两次之后,模型记住了。后面多次询问,结果模型每次回答带出来的答案会附上历史问答记录,问了十来次之后,就再也不回答了,变成一直报错:RuntimeError: "addmm_impl_cpu_" not implemented for 'Half',这是个啥问题。咋解决呢?
Traceback:
File "C:\Users\apep-dev5\anaconda3\envs\chatglm3\lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 535, in _run_script
exec(code, module.dict)
File "D:\jf\ChatGLM3-main\basic_demo\web_demo_streamlit.py", line 74, in
for response, history, past_key_values in model.stream_chat(
File "C:\Users\apep-dev5\anaconda3\envs\chatglm3\lib\site-packages\torch\utils_contextlib.py", line 35, in generator_context
response = gen.send(None)
File "C:\Users\apep-dev5.cache\huggingface\modules\transformers_modules\THUDM\chatglm3-6b\b098244a71fbe69ce149682d9072a7629f7e908c\modeling_chatglm.py", line 1072, in stream_chat
for outputs in self.stream_generate(**inputs, past_key_values=past_key_values,
File "C:\Users\apep-dev5\anaconda3\envs\chatglm3\lib\site-packages\torch\utils_contextlib.py", line 35, in generator_context
response = gen.send(None)
File "C:\Users\apep-dev5.cache\huggingface\modules\transformers_modules\THUDM\chatglm3-6b\b098244a71fbe69ce149682d9072a7629f7e908c\modeling_chatglm.py", line 1159, in stream_generate
outputs = self(
File "C:\Users\apep-dev5\anaconda3\envs\chatglm3\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "C:\Users\apep-dev5\anaconda3\envs\chatglm3\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "C:\Users\apep-dev5.cache\huggingface\modules\transformers_modules\THUDM\chatglm3-6b\b098244a71fbe69ce149682d9072a7629f7e908c\modeling_chatglm.py", line 937, in forward
transformer_outputs = self.transformer(
File "C:\Users\apep-dev5\anaconda3\envs\chatglm3\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "C:\Users\apep-dev5\anaconda3\envs\chatglm3\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "C:\Users\apep-dev5.cache\huggingface\modules\transformers_modules\THUDM\chatglm3-6b\b098244a71fbe69ce149682d9072a7629f7e908c\modeling_chatglm.py", line 830, in forward
hidden_states, presents, all_hidden_states, all_self_attentions = self.encoder(
File "C:\Users\apep-dev5\anaconda3\envs\chatglm3\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "C:\Users\apep-dev5\anaconda3\envs\chatglm3\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "C:\Users\apep-dev5.cache\huggingface\modules\transformers_modules\THUDM\chatglm3-6b\b098244a71fbe69ce149682d9072a7629f7e908c\modeling_chatglm.py", line 640, in forward
layer_ret = layer(
File "C:\Users\apep-dev5\anaconda3\envs\chatglm3\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "C:\Users\apep-dev5\anaconda3\envs\chatglm3\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "C:\Users\apep-dev5.cache\huggingface\modules\transformers_modules\THUDM\chatglm3-6b\b098244a71fbe69ce149682d9072a7629f7e908c\modeling_chatglm.py", line 544, in forward
attention_output, kv_cache = self.self_attention(
File "C:\Users\apep-dev5\anaconda3\envs\chatglm3\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "C:\Users\apep-dev5\anaconda3\envs\chatglm3\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "C:\Users\apep-dev5.cache\huggingface\modules\transformers_modules\THUDM\chatglm3-6b\b098244a71fbe69ce149682d9072a7629f7e908c\modeling_chatglm.py", line 376, in forward
mixed_x_layer = self.query_key_value(hidden_states)
File "C:\Users\apep-dev5\anaconda3\envs\chatglm3\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "C:\Users\apep-dev5\anaconda3\envs\chatglm3\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "C:\Users\apep-dev5\anaconda3\envs\chatglm3\lib\site-packages\torch\nn\modules\linear.py", line 114, in forward
return F.linear(input, self.weight, self.bias)
Beta Was this translation helpful? Give feedback.
All reactions