Traceback (most recent call last):
File "d:\code\PythonCode\py39\lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 552, in _run_script
exec(code, module.dict)
File "D:\code\PythonCode\ChatGLM2-6B\web_demo2.py", line 62, in
for response, history, past_key_values in model.stream_chat(tokenizer, prompt_text, history,
File "d:\code\PythonCode\py39\lib\site-packages\torch\utils_contextlib.py", line 35, in generator_context
response = gen.send(None)
File "C:\Users\45567/.cache\huggingface\modules\transformers_modules\chatglm2-6b\modeling_chatglm.py", line 1311, in stream_chat
for outputs in self.stream_generate(inputs, gen_kwargs):
File "d:\code\PythonCode\py39\lib\site-packages\torch\utils_contextlib.py", line 35, in generator_context
response = gen.send(None)
File "C:\Users\45567/.cache\huggingface\modules\transformers_modules\chatglm2-6b\modeling_chatglm.py", line 1388, in stream_generate
outputs = self(
File "d:\code\PythonCode\py39\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
return forward_call(*args, kwargs)
File "C:\Users\45567/.cache\huggingface\modules\transformers_modules\chatglm2-6b\modeling_chatglm.py", line 1190, in forward
transformer_outputs = self.transformer(
File "d:\code\PythonCode\py39\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
return forward_call(*args, *kwargs)
File "C:\Users\45567/.cache\huggingface\modules\transformers_modules\chatglm2-6b\modeling_chatglm.py", line 996, in forward
layer_ret = layer(
File "d:\code\PythonCode\py39\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
return forward_call(args, kwargs)
File "C:\Users\45567/.cache\huggingface\modules\transformers_modules\chatglm2-6b\modeling_chatglm.py", line 624, in forward
attention_input = self.input_layernorm(hidden_states)
File "d:\code\PythonCode\py39\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "d:\code\PythonCode\py39\lib\site-packages\torch\nn\modules\normalization.py", line 190, in forward
return F.layer_norm(
File "d:\code\PythonCode\py39\lib\site-packages\torch\nn\functional.py", line 2515, in layer_norm
return torch.layer_norm(input, normalized_shape, weight, bias, eps, torch.backends.cudnn.enabled)
RuntimeError: expected scalar type Half but found Float
Is there an existing issue for this?
Current Behavior
Traceback (most recent call last): File "d:\code\PythonCode\py39\lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 552, in _run_script exec(code, module.dict) File "D:\code\PythonCode\ChatGLM2-6B\web_demo2.py", line 62, in
for response, history, past_key_values in model.stream_chat(tokenizer, prompt_text, history,
File "d:\code\PythonCode\py39\lib\site-packages\torch\utils_contextlib.py", line 35, in generator_context
response = gen.send(None)
File "C:\Users\45567/.cache\huggingface\modules\transformers_modules\chatglm2-6b\modeling_chatglm.py", line 1311, in stream_chat
for outputs in self.stream_generate(inputs, gen_kwargs):
File "d:\code\PythonCode\py39\lib\site-packages\torch\utils_contextlib.py", line 35, in generator_context
response = gen.send(None)
File "C:\Users\45567/.cache\huggingface\modules\transformers_modules\chatglm2-6b\modeling_chatglm.py", line 1388, in stream_generate
outputs = self(
File "d:\code\PythonCode\py39\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
return forward_call(*args, kwargs)
File "C:\Users\45567/.cache\huggingface\modules\transformers_modules\chatglm2-6b\modeling_chatglm.py", line 1190, in forward
transformer_outputs = self.transformer(
File "d:\code\PythonCode\py39\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
return forward_call(*args, *kwargs)
File "C:\Users\45567/.cache\huggingface\modules\transformers_modules\chatglm2-6b\modeling_chatglm.py", line 996, in forward
layer_ret = layer(
File "d:\code\PythonCode\py39\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
return forward_call(args, kwargs)
File "C:\Users\45567/.cache\huggingface\modules\transformers_modules\chatglm2-6b\modeling_chatglm.py", line 624, in forward
attention_input = self.input_layernorm(hidden_states)
File "d:\code\PythonCode\py39\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "d:\code\PythonCode\py39\lib\site-packages\torch\nn\modules\normalization.py", line 190, in forward
return F.layer_norm(
File "d:\code\PythonCode\py39\lib\site-packages\torch\nn\functional.py", line 2515, in layer_norm
return torch.layer_norm(input, normalized_shape, weight, bias, eps, torch.backends.cudnn.enabled)
RuntimeError: expected scalar type Half but found Float
Expected Behavior
No response
Steps To Reproduce
正常安装并运行,在win11
Environment
Anything else?
No response