birgermoell commited on
Commit
8f10943
0 Parent(s):

Updated models

Browse files
.gitattributes ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.bin.* filter=lfs diff=lfs merge=lfs -text
2
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.h5 filter=lfs diff=lfs merge=lfs -text
5
+ *.tflite filter=lfs diff=lfs merge=lfs -text
6
+ *.tar.gz filter=lfs diff=lfs merge=lfs -text
7
+ *.ot filter=lfs diff=lfs merge=lfs -text
8
+ *.onnx filter=lfs diff=lfs merge=lfs -text
9
+ *.arrow filter=lfs diff=lfs merge=lfs -text
10
+ *.ftz filter=lfs diff=lfs merge=lfs -text
11
+ *.joblib filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.pb filter=lfs diff=lfs merge=lfs -text
15
+ *.pt filter=lfs diff=lfs merge=lfs -text
16
+ *.pth filter=lfs diff=lfs merge=lfs -text
17
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language: sv
3
+ license: CC-BY 4.0
4
+ tags:
5
+ - swedish
6
+ - roberta
7
+ pipeline_tag: fill-mask
8
+ widget:
9
+ - text: "Meninged med livet är <mask>."
10
+ ---
11
+ # Nordic Roberta Wikipedia
12
+ ## Description
13
+ This is a sample reference model for Flax/Jax training using only Wikipedia.
config.json ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "RobertaModel"
4
+ ],
5
+ "attention_probs_dropout_prob": 0.1,
6
+ "bos_token_id": 0,
7
+ "eos_token_id": 2,
8
+ "gradient_checkpointing": false,
9
+ "hidden_act": "gelu",
10
+ "hidden_dropout_prob": 0.1,
11
+ "hidden_size": 768,
12
+ "initializer_range": 0.02,
13
+ "intermediate_size": 3072,
14
+ "layer_norm_eps": 1e-05,
15
+ "max_position_embeddings": 514,
16
+ "model_type": "roberta",
17
+ "num_attention_heads": 12,
18
+ "num_hidden_layers": 12,
19
+ "pad_token_id": 1,
20
+ "position_embedding_type": "absolute",
21
+ "transformers_version": "4.8.2",
22
+ "type_vocab_size": 1,
23
+ "use_cache": true,
24
+ "vocab_size": 50265
25
+ }
evaluate.py ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers import AutoTokenizer, AutoModelForMaskedLM
2
+ from transformers import RobertaTokenizer, RobertaForMaskedLM, pipeline
3
+ import torch
4
+
5
+ def pt_evaluate():
6
+ tokenizer = AutoTokenizer.from_pretrained("flax-community/nordic-roberta-wiki")
7
+
8
+ model = AutoModelForMaskedLM.from_pretrained("flax-community/nordic-roberta-wiki")
9
+
10
+ my_unmasker_pipeline = pipeline('fill-mask', model=model, tokenizer=tokenizer)
11
+ output = my_unmasker_pipeline("Det är roligt att <mask>")
12
+ print(output)
13
+
14
+ pt_evaluate()
events.out.tfevents.1626222578.t1v-n-905ccd3e-w-0.103680.3.v2 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ce13e3deff699d3708c8aa4c58e2a2ff6d0c9e158899a6fd7ec73d516f9b46a1
3
+ size 40
events.out.tfevents.1626225112.t1v-n-905ccd3e-w-0.105814.3.v2 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:448d08b9c3b33ab006a6bf43bc9a72607d4686c7d4b83768c8bc6eed3ca12f91
3
+ size 40
events.out.tfevents.1626225189.t1v-n-905ccd3e-w-0.107090.3.v2 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:13c00b57eeb0d7e87b0a5625afbd5a690f951d475ad37e5c01157a740061f852
3
+ size 40
events.out.tfevents.1626225342.t1v-n-905ccd3e-w-0.108396.3.v2 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:917e79027e6d04bf7dfa59015b83bcfe83977e1d8b0e43028c1a5af0a6558456
3
+ size 336461
events.out.tfevents.1626248489.t1v-n-905ccd3e-w-0.123625.3.v2 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c6a54b8878b7d5c432d7c82c21ba1b0aee5b6a6cb964ea2658de4a15accd3307
3
+ size 40
events.out.tfevents.1626248655.t1v-n-905ccd3e-w-0.131950.3.v2 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a57d685442e397e189223afceea98fd38013facbffeda690a1729dc105c83320
3
+ size 3817116
events.out.tfevents.1626306539.t1v-n-905ccd3e-w-0.142585.3.v2 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bb6e08c0302a586b76e4bce62c5cd268b4baef7038a0df4010206abec955372d
3
+ size 44930516
flax_model.msgpack ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:136f2447ead93d2666556ae532ef7fdde053f90d6af53fe163b8fc5a1c53f152
3
+ size 498796983
merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5b7c64bff19e969f8e9deb9094d52db871b199108d1a4323f46ab301debcbaf4
3
+ size 498661169
save_model.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers.modeling_flax_pytorch_utils import load_flax_checkpoint_in_pytorch_model
2
+ from transformers import RobertaConfig, RobertaModel
3
+ config = RobertaConfig.from_pretrained("./")
4
+ model = RobertaModel(config)
5
+ load_flax_checkpoint_in_pytorch_model(model, "./flax_model.msgpack")
6
+ model.save_pretrained("./")
7
+
8
+ from transformers import AutoTokenizer
9
+ tokenizer = AutoTokenizer.from_pretrained("./")
10
+ tokenizer.save_pretrained("./")
11
+ ('./tokenizer_config.json',
12
+ './special_tokens_map.json',
13
+ './vocab.json',
14
+ './merges.txt',
15
+ './added_tokens.json',
16
+ './tokenizer.json')
setup_config.py ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ from transformers import RobertaConfig
2
+
3
+ model_dir = "./swe-roberta-wiki-oscar" # ${MODEL_DIR}
4
+
5
+ config = RobertaConfig.from_pretrained("roberta-base")
6
+ config.save_pretrained(model_dir)
special_tokens_map.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"bos_token": "<s>", "eos_token": "</s>", "unk_token": "<unk>", "sep_token": "</s>", "pad_token": "<pad>", "cls_token": "<s>", "mask_token": {"content": "<mask>", "single_word": false, "lstrip": true, "rstrip": false, "normalized": false}}
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"unk_token": "<unk>", "bos_token": "<s>", "eos_token": "</s>", "add_prefix_space": false, "errors": "replace", "sep_token": "</s>", "cls_token": "<s>", "pad_token": "<pad>", "mask_token": "<mask>", "special_tokens_map_file": null, "name_or_path": "./", "tokenizer_class": "RobertaTokenizer"}
vocab.json ADDED
The diff for this file is too large to render. See raw diff