birgermoell
commited on
Commit
•
455a257
1
Parent(s):
c8213eb
Updated model
Browse files- added_tokens.json +1 -0
- config.json +2 -1
- evaluate.py +8 -0
- merges.txt +0 -0
- pytorch_model.bin +2 -2
- save_model.py +8 -6
- special_tokens_map.json +1 -0
- tokenizer.json +0 -0
- tokenizer_config.json +1 -0
- vocab.json +0 -0
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 |
-
"
|
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:
|
3 |
-
size
|
|
|
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
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
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
|
|