Installation | Introduction | Quick Links |
-
π₯ Latest Features
- π€ Hugging huggingface ecosystem, we use datasets lib as default dataset loader to support mounts of useful datasets.
- π MindNLP supports NLP tasks such as language model, machine translation, question answering, sentiment analysis, sequence labeling, summarization, etc. You can access them through examples.
- π MindNLP currently supports industry-leading Large Language Models (LLMs), including Llama, GLM, RWKV, etc. For support related to large language models, including pre-training, fine-tuning, and inference demo examples, you can find them in the "llm" directory.
- π€ Pretrained models support huggingface transformers-like apis, including 60+ models like BERT, Roberta, GPT2, T5, etc.
You can use them easily by following code snippet:
from mindnlp.transformers import AutoModel model = AutoModel.from_pretrained('bert-base-cased')
You can install the official version of MindNLP which uploaded to pypi.
pip install mindnlp
You can download MindNLP daily wheel from here.
To install MindNLP from source, please run:
pip install git+https://github.com/mindspore-lab/mindnlp.git
# or
git clone https://github.com/mindspore-lab/mindnlp.git
cd mindnlp
bash scripts/build_and_reinstall.sh
MindNLP version | MindSpore version | Supported Python version |
---|---|---|
master | daily build | >=3.7.5, <=3.9 |
0.1.1 | >=1.8.1, <=2.0.0 | >=3.7.5, <=3.9 |
0.2.x | >=2.1.0 | >=3.8, <=3.9 |
MindNLP is an open source NLP library based on MindSpore. It supports a platform for solving natural language processing tasks, containing many common approaches in NLP. It can help researchers and developers to construct and train models more conveniently and rapidly.
The master branch works with MindSpore master.
- Comprehensive data processing: Several classical NLP datasets are packaged into friendly module for easy use, such as Multi30k, SQuAD, CoNLL, etc.
- Friendly NLP model toolset: MindNLP provides various configurable components. It is friendly to customize models using MindNLP.
- Easy-to-use engine: MindNLP simplified complicated training process in MindSpore. It supports Trainer and Evaluator interfaces to train and evaluate models easily.
The table below represents the current support in the library for each of those models, whether they have support in Pynative mode or Graph mode.
Model | Pynative support | Graph Support |
---|---|---|
ALBERT | β | β |
ALIGN | β | β |
AltCLIP | β | β |
Audio Spectrogram Transformer | β | β |
Autoformer | β (Inference only) | β |
BaiChuan | β | β |
Bark | β | β |
BART | β | β |
BERT | β | β |
BLIP | TODO | β |
BLIP2 | TODO | β |
BLOOM | β | β |
ChatGLM | β | β |
ChatGLM2 | β | β |
ChatGLM3 | β | β |
CLIP | β | β |
CodeGen | β | β |
ConvBERT | TODO | β |
CPM | β | β |
CPM-Ant | β | β |
CPM-Bee | β | β |
MiniCPM | β | β |
Deberta | β | β |
Electra | TODO | β |
EnCodec | β | β |
ERNIE | β | β |
ERNIEM | β | β |
ESM | β | β |
Falcon | β | β |
OpenAI GPT | β | β |
OpenAI GPT-2 | β | β |
Gemma | β | β |
GPT Neo | β | β |
GPT NeoX | TODO | β |
GPT Pangu | β | β |
GPTBigCode | β | β |
Graphormer | β | β |
Hubert | β | β |
Llama | β | β |
Llama2 | β | β |
CodeLlama | β | β |
Longformer | β | β |
LongT5 | β | β |
LUKE | β | β |
MaskFormer | β | β |
Mamba | β | β |
mBART-50 | β | β |
Megatron-BERT | β | β |
Megatron-GPT2 | β | β |
Mistral | β | β |
Mixtral | β | β |
MobileBERT | β | β |
Moss | β | β |
Nezha | β | β |
OPT | β | β |
Phi2 | β | β |
Pop2piano | β | β |
Qwen2 | β | β |
Reformer | β | β |
RegNet | Todo | β |
RoBERTa | β | β |
RWKV | β | β |
SeamlessM4T | β | β |
SeamlessM4Tv2 | β | β |
StarCoder | β | β |
T5 | β | β |
Timesformer | TODO | β |
Tinybert | β | β |
wav2vec | β | β |
Whisper | β | β |
XLM | β | β |
XLM-RoBERTa | β | β |
This project is released under the Apache 2.0 license.
The dynamic version is still under development, if you find any issue or have an idea on new features, please don't hesitate to contact us via Github Issues.
MindSpore is an open source project that welcome any contribution and feedback.
We wish that the toolbox and benchmark could serve the growing research
community by providing a flexible as well as standardized toolkit to reimplement existing methods
and develop their own new semantic segmentation methods.
If you find this project useful in your research, please consider citing:
@misc{mindnlp2022,
title={{MindNLP}: a MindSpore NLP library},
author={MindNLP Contributors},
howpublished = {\url{https://github.com/mindlab-ai/mindnlp}},
year={2022}
}