"You are using a model of type mt5 to instantiate a model of type t5. This is not supported for all configurations of models and can yield errors.
D:\tool\Anaconda\anaconda3\envs\modelscope\lib\site-packages\torch_utils.py:831: UserWarning: TypedStorage is deprecated. It will be removed in the future and UntypedStorage will be the only storage class. This should only matter to you if you are using storages directly. To access UntypedStorage directly, use tensor.untyped_storage() instead of tensor.storage()
return self.fget.get(instance, owner)()
2024-03-07 15:17:05,868 - modelscope - WARNING - ('EXPORTERS', 'text2text-generation', 'T5') not found in ast index file
Traceback (most recent call last):
File ""D:\tool\Anaconda\anaconda3\envs\modelscope\lib\site-packages\modelscope\exporters\base.py"", line 52, in from_model
exporter = build_exporter(export_cfg, task_name, kwargs)
File ""D:\tool\Anaconda\anaconda3\envs\modelscope\lib\site-packages\modelscope\exporters\builder.py"", line 20, in build_exporter
return build_from_cfg(
File ""D:\tool\Anaconda\anaconda3\envs\modelscope\lib\site-packages\modelscope\utils\registry.py"", line 198, in build_from_cfg
raise KeyError(
KeyError: 'T5 is not in the exporters registry group text2text-generation. Please make sure the correct version of ModelScope library is used.'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File ""F:\study\graduationProject\openingReport\nlp_mt5_zero-shot-augment_chinese-base\onnx.py"", line 6, in
output_files = Exporter.from_model(model).export_onnx(opset=13, output_dir='./model.onnx') #指定输出的ONNX文件所在的目录(output_dir),ONNX的操作集版本(opset)。
File ""D:\tool\Anaconda\anaconda3\envs\modelscope\lib\site-packages\modelscope\exporters\base.py"", line 54, in from_model
raise KeyError(
KeyError: ""The exporting of model 'T5' with task: 'text2text-generation' is not supported currently.""
ModelScope模型导出为什么报以上错误?
代码用的是这个
from modelscope.models import Model
from modelscope.pipelines import pipeline
from modelscope.exporters import Exporter
model_id = 'damo/nlp_mt5_zero-shot-augment_chinese-base'
model = Model.from_pretrained(model_id)
output_files = Exporter.from_model(model).export_onnx(opset=13, output_dir='./model.onnx') #指定输出的ONNX文件所在的目录(output_dir),ONNX的操作集版本(opset)。
print(output_files)
"
"支持导出ONNX的ModelScope模型列表中没有这个模型,可能您得按照现有的例子改一下。文档,https://modelscope.cn/docs/%E6%A8%A1%E5%9E%8B%E7%9A%84%E5%AF%BC%E5%87%BA 此回答整理自钉群“魔搭ModelScope开发者联盟群 ①”
"
ModelScope旨在打造下一代开源的模型即服务共享平台,为泛AI开发者提供灵活、易用、低成本的一站式模型服务产品,让模型应用更简单!欢迎加入技术交流群:微信公众号:魔搭ModelScope社区,钉钉群号:44837352