Are you sure you want to delete this task? Once this task is deleted, it cannot be recovered.
zhangy03 3918e56f08 | 1 year ago | |
---|---|---|
Docs | 1 year ago | |
src | 1 year ago | |
.gitattributes | 2 years ago | |
.gitignore | 2 years ago | |
README.md | 1 year ago | |
config.json | 1 year ago | |
configuration_gptpangu.py | 2 years ago | |
modeling_gptpangu.py | 1 year ago | |
pangu_inference.py | 1 year ago | |
pangu_inference_cpu.py | 1 year ago | |
pangu_inference_gpu_fp32.py | 1 year ago | |
pangu_inference_int8.py | 1 year ago | |
pangu_train.py | 1 year ago | |
pytorch_model.bin | 1 year ago | |
tokenization_gptpangu.py | 1 year ago | |
vocab.model | 1 year ago |
非常感谢一名开发者将鹏程·盘古α 2.6B模型迁移至Huggingface Transformers库 huggingface.co/imone/pangu_2_6B ,同步我们也将此项目迁移到启智社区盘古项目下,方便用户使用。
PanGu-α is proposed by a joint technical team headed by PCNL. It is the first large-scale Chinese pre-trained language model with 200 billion parameters trained on 2048 Ascend processors using an automatic hybrid parallel training strategy. The whole training process is done on the “Peng Cheng Cloud Brain II” computing platform with the domestic deep learning framework called MindSpore. The PengCheng·PanGu-α pre-training model can support rich applications, has strong few-shot learning capabilities, and has outstanding performance in text generation tasks such as knowledge question and answer, knowledge retrieval, knowledge reasoning, and reading comprehension.
This repository contains PyTorch implementation of PanGu model, with
2.6 billion parameters pretrained weights (FP32 precision), converted from original MindSpore checkpoint.
(说明:因为transformers库暂不支持模型并行训练,故使用V100会显存溢出,您可以使用A100单卡进行微调)
可以直接使用现成的docker镜像
docker pull nvcr.io/nvidia/pytorch:21.03-py3
pip install transformers=='4.13.0'
pip install jieba
pip install sentencepiece==0.1.94
python ./pangu_2_6B/pangu_train.py
可以直接使用现成的docker镜像
docker pull nvcr.io/nvidia/pytorch:21.03-py3
pip install transformers=='4.22.0'
pip install jieba
pip install sentencepiece==0.1.94
python ./pangu_2_6B/pangu_inference_cpu.py或
使用jit模式
python ./pangu_2_6B/pangu_inference_cpu.py --no_cuda --use_ipex --jit_mode_eval
可以直接使用现成的docker镜像
docker pull nvcr.io/nvidia/pytorch:21.03-py3
pip install transformers=='4.22.0'
pip install jieba
pip install sentencepiece==0.1.94
python ./pangu_2_6B/pangu_inference.py
可以直接使用现成的docker镜像
docker pull nvcr.io/nvidia/pytorch:22.03-py3
pip install transformers=='4.22.0'
pip install jieba
pip install sentencepiece==0.1.94
pip install accelerate>=0.12.0
pip install bitsandbytes>=0.31.5
python ./pangu_2_6B/pangu_inference_int8.py
Currently PanGu model is not supported by transformers,
so trust_remote_code=True
is required to load model implementation in this repo.
from transformers import TextGenerationPipeline, AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("imone/pangu_2_6B", trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained("imone/pangu_2_6B", trust_remote_code=True)
text_generator = TextGenerationPipeline(model, tokenizer)
# greedy search
print(text_generator("中国和美国和日本和法国和加拿大和澳大利亚的首都分别是哪里?", max_length=50))
Expected output:
[{'generated_text': '中国和美国和日本和法国和加拿大和澳大利亚的首都分别是哪里?\n中国北京,美国华盛顿,日本东京,法国巴黎,加拿大多伦多,澳大利亚悉尼,新西兰奥克兰,澳大利亚墨尔本,新西兰奥克兰,'}]
No Description
Python
Dear OpenI User
Thank you for your continuous support to the Openl Qizhi Community AI Collaboration Platform. In order to protect your usage rights and ensure network security, we updated the Openl Qizhi Community AI Collaboration Platform Usage Agreement in January 2024. The updated agreement specifies that users are prohibited from using intranet penetration tools. After you click "Agree and continue", you can continue to use our services. Thank you for your cooperation and understanding.
For more agreement content, please refer to the《Openl Qizhi Community AI Collaboration Platform Usage Agreement》