File size: 822 Bytes
53d794e 198f241 53d794e 198f241 53d794e 198f241 53d794e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
---
tags:
- "nlp"
---
## The model for Zarakun/ukrainian_news dataset classification task
This model is an instance of [XLM-RoBERTa](https://huggingface.co/FacebookAI/xlm-roberta-base)
pretrained with the head with 15 classes
### Loading the model
Loading script that loads the model from checkpoint <checkpoint_name>
```
>>> config = XLMRobertaConfig.from_pretrained("FacebookAI/xlm-roberta-base")
>>> config.num_labels = 15
>>> model_pr = XLMRobertaForSequenceClassification(config)
>>> api = hub.HfApi()
>>> api.hf_hub_download(
... repo_id="Zarakun/ukrainian_news_classification",
... repo_type="model",
... filename="checkpoints/{}".format(<checkpoint_name>),
... local_dir="./"
... )
>>> model_pr.load_state_dict(torch.load("./checkpoints/{}".format(<checkpoint_name>), map_location="cpu"))
``` |