import mindspore.context as context
from x2ms_adapter.core.context import x2ms_context
if not x2ms_context.is_context_init:
context.set_context(mode=context.PYNATIVE_MODE, pynative_synchronize=True)
x2ms_context.is_context_init = True
为避免出现list out of range错误,对src/transformers/configuration_utils.py的d["torch_dtype"] = x2ms_adapter.tensor_api.split(str(d["torch_dtype"]), ".")[1]语句取消索引的使用: