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.
It shows a relatively user-friendly interface when generating token. The update avoids producing too many multi-line outputs when the program generates 576 tokens, thus avoiding useful printed information being squeezed...
在使用mindnlp.peft进行prefix tuning的时候报错: ``` Traceback (most recent call last): File "E:\git\biogpt\finetune.py", line 144, in loss = grad_fn(**batch) File "D:\install\anaconda\envs\biogpt\lib\site-packages\mindnlp\core\autograd\function.py", line 35, in value_and_grad_f values = fn_(*args, **kwargs) File "E:\git\biogpt\finetune.py", line 131,...
问题描述 在调用mindnlp.peft微调的时候发生报错 ``` Traceback (most recent call last): File "/tmp/code/biogpt/finetune.py", line 130, in trainer.train() File "/home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages/mindnlp/engine/trainer/base.py", line 781, in train return inner_training_loop( File "/home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages/mindnlp/engine/trainer/base.py", line 1133, in _inner_training_loop tr_loss_step =...
**Describe the bug/ 问题描述 (Mandatory / 必填)** windows11环境下,python3.11.4, mindspore2.5.0, mindnlp0.4.0下, 基于mindnlp.transformer加载qwen2.5大模型,报:UnboundLocalError: cannot access local variable 'visible_devices' where it is not associated with a value - **Hardware Environment(`Ascend`/`GPU`/`CPU`) / 硬件环境**: >...
在windows系统下,通过mindnlp库加载模型的时候会发生报错: ``` import winfcntlock as fcntl # pylint: disable=import-error ModuleNotFoundError: No module named 'winfcntlock' ``` 经检查,修改utils/download.py里的import winfcntlock as fcntl为from . import winfcntlock as fcntl可以解决该问题。但是,继续运行之后仍有报错: ``` Traceback (most recent call last):...
mindnlp 怎么指定调用npu呢? 也是类似 torch 么? import torch from transformers import AutoModelForCausalLM, AutoTokenizer, LlamaForCausalLM tokenizer = AutoTokenizer.from_pretrained("tiiuae/falcon-7b") with torch.device("cuda"): model = AutoModelForCausalLM.from_pretrained( "tiiuae/falcon-7b", torch_dtype=torch.float16, use_flash_attention_2=True, )
**Describe the bug/ 问题描述 (Mandatory / 必填)** 在尝试使用mindspore与mindnlp将huggingface上的qwen2模型(基于pytorch和transformer)时,在翻译Qwen2Attention层时,发现FlashAttentionKwargs在mindnlp中并无对应实现,如何解决这个问题 ```python def forward( self, hidden_states: torch.Tensor, position_embeddings: Tuple[torch.Tensor, torch.Tensor], attention_mask: Optional[torch.Tensor], past_key_value: Optional[Cache] = None, cache_position: Optional[torch.LongTensor] = None, **kwargs: Unpack[FlashAttentionKwargs], )...
**Describe the bug/ 问题描述 (Mandatory / 必填)** A clear and concise description of what the bug is. 910A四卡跑DeepSeek-R1-Distill-Qwen-32B报错 - **Hardware Environment(`Ascend`/`GPU`/`CPU`) / 硬件环境**: > Please delete the backend not involved...