mindnlp
mindnlp copied to clipboard
Easy-to-use and high-performance NLP and LLM framework based on MindSpore, compatible with models and datasets of 🤗Huggingface.
rebase了一下,重新提交了pr
###PR内容### 提供了SFT方法和所需的配置文件,并在exaples文件夹下提供sft调用的示例。
topk的行为异常参见这两个issue https://github.com/mindspore-lab/mindnlp/issues/1487 https://github.com/mindspore-lab/mindnlp/issues/1499 而在mindnlp/transformers/generation/utils.py的_beam_search函数的3228行,  这里的topk在GPU下会生成负数索引从而导致索引越界,以至于rag测试无法通过
任务链接:https://gitee.com/mindspore/community/issues/IAAD7O
**Describe the bug/ 问题描述 (Mandatory / 必填)** ops.topk求出tensor结果有误,mindspore中的一个tensor[[-3.4028235e+38 -2.0206820e+01 -3.4028235e+38 ... -3.4028235e+38 -3.4028235e+38 -3.4028235e+38]],只有索引为1和96104的值不为-3.4028235e+38,其他均为-3.4028235e+38,用ops.topk求4个最大元素对应的索引,求出索引的值为[1, 96104, -1, -1],而pytorch的结果是[ 1, 96104, 0, 2] 将ops.topk改为ops.sort的时候,输入相同的tensor直接卡住无响应 - **Hardware Environment(`Ascend`/`GPU`/`CPU`) / 硬件环境**:GPU - **Software Environment...
### 版本 mindspore==2.2.14, cuda == 11.6 ### 问题 如图,对于这个测试代码,在CPU模式下,topk的输出是真正确的 而在GPU模式下,topk的输出出现了可怕的-1  下面的代码供复现错误 ``` python import mindspore as ms from mindspore import ops import numpy as np # 初始化环境 ms.context.set_context(mode=ms.context.GRAPH_MODE, device_target="CPU")...
**使用batched_nms输出为空** A clear and concise description of what the bug is. - **Hardware Environment(`CPU`) - **Software Environment / 软件环境 (Mandatory / 必填)**: -- MindSpore version :2.2.14 -- Python version :Python...