Skip to content

技术公开课内容测试任务11#157

Open
babahaochi wants to merge 2 commits intomindspore-lab:masterfrom
babahaochi:master
Open

技术公开课内容测试任务11#157
babahaochi wants to merge 2 commits intomindspore-lab:masterfrom
babahaochi:master

Conversation

@babahaochi
Copy link

  • 修改了 requirements.txt ,将版本锁定为 mindspore>=2.6.0 和 mindnlp>=0.4.0 ,确保项目基于最新发行版运行。
    -代码适配与重构 针对 MindNLP 0.4.0 的重大架构调整,我对 chatpdf.py 进行了以下重构:
  • 算子迁移 :引入 mindnlp.core.ops ,将原有的 MindSpore 直接张量操作替换为 MindNLP 核心算子(如将 logits.view(-1, ) 改为 ops.reshape(logits, (-1,)) )。
  • 接口适配 :更新了 _get_reranker_score 等函数中的张量处理逻辑,确保与 0.4.0 的新 core 框架完全兼容。
  • 模型加载 :验证并保持了 PeftModel 和 AutoModel 在新版本下的加载稳定性。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant