File tree 1 file changed +21
-0
lines changed
1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -110,3 +110,24 @@ Add the option `--torch_compile_backend` with the desired backend: `pytorch` or
110
110
` ` ` bash
111
111
python ./benchmark.py -m models/llama-2-7b-chat/pytorch -d CPU --torch_compile_backend openvino
112
112
` ` `
113
+ # Notes
114
+ # # chatglm2-6b - AttributeError: can't set attribute
115
+ Download chatglm2-6b from hugginface, convert to OpenVINO IR files and run with benchmark.py, the following error may occur:
116
+ ` ` ` bash
117
+ AttributeError: can' t set attribute
118
+ ```
119
+ Reproduced with https://huggingface.co/THUDM/chatglm2-6b 7fabe56db91e085c9c027f56f1c654d137bdba40 <br />
120
+ As on https://huggingface.co/THUDM/chatglm2-6b/discussions/99 <br />
121
+ Solution: update `tokenization_chatglm.py` as following: <br />
122
+ ```Python
123
+ self.vocab_file = vocab_file
124
+ self.tokenizer = SPTokenizer(vocab_file)
125
+ + kwargs.pop("eos_token", None)
126
+ + kwargs.pop("pad_token", None)
127
+ + kwargs.pop("unk_token", None)
128
+ self.special_tokens = {
129
+ "<bos>": self.tokenizer.bos_id,
130
+ "<eos>": self.tokenizer.eos_id,
131
+ ```
132
+
133
+ > The solution works for chatglm3-6b as well.
You can’t perform that action at this time.
0 commit comments