birgermoell commited on
Commit
455a257
1 Parent(s): c8213eb

Updated model

Browse files
added_tokens.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"<|endoftext|>": 50265}
config.json CHANGED
@@ -1,7 +1,8 @@
1
  {
 
2
  "activation_function": "gelu_new",
3
  "architectures": [
4
- "GPT2Model"
5
  ],
6
  "attn_pdrop": 0.0,
7
  "bos_token_id": 50256,
 
1
  {
2
+ "_name_or_path": ".",
3
  "activation_function": "gelu_new",
4
  "architectures": [
5
+ "GPT2LMHeadModel"
6
  ],
7
  "attn_pdrop": 0.0,
8
  "bos_token_id": 50256,
evaluate.py ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ from transformers import GPT2Tokenizer, GPT2Model, pipeline, set_seed
2
+
3
+ tokenizer = GPT2Tokenizer.from_pretrained("flax-community/swe-gpt-wiki")
4
+ model = GPT2Model.from_pretrained("flax-community/swe-gpt-wiki")
5
+
6
+ generator = pipeline('text-generation', model=model)
7
+ set_seed(42)
8
+ generator("Hej, jag är en språkmodell,", max_length=30, num_return_sequences=5)
merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
pytorch_model.bin CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:6f0735a9f1b2acfbb15130aab162d2cc8b323dabdc0399b25a7f348d0bb0de2d
3
- size 510397417
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:226e91a5056e14d4bf8079bfc261958fbf6d8ec09a834091235ba01ca5fbf88e
3
+ size 510401385
save_model.py CHANGED
@@ -1,6 +1,8 @@
1
- from transformers.modeling_flax_pytorch_utils import load_flax_checkpoint_in_pytorch_model
2
- from transformers import GPT2Config, GPT2Model
3
- config = GPT2Config.from_pretrained("./")
4
- model = GPT2Model(config)
5
- load_flax_checkpoint_in_pytorch_model(model, "./flax_model.msgpack")
6
- model.save_pretrained("./")
 
 
 
1
+ from transformers import AutoTokenizer, GPT2LMHeadModel
2
+ '''
3
+ This is a script to convert the Jax model and the tokenizer to Pytorch model
4
+ '''
5
+ model = GPT2LMHeadModel.from_pretrained(".", from_flax=True)
6
+ model.save_pretrained(".")
7
+ tokenizer = AutoTokenizer.from_pretrained(".")
8
+ tokenizer.save_pretrained(".")
special_tokens_map.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"bos_token": "<|endoftext|>", "eos_token": "<|endoftext|>", "unk_token": "<|endoftext|>"}
tokenizer.json CHANGED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"unk_token": "<|endoftext|>", "bos_token": "<|endoftext|>", "eos_token": "<|endoftext|>", "add_prefix_space": false, "special_tokens_map_file": null, "name_or_path": ".", "tokenizer_class": "GPT2Tokenizer"}
vocab.json ADDED
The diff for this file is too large to render. See raw diff