Giter Club home page Giter Club logo

cybertron's Introduction

Cybertron

Run tests

使用MindSpore实现的预训练模型框架,支持各类Transformers,兼容Huggingface的Transformers实现。针对MindSpore提供的自动并行特性,逐步提供相关能力,给使用MindSpore的同学们做科研提供便利。

安装

由于还在不断更新迭代,暂时不上传whl包。

源码安装

# From Github(outside GFW)
pip install git+https://github.com/lvyufeng/cybertron
# From OpenI(inside GFW)
pip install git+https://git.openi.org.cn/lvyufeng/cybertron

快速入门

Cybertron提供类似于Transformers的编码体验,可以直接使用模型名一键加载,具体使用方式如下:

import mindspore
from cybertron import BertTokenizer, BertModel

tokenizer = BertTokenizer.load('bert-base-uncased')
model = BertModel.load('bert-base-uncased')
model.set_train(False)

# get tokenized inputs
inputs = mindspore.Tensor([tokenizer.encode("Here is some text to encode", add_special_tokens=True)], mindspore.int32)
# run model inference
outputs = model(inputs)

此外,模型直接兼容Huggingface提供的Checkpoint,故而可以选择直接下载Pytorch权重,一键转换并加载:

from cybertron import BertModel

model = BertModel.load('bert-base-uncased', from_torch=True)

什么是Cybertron?

塞伯坦(Cybertron)是变形金刚种族的母星,是一个和地球近邻土星体积近似的巨大金属行星。Cybertron框架致力于提供各类Transformers模型及其变体,以及各类预训练模型的创新算法应用,成为Transformers模型的“母星”。

Notice

所有的Checkpoint将会放到Huggingface,解决下载问题。

cybertron's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.