Views
No views yet
transformers==4.46.1 and tokenizers==0.20.1)modeling_ltgbert.py, you should therefore load the model with trust_remote_code=True.1import torch
2from transformers import AutoTokenizer, AutoModelForMaskedLM
3
4tokenizer = AutoTokenizer.from_pretrained("HPLT/hplt_bert_base_2_0_fin-Latn")
5model = AutoModelForMaskedLM.from_pretrained("HPLT/hplt_bert_base_2_0_fin-Latn", trust_remote_code=True)
6
7mask_id = tokenizer.convert_tokens_to_ids("[MASK]")
8input_text = tokenizer("It's a beautiful[MASK].", return_tensors="pt")
9output_p = model(**input_text)
10output_text = torch.where(input_text.input_ids == mask_id, output_p.logits.argmax(-1), input_text.input_ids)
11
12# should output: '[CLS] It's a beautiful place.[SEP]'
13print(tokenizer.decode(output_text[0].tolist(), clean_up_tokenization_spaces=True))AutoModel, AutoModelMaskedLM, AutoModelForSequenceClassification, AutoModelForTokenClassification, AutoModelForQuestionAnswering and AutoModeltForMultipleChoice.stepXXX: for example, step18750.transformers using the argument revision:model = AutoModelForMaskedLM.from_pretrained("HPLT/hplt_bert_base_2_0_fin-Latn", revision="step21875", trust_remote_code=True)1from huggingface_hub import list_repo_refs
2out = list_repo_refs("HPLT/hplt_bert_base_2_0_fin-Latn")
3print([b.name for b in out.branches])1@inproceedings{samuel-etal-2023-trained,
2 title = "Trained on 100 million words and still in shape: {BERT} meets {B}ritish {N}ational {C}orpus",
3 author = "Samuel, David and
4 Kutuzov, Andrey and
5 {\O}vrelid, Lilja and
6 Velldal, Erik",
7 editor = "Vlachos, Andreas and
8 Augenstein, Isabelle",
9 booktitle = "Findings of the Association for Computational Linguistics: EACL 2023",
10 month = may,
11 year = "2023",
12 address = "Dubrovnik, Croatia",
13 publisher = "Association for Computational Linguistics",
14 url = "https://aclanthology.org/2023.findings-eacl.146",
15 doi = "10.18653/v1/2023.findings-eacl.146",
16 pages = "1954--1974"
17}1@misc{burchell2025expandedmassivemultilingualdataset,
2 title={An Expanded Massive Multilingual Dataset for High-Performance Language Technologies},
3 author={Laurie Burchell and Ona de Gibert and Nikolay Arefyev and Mikko Aulamo and Marta Bañón and Pinzhen Chen and Mariia Fedorova and Liane Guillou and Barry Haddow and Jan Hajič and Jindřich Helcl and Erik Henriksson and Mateusz Klimaszewski and Ville Komulainen and Andrey Kutuzov and Joona Kytöniemi and Veronika Laippala and Petter Mæhlum and Bhavitvya Malik and Farrokh Mehryary and Vladislav Mikhailov and Nikita Moghe and Amanda Myntti and Dayyán O'Brien and Stephan Oepen and Proyag Pal and Jousia Piha and Sampo Pyysalo and Gema Ramírez-Sánchez and David Samuel and Pavel Stepachev and Jörg Tiedemann and Dušan Variš and Tereza Vojtěchová and Jaume Zaragoza-Bernabeu},
4 year={2025},
5 eprint={2503.10267},
6 archivePrefix={arXiv},
7 primaryClass={cs.CL},
8 url={https://arxiv.org/abs/2503.10267},
9}