h-j-han
commited on
Commit
·
b32f1b2
1
Parent(s):
11cfd54
Fix new line issue & Match vocab type to base model
Browse files- README.md +4 -2
- config.json +1 -1
- model-00001-of-00003.safetensors +2 -2
- model-00003-of-00003.safetensors +2 -2
- model.safetensors.index.json +1 -1
- tokenizer.json +0 -0
README.md
CHANGED
@@ -29,10 +29,10 @@ These are the merged version: after training the adapters, we merge the original
|
|
29 |
```python
|
30 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
31 |
|
32 |
-
# model_name = "mistralai/Mistral-7B-v0.1 # Base Model
|
33 |
model_name = "h-j-han/Mistral-7B-VocADT-50k-Cyrillic" # Vocabulary Adapted Model
|
34 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
35 |
-
model = AutoModelForCausalLM.from_pretrained(model_name)
|
36 |
|
37 |
prefix = "\nEnglish: Hello!\nUkrainian: Добрий день!\nEnglish: How are you?\nUkrainian: Як справи?\nEnglish: "
|
38 |
line = "Do you speak English?"
|
@@ -40,6 +40,8 @@ suffix = f"\nUkrainian:"
|
|
40 |
prompt = prefix + line + suffix
|
41 |
|
42 |
inputs = tokenizer(prompt, return_tensors="pt")
|
|
|
|
|
43 |
outputs = model.generate(**inputs, max_new_tokens=7)
|
44 |
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
45 |
|
|
|
29 |
```python
|
30 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
31 |
|
32 |
+
# model_name = "mistralai/Mistral-7B-v0.1" # Base Model
|
33 |
model_name = "h-j-han/Mistral-7B-VocADT-50k-Cyrillic" # Vocabulary Adapted Model
|
34 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
35 |
+
model = AutoModelForCausalLM.from_pretrained(model_name, device_map="auto")
|
36 |
|
37 |
prefix = "\nEnglish: Hello!\nUkrainian: Добрий день!\nEnglish: How are you?\nUkrainian: Як справи?\nEnglish: "
|
38 |
line = "Do you speak English?"
|
|
|
40 |
prompt = prefix + line + suffix
|
41 |
|
42 |
inputs = tokenizer(prompt, return_tensors="pt")
|
43 |
+
for item in inputs:
|
44 |
+
inputs[item] = inputs[item].cuda()
|
45 |
outputs = model.generate(**inputs, max_new_tokens=7)
|
46 |
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
47 |
|
config.json
CHANGED
@@ -21,5 +21,5 @@
|
|
21 |
"torch_dtype": "bfloat16",
|
22 |
"transformers_version": "4.43.0.dev0",
|
23 |
"use_cache": true,
|
24 |
-
"vocab_size":
|
25 |
}
|
|
|
21 |
"torch_dtype": "bfloat16",
|
22 |
"transformers_version": "4.43.0.dev0",
|
23 |
"use_cache": true,
|
24 |
+
"vocab_size": 50000
|
25 |
}
|
model-00001-of-00003.safetensors
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:d195ff8bd0524853c5852b7c3fc99c45e50300df713899fd8a6d6c30fdf7523e
|
3 |
+
size 4973177712
|
model-00003-of-00003.safetensors
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:06b8123e8fd7f2131212a6246f8cd2dec41d75a25d14a0aaec704fbf6aaeb738
|
3 |
+
size 4889316136
|
model.safetensors.index.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
{
|
2 |
"metadata": {
|
3 |
-
"total_size":
|
4 |
},
|
5 |
"weight_map": {
|
6 |
"lm_head.weight": "model-00003-of-00003.safetensors",
|
|
|
1 |
{
|
2 |
"metadata": {
|
3 |
+
"total_size": 14778376192
|
4 |
},
|
5 |
"weight_map": {
|
6 |
"lm_head.weight": "model-00003-of-00003.safetensors",
|
tokenizer.json
CHANGED
The diff for this file is too large to render.
See raw diff
|
|