THUDM / ChatGLM2-6B

ChatGLM2-6B: An Open Bilingual Chat LLM | 开源双语对话语言模型
Other
15.73k stars 1.85k forks source link

运行python cli_demo.py报错 #671

Open mxldjt opened 8 months ago

mxldjt commented 8 months ago

Is there an existing issue for this?

Current Behavior

Traceback (most recent call last): File "cli_demo.py", line 8 ,in model = AutoModel.from pretrained("/root/chatglm2-6bSSH),trust_remote_code=True).mlu() File "/root /for-chatGIm2-6B/transformers-4,30,2 mlu/src/transformers/models/auto/auto factory,py", line 476, in from pretrainedtrust reclass ref,pretrained modelname or path, File "/root/for-chatGm2-6B/transformers-4.30,2 mlu/src/transformers/dymamic module utils.py", 1ine 443, in get class from dymamic modulhub kwargS,kwargreturn get class in module(class namefinal module.replace (" .py", File "/root/for-chatGIm2-6B/transformers-4,30.2 mlu/src/transformers/dynamic module utils,py", line 164, in get clas in modulemodule=importlib.importmodule (module path)File "/opt/py3.7/lib/python3,7/importlib/ init.py",line 127,in import modulereturnbootstrap.gcd import(name[level:],package, level) File ""line1006,in gcd import""nportlib.line983,in find and loadFile""lmportli1o.line967,in find and load unlocked""line 677,in load unlocked"<frozenFileimportlib, bootstrap external>",line 728, in exec module File "<frozenimportlib,bootstrap)line 219,in call with frames removedFile "/root/.cache/huggingface/mners modules/chatglm2-6b/modeling chatglm.py",line 31,in dules/transfoifrom transformers.modeling utils import PreTrainedModel File "/root/for-chatGIM2-6B/transformers-4.30.2 mlu/src/transformers/modeling utils,py", line 86, in from accelerate importaccelerate versiorversi0l File "/root/for-chatGLM2-6B/accelerate mlu/src/accelerate/ init.py",line 16,in from.accelerator import ccelerato) File "/root/for-chatGIM2-6B/accelerate mlu/src/accelerate/accelerator,py", line 36, in from11siom state,.checkpointing import load accelerator statersave accelerator state,,save custom state File "/root/for-chatGIM2-6B/accelerate mlu/src/accelerate/checkpointing,py", line 25, in from .utils imort ( File "/root/for-chatGIM2-6B/accelerate mlu/src/accelerate/utils/ init py", line 98, in from .modeling import ( File "/root/for-chatGIM2-6B/accelerate mlu/src/accelerate/utils/modeling,py", line 34, in from ..state import Acceleratorstatefrom File "/root/for-chatGLM2-6B/accelerate mlu/src/accelerate/state.py", line 52,in if is torch xla available(): TypeError: decorating function()missing 1 required positional argument: 'user function'(pytorch)

Expected Behavior

No response

Steps To Reproduce

none

Environment

- OS: kylinV10 sp2
- Python:3.7
- Transformers:4.30.2
- PyTorch: 1.9
- 寒武纪MLU370-s4

Anything else?

No response