Views
No views yet
hmthanh/VietnamLegalText-SBERTtransformerstransformers with pip:pip install transformerstokenizers with pip:pip install tokenizers| Model | #params | Arch. | Max length | Pre-training data |
|---|---|---|---|---|
hmthanh/VietnamLegalText-SBERT | 135M | base | 256 | 20GB of texts |
1import torch
2from transformers import AutoModel, AutoTokenizer
3
4phobert = AutoModel.from_pretrained("hmthanh/VietnamLegalText-SBERT")
5tokenizer = AutoTokenizer.from_pretrained("hmthanh/VietnamLegalText-SBERT")
6
7sentence = 'Vượt đèn đỏ bị phạt bao nhiêu tiền?'
8
9input_ids = torch.tensor([tokenizer.encode(sentence)])
10
11with torch.no_grad():
12 features = phobert(input_ids) # Models outputs are now tuples