Downloads · 30 days
0
0% of all-time downloads
Zarakun/ukrainian_news_classification
ukrainian_news_classification is a machine learning model from Zarakun. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This model is an instance of XLM-RoBERTa pretrained with the head with 15 classes
Downloads · 30 days
0
0% of all-time downloads
All-time downloads
7
Public
Repo size
4.5 GB
Likes
0
Public
Click a slice to open those files.
Other1.1 GB · 100%
From the Hugging Face model README
This model is an instance of XLM-RoBERTa pretrained with the head with 15 classes
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"))