Migrate model card from transformers-repo
Browse filesRead announcement at https://discuss.huggingface.co/t/announcement-all-model-cards-will-be-migrated-to-hf-co-model-repos/2755
Original file history: https://github.com/huggingface/transformers/commits/master/model_cards/surajp/albert-base-sanskrit/README.md
README.md
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language: sa
|
3 |
+
---
|
4 |
+
|
5 |
+
|
6 |
+
# ALBERT-base-Sanskrit
|
7 |
+
|
8 |
+
|
9 |
+
Explaination Notebook Colab: [SanskritALBERT.ipynb](https://colab.research.google.com/github/parmarsuraj99/suraj-parmar/blob/master/_notebooks/2020-05-02-SanskritALBERT.ipynb)
|
10 |
+
|
11 |
+
Size of the model is **46MB**
|
12 |
+
|
13 |
+
Example of usage:
|
14 |
+
|
15 |
+
```
|
16 |
+
tokenizer = AutoTokenizer.from_pretrained("surajp/albert-base-sanskrit")
|
17 |
+
model = AutoModel.from_pretrained("surajp/albert-base-sanskrit")
|
18 |
+
|
19 |
+
enc=tokenizer.encode("ॐ सर्वे भवन्तु सुखिनः सर्वे सन्तु निरामयाः । सर्वे भद्राणि पश्यन्तु मा कश्चिद्दुःखभाग्भवेत् । ॐ शान्तिः शान्तिः शान्तिः ॥")
|
20 |
+
print(tokenizer.decode(enc))
|
21 |
+
|
22 |
+
ps = model(torch.tensor(enc).unsqueeze(1))
|
23 |
+
print(ps[0].shape)
|
24 |
+
```
|
25 |
+
```
|
26 |
+
'''
|
27 |
+
Output:
|
28 |
+
--------
|
29 |
+
[CLS] ॐ सर्वे भवन्तु सुखिनः सर्वे सन्तु निरामयाः । सर्वे भद्राणि पश्यन्तु मा कश्चिद्दुःखभाग्भवेत् । ॐ शान्तिः शान्तिः शान्तिः ॥[SEP]
|
30 |
+
torch.Size([28, 1, 768])
|
31 |
+
```
|
32 |
+
|
33 |
+
|
34 |
+
> Created by [Suraj Parmar/@parmarsuraj99](https://twitter.com/parmarsuraj99)
|
35 |
+
|
36 |
+
> Made with <span style="color: #e25555;">♥</span> in India
|