Closed bh4ffu closed 1 year ago
test005/checkpoint-300下的文件如下: -rw-r--r-- 1 root root 14700127 Mar 30 16:03 chatglm-lora.pt -rw-r--r-- 1 root root 697 Mar 30 16:14 config.json -rw-r--r-- 1 root root 29393541 Mar 30 16:03 optimizer.pt -rw-r--r-- 1 root root 14575 Mar 30 16:03 rng_state.pth -rw-r--r-- 1 root root 557 Mar 30 16:03 scaler.pt -rw-r--r-- 1 root root 627 Mar 30 16:03 scheduler.pt -rw-r--r-- 1 root root 2235 Mar 30 16:03 trainer_state.json
看最新的readme.md
@yuanzhoulvpi2017 截图的代码能贴一下么?
昨天都跑通了,训练了一下我们领域内的数据,有效果,持续关注,感谢 @yuanzhoulvpi2017
代码: `from transformers import AutoTokenizer from thuglm.modeling_chatglm import ChatGLMForConditionalGeneration import torch
model = ChatGLMForConditionalGeneration.from_pretrained(".//test005//checkpoint-300").cuda() tokenizer = AutoTokenizer.from_pretrained("thuglm", trust_remote_code=True)
with torch.autocast("cuda"): res, history = model.chat(tokenizer=tokenizer, query="你是谁? ")
res = model.forward(input_ids=all_input.get('input_ids').cuda())
报错: Traceback (most recent call last): File "simple_api.py", line 5, in
model = ChatGLMForConditionalGeneration.from_pretrained(".//test005//checkpoint-300").cuda()
File "/usr/local/python3/lib/python3.8/site-packages/transformers/modeling_utils.py", line 2274, in from_pretrained
raise EnvironmentError(
OSError: Error no file named pytorch_model.bin, tf_model.h5, model.ckpt.index or flax_model.msgpack found in directory .//test005//checkpoint-300.