Instructions to use luxiao/alilingjie with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use luxiao/alilingjie with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("luxiao/alilingjie", dtype="auto") - Notebooks
- Google Colab
- Kaggle
| """ | |
| @file : main.py.py | |
| @author : xiaolu | |
| @email : luxiaonlp@163.com | |
| @time : 2022-04-06 | |
| """ | |
| from tokenization import WoBertTokenizer | |
| from transformers.models.bert import BertModel, BertConfig | |
| input_sentent = '欢迎使用阿里灵界比赛预训练模型' | |
| tokenizer = WoBertTokenizer.from_pretrained('luxiao/alilingjie') | |
| input_ids = tokenizer.encode(input_sentent, return_tensors='pt') | |
| model = BertModel.from_pretrained('luxiao/alilingjie') | |
| output = model(input_ids) | |
| print(output[0].size()) # torch.Size([1, 11, 768]) | |
| print(output[1].size()) # torch.Size([1, 768]) |