We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
作者您好,我想在c_mteb(https://arxiv.org/abs/2309.07597) 上测试一下该模型的性能(一个词嵌入质量评估的benchmark),c_mteb库貌似在Transformers库低于4.40.0时就无法import,而在Transformers版本大于4.40.0的时候,也就是您requirements.txt中给到的4.33.2,就会在推理阶段报错(报错信息注释在代码行了)
import transformers model_dir = 'path/to/the_model' tokenizer = transformers.AutoTokenizer.from_pretrained(model_dir) model = transformers.AutoModelForCausalLM.from_pretrained(model_dir,device_map="auto") device = model.device
sentence = "喜欢唱跳rap篮球" input_ids = tokenizer.encode(sentence, return_tensors='pt') input_ids = input_ids.to(device) print(input_ids) out = model(input_ids, #报错行代码,只要把Transformers版本降到4.33.2后就不会报错了 output_hidden_states=True, output_attentions=True )
The text was updated successfully, but these errors were encountered:
No branches or pull requests
作者您好,我想在c_mteb(https://arxiv.org/abs/2309.07597)
上测试一下该模型的性能(一个词嵌入质量评估的benchmark),c_mteb库貌似在Transformers库低于4.40.0时就无法import,而在Transformers版本大于4.40.0的时候,也就是您requirements.txt中给到的4.33.2,就会在推理阶段报错(报错信息注释在代码行了)
import transformers
model_dir = 'path/to/the_model'
tokenizer = transformers.AutoTokenizer.from_pretrained(model_dir)
model = transformers.AutoModelForCausalLM.from_pretrained(model_dir,device_map="auto")
device = model.device
sentence = "喜欢唱跳rap篮球"
input_ids = tokenizer.encode(sentence, return_tensors='pt')
input_ids = input_ids.to(device)
print(input_ids)
out = model(input_ids, #报错行代码,只要把Transformers版本降到4.33.2后就不会报错了
output_hidden_states=True,
output_attentions=True
)
The text was updated successfully, but these errors were encountered: