api 调用您的模型出现错误

#10
by neteasy - opened

https://github.com/labring/FastGPT/blob/main/files/models/ChatGLM2/openai_api.py

基于这个api加载您的模型,出现错误:log如下:
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/nn/modules/normalization.py", line 190, in forward
return F.layer_norm(
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/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
INFO: 172.18.0.3:52128 - "POST /v1/chat/completions HTTP/1.1" 500 Internal Server Error
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/uvicorn/protocols/http/h11_impl.py", line 428, in run_asgi
result = await app( # type: ignore[func-returns-value]
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in call
return await self.app(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/fastapi/applications.py", line 289, in call
await super().call(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/applications.py", line 122, in call
await self.middleware_stack(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/middleware/errors.py", line 184, in call
raise exc
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/middleware/errors.py", line 162, in call
await self.app(scope, receive, _send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/middleware/cors.py", line 83, in call
await self.app(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/middleware/exceptions.py", line 79, in call
raise exc
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/middleware/exceptions.py", line 68, in call
await self.app(scope, receive, sender)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/fastapi/middleware/asyncexitstack.py", line 20, in call
raise e
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/fastapi/middleware/asyncexitstack.py", line 17, in call
await self.app(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/routing.py", line 718, in call
await route.handle(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/routing.py", line 276, in handle
await self.app(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/routing.py", line 66, in app
response = await func(request)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/fastapi/routing.py", line 273, in app
raw_response = await run_endpoint_function(
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/fastapi/routing.py", line 190, in run_endpoint_function
return await dependant.call(**values)
File "/www/wwwroot/chatglm2/apifast.py", line 139, in create_chat_completion
response, _ = model.chat(tokenizer, query, history=history)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "/root/.cache/huggingface/modules/transformers_modules/chatglm/modeling_chatglm.py", line 1285, in chat
outputs = self.generate(**inputs, **gen_kwargs)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/transformers/generation/utils.py", line 1572, in generate
return self.sample(
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/transformers/generation/utils.py", line 2619, in sample
outputs = self(
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/root/.cache/huggingface/modules/transformers_modules/chatglm/modeling_chatglm.py", line 1190, in forward
transformer_outputs = self.transformer(
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/root/.cache/huggingface/modules/transformers_modules/chatglm/modeling_chatglm.py", line 996, in forward
layer_ret = layer(
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/root/.cache/huggingface/modules/transformers_modules/chatglm/modeling_chatglm.py", line 624, in forward
attention_input = self.input_layernorm(hidden_states)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/nn/modules/normalization.py", line 190, in forward
return F.layer_norm(
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/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
INFO: 172.18.0.3:52130 - "POST /v1/chat/completions HTTP/1.1" 500 Internal Server Error
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/uvicorn/protocols/http/h11_impl.py", line 428, in run_asgi
result = await app( # type: ignore[func-returns-value]
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in call
return await self.app(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/fastapi/applications.py", line 289, in call
await super().call(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/applications.py", line 122, in call
await self.middleware_stack(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/middleware/errors.py", line 184, in call
raise exc
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/middleware/errors.py", line 162, in call
await self.app(scope, receive, _send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/middleware/cors.py", line 83, in call
await self.app(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/middleware/exceptions.py", line 79, in call
raise exc
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/middleware/exceptions.py", line 68, in call
await self.app(scope, receive, sender)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/fastapi/middleware/asyncexitstack.py", line 20, in call
raise e
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/fastapi/middleware/asyncexitstack.py", line 17, in call
await self.app(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/routing.py", line 718, in call
await route.handle(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/routing.py", line 276, in handle
await self.app(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/routing.py", line 66, in app
response = await func(request)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/fastapi/routing.py", line 273, in app
raw_response = await run_endpoint_function(
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/fastapi/routing.py", line 190, in run_endpoint_function
return await dependant.call(**values)
File "/www/wwwroot/chatglm2/apifast.py", line 139, in create_chat_completion
response, _ = model.chat(tokenizer, query, history=history)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "/root/.cache/huggingface/modules/transformers_modules/chatglm/modeling_chatglm.py", line 1285, in chat
outputs = self.generate(**inputs, **gen_kwargs)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/transformers/generation/utils.py", line 1572, in generate
return self.sample(
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/transformers/generation/utils.py", line 2619, in sample
outputs = self(
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/root/.cache/huggingface/modules/transformers_modules/chatglm/modeling_chatglm.py", line 1190, in forward
transformer_outputs = self.transformer(
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/root/.cache/huggingface/modules/transformers_modules/chatglm/modeling_chatglm.py", line 996, in forward
layer_ret = layer(
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/root/.cache/huggingface/modules/transformers_modules/chatglm/modeling_chatglm.py", line 624, in forward
attention_input = self.input_layernorm(hidden_states)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/nn/modules/normalization.py", line 190, in forward
return F.layer_norm(
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/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
INFO: 172.18.0.3:52134 - "POST /v1/chat/completions HTTP/1.1" 500 Internal Server Error
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/uvicorn/protocols/http/h11_impl.py", line 428, in run_asgi
result = await app( # type: ignore[func-returns-value]
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in call
return await self.app(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/fastapi/applications.py", line 289, in call
await super().call(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/applications.py", line 122, in call
await self.middleware_stack(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/middleware/errors.py", line 184, in call
raise exc
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/middleware/errors.py", line 162, in call
await self.app(scope, receive, _send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/middleware/cors.py", line 83, in call
await self.app(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/middleware/exceptions.py", line 79, in call
raise exc
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/middleware/exceptions.py", line 68, in call
await self.app(scope, receive, sender)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/fastapi/middleware/asyncexitstack.py", line 20, in call
raise e
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/fastapi/middleware/asyncexitstack.py", line 17, in call
await self.app(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/routing.py", line 718, in call
await route.handle(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/routing.py", line 276, in handle
await self.app(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/routing.py", line 66, in app
response = await func(request)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/fastapi/routing.py", line 273, in app
raw_response = await run_endpoint_function(
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/fastapi/routing.py", line 190, in run_endpoint_function
return await dependant.call(**values)
File "/www/wwwroot/chatglm2/apifast.py", line 139, in create_chat_completion
response, _ = model.chat(tokenizer, query, history=history)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "/root/.cache/huggingface/modules/transformers_modules/chatglm/modeling_chatglm.py", line 1285, in chat
outputs = self.generate(**inputs, **gen_kwargs)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/transformers/generation/utils.py", line 1572, in generate
return self.sample(
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/transformers/generation/utils.py", line 2619, in sample
outputs = self(
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/root/.cache/huggingface/modules/transformers_modules/chatglm/modeling_chatglm.py", line 1190, in forward
transformer_outputs = self.transformer(
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/root/.cache/huggingface/modules/transformers_modules/chatglm/modeling_chatglm.py", line 996, in forward
layer_ret = layer(
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/root/.cache/huggingface/modules/transformers_modules/chatglm/modeling_chatglm.py", line 624, in forward
attention_input = self.input_layernorm(hidden_states)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/nn/modules/normalization.py", line 190, in forward
return F.layer_norm(
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/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
INFO: 172.18.0.3:52140 - "POST /v1/chat/completions HTTP/1.1" 500 Internal Server Error
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/uvicorn/protocols/http/h11_impl.py", line 428, in run_asgi
result = await app( # type: ignore[func-returns-value]
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in call
return await self.app(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/fastapi/applications.py", line 289, in call
await super().call(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/applications.py", line 122, in call
await self.middleware_stack(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/middleware/errors.py", line 184, in call
raise exc
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/middleware/errors.py", line 162, in call
await self.app(scope, receive, _send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/middleware/cors.py", line 83, in call
await self.app(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/middleware/exceptions.py", line 79, in call
raise exc
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/middleware/exceptions.py", line 68, in call
await self.app(scope, receive, sender)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/fastapi/middleware/asyncexitstack.py", line 20, in call
raise e
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/fastapi/middleware/asyncexitstack.py", line 17, in call
await self.app(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/routing.py", line 718, in call
await route.handle(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/routing.py", line 276, in handle
await self.app(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/routing.py", line 66, in app
response = await func(request)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/fastapi/routing.py", line 273, in app
raw_response = await run_endpoint_function(
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/fastapi/routing.py", line 190, in run_endpoint_function
return await dependant.call(**values)
File "/www/wwwroot/chatglm2/apifast.py", line 139, in create_chat_completion
response, _ = model.chat(tokenizer, query, history=history)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "/root/.cache/huggingface/modules/transformers_modules/chatglm/modeling_chatglm.py", line 1285, in chat
outputs = self.generate(**inputs, **gen_kwargs)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/transformers/generation/utils.py", line 1572, in generate
return self.sample(
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/transformers/generation/utils.py", line 2619, in sample
outputs = self(
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/root/.cache/huggingface/modules/transformers_modules/chatglm/modeling_chatglm.py", line 1190, in forward
transformer_outputs = self.transformer(
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/root/.cache/huggingface/modules/transformers_modules/chatglm/modeling_chatglm.py", line 996, in forward
layer_ret = layer(
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/root/.cache/huggingface/modules/transformers_modules/chatglm/modeling_chatglm.py", line 624, in forward
attention_input = self.input_layernorm(hidden_states)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/nn/modules/normalization.py", line 190, in forward
return F.layer_norm(
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/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
INFO: 172.18.0.3:52144 - "POST /v1/chat/completions HTTP/1.1" 500 Internal Server Error
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/uvicorn/protocols/http/h11_impl.py", line 428, in run_asgi
result = await app( # type: ignore[func-returns-value]
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in call
return await self.app(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/fastapi/applications.py", line 289, in call
await super().call(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/applications.py", line 122, in call
await self.middleware_stack(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/middleware/errors.py", line 184, in call
raise exc
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/middleware/errors.py", line 162, in call
await self.app(scope, receive, _send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/middleware/cors.py", line 83, in call
await self.app(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/middleware/exceptions.py", line 79, in call
raise exc
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/middleware/exceptions.py", line 68, in call
await self.app(scope, receive, sender)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/fastapi/middleware/asyncexitstack.py", line 20, in call
raise e
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/fastapi/middleware/asyncexitstack.py", line 17, in call
await self.app(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/routing.py", line 718, in call
await route.handle(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/routing.py", line 276, in handle
await self.app(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/routing.py", line 66, in app
response = await func(request)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/fastapi/routing.py", line 273, in app
raw_response = await run_endpoint_function(
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/fastapi/routing.py", line 190, in run_endpoint_function
return await dependant.call(**values)
File "/www/wwwroot/chatglm2/apifast.py", line 139, in create_chat_completion
response, _ = model.chat(tokenizer, query, history=history)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "/root/.cache/huggingface/modules/transformers_modules/chatglm/modeling_chatglm.py", line 1285, in chat
outputs = self.generate(**inputs, **gen_kwargs)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/transformers/generation/utils.py", line 1572, in generate
return self.sample(
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/transformers/generation/utils.py", line 2619, in sample
outputs = self(
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/root/.cache/huggingface/modules/transformers_modules/chatglm/modeling_chatglm.py", line 1190, in forward
transformer_outputs = self.transformer(
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/root/.cache/huggingface/modules/transformers_modules/chatglm/modeling_chatglm.py", line 996, in forward
layer_ret = layer(
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/root/.cache/huggingface/modules/transformers_modules/chatglm/modeling_chatglm.py", line 624, in forward
attention_input = self.input_layernorm(hidden_states)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/nn/modules/normalization.py", line 190, in forward
return F.layer_norm(
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/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
INFO: 172.18.0.3:52148 - "POST /v1/chat/completions HTTP/1.1" 500 Internal Server Error
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/uvicorn/protocols/http/h11_impl.py", line 428, in run_asgi
result = await app( # type: ignore[func-returns-value]
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in call
return await self.app(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/fastapi/applications.py", line 289, in call
await super().call(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/applications.py", line 122, in call
await self.middleware_stack(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/middleware/errors.py", line 184, in call
raise exc
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/middleware/errors.py", line 162, in call
await self.app(scope, receive, _send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/middleware/cors.py", line 83, in call
await self.app(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/middleware/exceptions.py", line 79, in call
raise exc
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/middleware/exceptions.py", line 68, in call
await self.app(scope, receive, sender)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/fastapi/middleware/asyncexitstack.py", line 20, in call
raise e
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/fastapi/middleware/asyncexitstack.py", line 17, in call
await self.app(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/routing.py", line 718, in call
await route.handle(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/routing.py", line 276, in handle
await self.app(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/routing.py", line 66, in app
response = await func(request)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/fastapi/routing.py", line 273, in app
raw_response = await run_endpoint_function(
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/fastapi/routing.py", line 190, in run_endpoint_function
return await dependant.call(**values)
File "/www/wwwroot/chatglm2/apifast.py", line 139, in create_chat_completion
response, _ = model.chat(tokenizer, query, history=history)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "/root/.cache/huggingface/modules/transformers_modules/chatglm/modeling_chatglm.py", line 1285, in chat
outputs = self.generate(**inputs, **gen_kwargs)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/transformers/generation/utils.py", line 1572, in generate
return self.sample(
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/transformers/generation/utils.py", line 2619, in sample
outputs = self(
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/root/.cache/huggingface/modules/transformers_modules/chatglm/modeling_chatglm.py", line 1190, in forward
transformer_outputs = self.transformer(
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/root/.cache/huggingface/modules/transformers_modules/chatglm/modeling_chatglm.py", line 996, in forward
layer_ret = layer(
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/root/.cache/huggingface/modules/transformers_modules/chatglm/modeling_chatglm.py", line 624, in forward
attention_input = self.input_layernorm(hidden_states)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/nn/modules/normalization.py", line 190, in forward
return F.layer_norm(
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/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
INFO: 172.18.0.3:52156 - "POST /v1/chat/completions HTTP/1.1" 500 Internal Server Error
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/uvicorn/protocols/http/h11_impl.py", line 428, in run_asgi
result = await app( # type: ignore[func-returns-value]
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in call
return await self.app(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/fastapi/applications.py", line 289, in call
await super().call(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/applications.py", line 122, in call
await self.middleware_stack(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/middleware/errors.py", line 184, in call
raise exc
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/middleware/errors.py", line 162, in call
await self.app(scope, receive, _send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/middleware/cors.py", line 83, in call
await self.app(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/middleware/exceptions.py", line 79, in call
raise exc
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/middleware/exceptions.py", line 68, in call
await self.app(scope, receive, sender)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/fastapi/middleware/asyncexitstack.py", line 20, in call
raise e
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/fastapi/middleware/asyncexitstack.py", line 17, in call
await self.app(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/routing.py", line 718, in call
await route.handle(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/routing.py", line 276, in handle
await self.app(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/routing.py", line 66, in app
response = await func(request)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/fastapi/routing.py", line 273, in app
raw_response = await run_endpoint_function(
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/fastapi/routing.py", line 190, in run_endpoint_function
return await dependant.call(**values)
File "/www/wwwroot/chatglm2/apifast.py", line 139, in create_chat_completion
response, _ = model.chat(tokenizer, query, history=history)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "/root/.cache/huggingface/modules/transformers_modules/chatglm/modeling_chatglm.py", line 1285, in chat
outputs = self.generate(**inputs, **gen_kwargs)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/transformers/generation/utils.py", line 1572, in generate
return self.sample(
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/transformers/generation/utils.py", line 2619, in sample
outputs = self(
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/root/.cache/huggingface/modules/transformers_modules/chatglm/modeling_chatglm.py", line 1190, in forward
transformer_outputs = self.transformer(
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/root/.cache/huggingface/modules/transformers_modules/chatglm/modeling_chatglm.py", line 996, in forward
layer_ret = layer(
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/root/.cache/huggingface/modules/transformers_modules/chatglm/modeling_chatglm.py", line 624, in forward
attention_input = self.input_layernorm(hidden_states)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/nn/modules/normalization.py", line 190, in forward
return F.layer_norm(
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/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
INFO: 172.18.0.3:52160 - "POST /v1/chat/completions HTTP/1.1" 500 Internal Server Error
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/uvicorn/protocols/http/h11_impl.py", line 428, in run_asgi
result = await app( # type: ignore[func-returns-value]
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in call
return await self.app(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/fastapi/applications.py", line 289, in call
await super().call(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/applications.py", line 122, in call
await self.middleware_stack(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/middleware/errors.py", line 184, in call
raise exc
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/middleware/errors.py", line 162, in call
await self.app(scope, receive, _send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/middleware/cors.py", line 83, in call
await self.app(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/middleware/exceptions.py", line 79, in call
raise exc
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/middleware/exceptions.py", line 68, in call
await self.app(scope, receive, sender)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/fastapi/middleware/asyncexitstack.py", line 20, in call
raise e
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/fastapi/middleware/asyncexitstack.py", line 17, in call
await self.app(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/routing.py", line 718, in call
await route.handle(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/routing.py", line 276, in handle
await self.app(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/routing.py", line 66, in app
response = await func(request)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/fastapi/routing.py", line 273, in app
raw_response = await run_endpoint_function(
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/fastapi/routing.py", line 190, in run_endpoint_function
return await dependant.call(**values)
File "/www/wwwroot/chatglm2/apifast.py", line 139, in create_chat_completion
response, _ = model.chat(tokenizer, query, history=history)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "/root/.cache/huggingface/modules/transformers_modules/chatglm/modeling_chatglm.py", line 1285, in chat
outputs = self.generate(**inputs, **gen_kwargs)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/transformers/generation/utils.py", line 1572, in generate
return self.sample(
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/transformers/generation/utils.py", line 2619, in sample
outputs = self(
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/root/.cache/huggingface/modules/transformers_modules/chatglm/modeling_chatglm.py", line 1190, in forward
transformer_outputs = self.transformer(
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/root/.cache/huggingface/modules/transformers_modules/chatglm/modeling_chatglm.py", line 996, in forward
layer_ret = layer(
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/root/.cache/huggingface/modules/transformers_modules/chatglm/modeling_chatglm.py", line 624, in forward
attention_input = self.input_layernorm(hidden_states)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/nn/modules/normalization.py", line 190, in forward
return F.layer_norm(
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/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
INFO: 172.18.0.3:52164 - "POST /v1/chat/completions HTTP/1.1" 500 Internal Server Error
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/uvicorn/protocols/http/h11_impl.py", line 428, in run_asgi
result = await app( # type: ignore[func-returns-value]
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in call
return await self.app(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/fastapi/applications.py", line 289, in call
await super().call(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/applications.py", line 122, in call
await self.middleware_stack(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/middleware/errors.py", line 184, in call
raise exc
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/middleware/errors.py", line 162, in call
await self.app(scope, receive, _send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/middleware/cors.py", line 83, in call
await self.app(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/middleware/exceptions.py", line 79, in call
raise exc
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/middleware/exceptions.py", line 68, in call
await self.app(scope, receive, sender)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/fastapi/middleware/asyncexitstack.py", line 20, in call
raise e
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/fastapi/middleware/asyncexitstack.py", line 17, in call
await self.app(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/routing.py", line 718, in call
await route.handle(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/routing.py", line 276, in handle
await self.app(scope, receive, send)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/starlette/routing.py", line 66, in app
response = await func(request)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/fastapi/routing.py", line 273, in app
raw_response = await run_endpoint_function(
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/fastapi/routing.py", line 190, in run_endpoint_function
return await dependant.call(**values)
File "/www/wwwroot/chatglm2/apifast.py", line 139, in create_chat_completion
response, _ = model.chat(tokenizer, query, history=history)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "/root/.cache/huggingface/modules/transformers_modules/chatglm/modeling_chatglm.py", line 1285, in chat
outputs = self.generate(**inputs, **gen_kwargs)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/transformers/generation/utils.py", line 1572, in generate
return self.sample(
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/transformers/generation/utils.py", line 2619, in sample
outputs = self(
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/root/.cache/huggingface/modules/transformers_modules/chatglm/modeling_chatglm.py", line 1190, in forward
transformer_outputs = self.transformer(
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/root/.cache/huggingface/modules/transformers_modules/chatglm/modeling_chatglm.py", line 996, in forward
layer_ret = layer(
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/root/.cache/huggingface/modules/transformers_modules/chatglm/modeling_chatglm.py", line 624, in forward
attention_input = self.input_layernorm(hidden_states)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/site-packages/torch/nn/modules/normalization.py", line 190, in forward
return F.layer_norm(
File "/www/server/pyporject_evn/c6c91b000da227aab4443cae4e8c16dc_venv/lib/python3.9/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

用1的API

用1的API

C:\ProgramData\miniconda3\envs\nlp\python.exe E:\glm\apiv3.py
Traceback (most recent call last):
File "E:\glm\apiv3.py", line 55, in
model = AutoModel.from_pretrained("v3", device_map='auto')
File "C:\ProgramData\miniconda3\envs\nlp\lib\site-packages\transformers\models\auto\auto_factory.py", line 441, in from_pretrained
config, kwargs = AutoConfig.from_pretrained(
File "C:\ProgramData\miniconda3\envs\nlp\lib\site-packages\transformers\models\auto\configuration_auto.py", line 899, in from_pretrained
raise ValueError(
ValueError: Loading v3 requires you to execute the configuration file in that repo on your local machine. Make sure you have read the code there to avoid malicious use, then set the option trust_remote_code=True to remove this error.

进程已结束,退出代码1

1的不是官方的吗

是官方的,不过你示范那个调用有问题,我自己改好啦, 谢谢!

有什么问题,可以贴下

Sign up or log in to comment