Skip to content

AttributeError: 'ChatGLMForConditionalGeneration' object has no attribute '_extract_past_from_model_output' #367

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

Open
funguuykk116 opened this issue Feb 20, 2025 · 1 comment

Comments

@funguuykk116
Copy link

ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/home/manz/miniconda3/envs/glm4/lib/python3.10/site-packages/uvicorn/protocols/http/h11_impl.py", line 408, in run_asgi
result = await app( # type: ignore[func-returns-value]
File "/home/manz/miniconda3/envs/glm4/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 84, in call
return await self.app(scope, receive, send)
File "/home/manz/miniconda3/envs/glm4/lib/python3.10/site-packages/fastapi/applications.py", line 1106, in call
await super().call(scope, receive, send)
File "/home/manz/miniconda3/envs/glm4/lib/python3.10/site-packages/starlette/applications.py", line 122, in call
await self.middleware_stack(scope, receive, send)
File "/home/manz/miniconda3/envs/glm4/lib/python3.10/site-packages/starlette/middleware/errors.py", line 184, in call
raise exc
File "/home/manz/miniconda3/envs/glm4/lib/python3.10/site-packages/starlette/middleware/errors.py", line 162, in call
await self.app(scope, receive, _send)
File "/home/manz/miniconda3/envs/glm4/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 79, in call
raise exc
File "/home/manz/miniconda3/envs/glm4/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 68, in call
await self.app(scope, receive, sender)
File "/home/manz/miniconda3/envs/glm4/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 20, in call
raise e
File "/home/manz/miniconda3/envs/glm4/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 17, in call
await self.app(scope, receive, send)
File "/home/manz/miniconda3/envs/glm4/lib/python3.10/site-packages/starlette/routing.py", line 718, in call
await route.handle(scope, receive, send)
File "/home/manz/miniconda3/envs/glm4/lib/python3.10/site-packages/starlette/routing.py", line 276, in handle
await self.app(scope, receive, send)
File "/home/manz/miniconda3/envs/glm4/lib/python3.10/site-packages/starlette/routing.py", line 66, in app
response = await func(request)
File "/home/manz/miniconda3/envs/glm4/lib/python3.10/site-packages/fastapi/routing.py", line 274, in app
raw_response = await run_endpoint_function(
File "/home/manz/miniconda3/envs/glm4/lib/python3.10/site-packages/fastapi/routing.py", line 191, in run_endpoint_function
return await dependant.call(**values)
File "/home/manz/glm4/api.py", line 48, in create_item
outputs = model.generate(
File "/home/manz/miniconda3/envs/glm4/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 116, in decorate_context
return func(*args, **kwargs)
File "/home/manz/miniconda3/envs/glm4/lib/python3.10/site-packages/transformers/generation/utils.py", line 2223, in generate
result = self._sample(
File "/home/manz/miniconda3/envs/glm4/lib/python3.10/site-packages/transformers/generation/utils.py", line 3217, in _sample
model_kwargs = self._update_model_kwargs_for_generation(
File "/home/manz/.cache/huggingface/modules/transformers_modules/glm-4-9b-chat/modeling_chatglm.py", line 929, in _update_model_kwargs_for_generation
cache_name, cache = self._extract_past_from_model_output(outputs)
File "/home/manz/miniconda3/envs/glm4/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1928, in getattr
raise AttributeError(
AttributeError: 'ChatGLMForConditionalGeneration' object has no attribute '_extract_past_from_model_output'

@michele1993
Copy link

I had a similar issue for a different model and I solved it by downgrading the Transformer library to transformers==4.46.0

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

2 participants