dmis-lab commited on
Commit
e14347d
·
verified ·
1 Parent(s): 7f71885

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +7 -1
README.md CHANGED
@@ -153,9 +153,15 @@ UltraBERT is a pre-norm Transformer encoder with RoPE, SwiGLU feed-forward layer
153
 
154
  - `model.safetensors` in float32 (the pre-training master weights), with `config.dtype: float32`.
155
  - The encoder and the MLM head.
156
- - The MLM head is the one trained on the 5% masked sequences (the distilled head); the 50% head is not included.
157
  - Remote code for `transformers` 5.x with `UltrabertModel`, `UltrabertForMaskedLM`, `UltrabertForSequenceClassification`, `UltrabertForQuestionAnswering` and `UltrabertForTokenClassification`.
 
158
 
 
 
 
 
 
 
159
 
160
  ## ⚙️ Pre-Training
161
 
 
153
 
154
  - `model.safetensors` in float32 (the pre-training master weights), with `config.dtype: float32`.
155
  - The encoder and the MLM head.
 
156
  - Remote code for `transformers` 5.x with `UltrabertModel`, `UltrabertForMaskedLM`, `UltrabertForSequenceClassification`, `UltrabertForQuestionAnswering` and `UltrabertForTokenClassification`.
157
+ - The MLM head is the one trained on the 5% masked sequences (the distilled head); the 50% head is a separate file, [`head_50%.pth`](./head_50%25.pth). To swap it into `UltrabertForMaskedLM`:
158
 
159
+ ```python
160
+ from huggingface_hub import hf_hub_download
161
+
162
+ head_path = hf_hub_download("dmis-lab/UltraBERT-150M", "head_50%.pth")
163
+ model.load_state_dict(torch.load(head_path), strict=False)
164
+ ```
165
 
166
  ## ⚙️ Pre-Training
167