登录
注册
开源
企业版
高校版
搜索
帮助中心
使用条款
关于我们
开源
企业版
高校版
私有云
模力方舟
AI 队友
登录
注册
Gitee 2025 年度开源项目评选中
代码拉取完成,页面将自动刷新
开源项目
>
人工智能
>
自然语言处理
&&
捐赠
捐赠前请先登录
取消
前往登录
扫描微信二维码支付
取消
支付完成
支付提示
将跳转至支付宝完成支付
确定
取消
Watch
不关注
关注所有动态
仅关注版本发行动态
关注但不提醒动态
8
Star
38
Fork
19
MindSpore Lab
/
mindnlp
代码
Issues
14
Pull Requests
3
Wiki
统计
流水线
服务
JavaDoc
PHPDoc
质量分析
Jenkins for Gitee
腾讯云托管
腾讯云 Serverless
悬镜安全
阿里云 SAE
Codeblitz
SBOM
我知道了,不再自动展开
更新失败,请稍后重试!
移除标识
内容风险标识
本任务被
标识为内容中包含有代码安全 Bug 、隐私泄露等敏感信息,仓库外成员不可访问
0.5.0版本在ms2.6上提示导入错误
待办的
#ICPWU6
ilovescrapy
创建于
2025-07-30 21:30
环境:  **执行代码:** import mindspore import mindnlp from transformers import pipeline chat = [ {"role": "system", "content": "You are a sassy, wise-cracking robot as imagined by Hollywood circa 1986."}, {"role": "user", "content": "Hey, can you tell me any fun things to do in New York?"} ] pipeline = pipeline(task="text-generation", model="Qwen/Qwen3-8B", ms_dtype=mindspore.bfloat16, device_map="auto") response = pipeline(chat, max_new_tokens=512) print(response[0]["generated_text"][-1]["content"])  **完整报错如下:** ImportError Traceback (most recent call last) Cell In[2], line 2 1 import mindspore ----> 2 import mindnlp 3 from transformers import pipeline 5 chat = [ 6 {"role": "system", "content": "You are a sassy, wise-cracking robot as imagined by Hollywood circa 1986."}, 7 {"role": "user", "content": "Hey, can you tell me any fun things to do in New York?"} 8 ] File ~/miniconda/envs/jupyter/lib/python3.9/site-packages/mindnlp/__init__.py:50 47 from .core._tensor import enable_mindspore_patch 49 enable_mindspore_patch() ---> 50 initialize_torch_proxy() 51 setup_metadata_patch() 52 setup_safetensors_patch() File ~/miniconda/envs/jupyter/lib/python3.9/site-packages/mindnlp/utils/torch_proxy.py:99, in initialize_torch_proxy() 97 def initialize_torch_proxy(): 98 sys.meta_path.insert(0, RedirectFinder(REDIRECT_MAP)) ---> 99 import torch 100 torch.__version__ = "2.1.1+dev" File ~/miniconda/envs/jupyter/lib/python3.9/site-packages/mindnlp/utils/torch_proxy.py:23, in RedirectFinder.find_spec(self, fullname, path, target) 21 importlib.import_module(target_name) 22 except Exception as e: ---> 23 raise e 25 return importlib.machinery.ModuleSpec( 26 name=fullname, 27 loader=RedirectLoader(target_name), 28 is_package=self._is_package(target_name), 29 ) 30 return None File ~/miniconda/envs/jupyter/lib/python3.9/site-packages/mindnlp/utils/torch_proxy.py:21, in RedirectFinder.find_spec(self, fullname, path, target) 19 target_name = fullname.replace(proxy_prefix, target_prefix, 1) 20 try: ---> 21 importlib.import_module(target_name) 22 except Exception as e: 23 raise e File ~/miniconda/envs/jupyter/lib/python3.9/importlib/__init__.py:127, in import_module(name, package) 125 break 126 level += 1 --> 127 return _bootstrap._gcd_import(name[level:], package, level) File ~/miniconda/envs/jupyter/lib/python3.9/site-packages/mindnlp/core/__init__.py:50 48 from ._C.size import Size 49 from .types import device ---> 50 from .autograd import * 51 from .ops import * 52 from .serialization import load, save File ~/miniconda/envs/jupyter/lib/python3.9/site-packages/mindnlp/core/autograd/__init__.py:3 1 """autograd""" 2 from .node import Node ----> 3 from .function import Function, value_and_grad 4 from .grad_mode import no_grad, enable_grad, inference_mode File ~/miniconda/envs/jupyter/lib/python3.9/site-packages/mindnlp/core/autograd/function.py:9 7 from mindspore.common.api import _pynative_executor 8 from mindspore._c_expression import Cell_ ----> 9 from .grad_mode import no_grad 11 try: 12 from mindspore import _Function as Function File ~/miniconda/envs/jupyter/lib/python3.9/site-packages/mindnlp/core/autograd/grad_mode.py:17 15 """core module""" 16 from mindspore.common.api import _pynative_executor ---> 17 from ..utils._contextlib import _NoParamDecoratorContextManager, _DecoratorContextManager 19 class no_grad(_NoParamDecoratorContextManager): 20 """ 21 Context Manager to disable gradient calculation. When enter this context, we will disable calculate 22 gradient. When exit this context, we will resume its prev state. 23 Currently, it can only use in Pynative mode. It also can be used as decorator. 24 """ File ~/miniconda/envs/jupyter/lib/python3.9/site-packages/mindnlp/core/utils/__init__.py:2 1 """utils""" ----> 2 from . import data ImportError: cannot import name 'data' from partially initialized module 'mindnlp.core.utils' (most likely due to a circular import) (/home/mindspore/miniconda/envs/jupyter/lib/python3.9/site-packages/mindnlp/core/utils/__init__.py)
环境:  **执行代码:** import mindspore import mindnlp from transformers import pipeline chat = [ {"role": "system", "content": "You are a sassy, wise-cracking robot as imagined by Hollywood circa 1986."}, {"role": "user", "content": "Hey, can you tell me any fun things to do in New York?"} ] pipeline = pipeline(task="text-generation", model="Qwen/Qwen3-8B", ms_dtype=mindspore.bfloat16, device_map="auto") response = pipeline(chat, max_new_tokens=512) print(response[0]["generated_text"][-1]["content"])  **完整报错如下:** ImportError Traceback (most recent call last) Cell In[2], line 2 1 import mindspore ----> 2 import mindnlp 3 from transformers import pipeline 5 chat = [ 6 {"role": "system", "content": "You are a sassy, wise-cracking robot as imagined by Hollywood circa 1986."}, 7 {"role": "user", "content": "Hey, can you tell me any fun things to do in New York?"} 8 ] File ~/miniconda/envs/jupyter/lib/python3.9/site-packages/mindnlp/__init__.py:50 47 from .core._tensor import enable_mindspore_patch 49 enable_mindspore_patch() ---> 50 initialize_torch_proxy() 51 setup_metadata_patch() 52 setup_safetensors_patch() File ~/miniconda/envs/jupyter/lib/python3.9/site-packages/mindnlp/utils/torch_proxy.py:99, in initialize_torch_proxy() 97 def initialize_torch_proxy(): 98 sys.meta_path.insert(0, RedirectFinder(REDIRECT_MAP)) ---> 99 import torch 100 torch.__version__ = "2.1.1+dev" File ~/miniconda/envs/jupyter/lib/python3.9/site-packages/mindnlp/utils/torch_proxy.py:23, in RedirectFinder.find_spec(self, fullname, path, target) 21 importlib.import_module(target_name) 22 except Exception as e: ---> 23 raise e 25 return importlib.machinery.ModuleSpec( 26 name=fullname, 27 loader=RedirectLoader(target_name), 28 is_package=self._is_package(target_name), 29 ) 30 return None File ~/miniconda/envs/jupyter/lib/python3.9/site-packages/mindnlp/utils/torch_proxy.py:21, in RedirectFinder.find_spec(self, fullname, path, target) 19 target_name = fullname.replace(proxy_prefix, target_prefix, 1) 20 try: ---> 21 importlib.import_module(target_name) 22 except Exception as e: 23 raise e File ~/miniconda/envs/jupyter/lib/python3.9/importlib/__init__.py:127, in import_module(name, package) 125 break 126 level += 1 --> 127 return _bootstrap._gcd_import(name[level:], package, level) File ~/miniconda/envs/jupyter/lib/python3.9/site-packages/mindnlp/core/__init__.py:50 48 from ._C.size import Size 49 from .types import device ---> 50 from .autograd import * 51 from .ops import * 52 from .serialization import load, save File ~/miniconda/envs/jupyter/lib/python3.9/site-packages/mindnlp/core/autograd/__init__.py:3 1 """autograd""" 2 from .node import Node ----> 3 from .function import Function, value_and_grad 4 from .grad_mode import no_grad, enable_grad, inference_mode File ~/miniconda/envs/jupyter/lib/python3.9/site-packages/mindnlp/core/autograd/function.py:9 7 from mindspore.common.api import _pynative_executor 8 from mindspore._c_expression import Cell_ ----> 9 from .grad_mode import no_grad 11 try: 12 from mindspore import _Function as Function File ~/miniconda/envs/jupyter/lib/python3.9/site-packages/mindnlp/core/autograd/grad_mode.py:17 15 """core module""" 16 from mindspore.common.api import _pynative_executor ---> 17 from ..utils._contextlib import _NoParamDecoratorContextManager, _DecoratorContextManager 19 class no_grad(_NoParamDecoratorContextManager): 20 """ 21 Context Manager to disable gradient calculation. When enter this context, we will disable calculate 22 gradient. When exit this context, we will resume its prev state. 23 Currently, it can only use in Pynative mode. It also can be used as decorator. 24 """ File ~/miniconda/envs/jupyter/lib/python3.9/site-packages/mindnlp/core/utils/__init__.py:2 1 """utils""" ----> 2 from . import data ImportError: cannot import name 'data' from partially initialized module 'mindnlp.core.utils' (most likely due to a circular import) (/home/mindspore/miniconda/envs/jupyter/lib/python3.9/site-packages/mindnlp/core/utils/__init__.py)
评论 (
0
)
登录
后才可以发表评论
状态
待办的
待办的
进行中
已完成
已关闭
负责人
未设置
标签
未设置
标签管理
里程碑
未关联里程碑
未关联里程碑
Pull Requests
未关联
未关联
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
未关联
分支 (6)
标签 (17)
master
0.5
ccf
0.4
janus
revert-1830-master
v0.5.1
v0.5.0
v0.5.0rc4
v0.5.0rc3
v0.5.0rc2
v0.5.0rc1
v0.4.1
v0.4.0
v0.3.1
v0.3.0
v0.2.4
v0.2.3
v0.2.2
v0.2.1
v0.2.0
v0.1.1
v0.0.1-alpha
开始日期   -   截止日期
-
置顶选项
不置顶
置顶等级:高
置顶等级:中
置顶等级:低
优先级
不指定
严重
主要
次要
不重要
参与者(1)
1
https://gitee.com/mindspore-lab/mindnlp.git
[email protected]
:mindspore-lab/mindnlp.git
mindspore-lab
mindnlp
mindnlp
点此查找更多帮助
搜索帮助
Git 命令在线学习
如何在 Gitee 导入 GitHub 仓库
Git 仓库基础操作
企业版和社区版功能对比
SSH 公钥设置
如何处理代码冲突
仓库体积过大,如何减小?
如何找回被删除的仓库数据
Gitee 产品配额说明
GitHub仓库快速导入Gitee及同步更新
什么是 Release(发行版)
将 PHP 项目自动发布到 packagist.org
评论
仓库举报
回到顶部
登录提示
该操作需登录 Gitee 帐号,请先登录后再操作。
立即登录
没有帐号,去注册