Back to all models
fill-mask mask_token: [MASK]
Query this model
🔥 This model is currently loaded and running on the Inference API. ⚠️ This model could not be loaded by the inference API. ⚠️ This model can be loaded on the Inference API on-demand.
JSON Output
API endpoint
								$
								curl -X POST \
-H "Authorization: Bearer YOUR_ORG_OR_USER_API_TOKEN" \
-H "Content-Type: application/json" \
-d '"json encoded string"' \
https://api-inference.huggingface.co/models/surajp/albert-base-sanskrit
Share Copied link to clipboard

Monthly model downloads

surajp/albert-base-sanskrit surajp/albert-base-sanskrit
25 downloads
last 30 days

pytorch

tf

Contributed by

surajp Suraj Parmar
3 models

How to use this model directly from the 🤗/transformers library:

			
Copy to clipboard
from transformers import AutoTokenizer, AutoModelWithLMHead tokenizer = AutoTokenizer.from_pretrained("surajp/albert-base-sanskrit") model = AutoModelWithLMHead.from_pretrained("surajp/albert-base-sanskrit")

ALBERT-base-Sanskrit

Explaination Notebook Colab: SanskritALBERT.ipynb

Size of the model is 46MB

Example of usage:

tokenizer = AutoTokenizer.from_pretrained("surajp/albert-base-sanskrit")
model = AutoModel.from_pretrained("surajp/albert-base-sanskrit")

enc=tokenizer.encode("ॐ सर्वे भवन्तु सुखिनः सर्वे सन्तु निरामयाः । सर्वे भद्राणि पश्यन्तु मा कश्चिद्दुःखभाग्भवेत् । ॐ शान्तिः शान्तिः शान्तिः ॥")
print(tokenizer.decode(enc))

ps = model(torch.tensor(enc).unsqueeze(1))
print(ps[0].shape)
'''
Output:
--------
[CLS] ॐ सर्वे भवन्तु सुखिनः सर्वे सन्तु निरामयाः । सर्वे भद्राणि पश्यन्तु मा कश्चिद्दुःखभाग्भवेत् । ॐ शान्तिः शान्तिः शान्तिः ॥[SEP]
torch.Size([28, 1, 768])

Created by Suraj Parmar/@parmarsuraj99

Made with in India