File size: 3,222 Bytes
593c933
bf0cf2c
 
 
 
 
 
 
 
 
593c933
 
bf0cf2c
 
 
 
 
 
 
 
 
abe3978
 
 
bf0cf2c
e48936f
bf0cf2c
 
 
 
 
 
 
 
 
 
 
aa2bc93
 
 
 
 
 
 
f8289c2
aa2bc93
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
bf0cf2c
 
 
 
 
 
 
 
 
2fa6252
aa612f6
 
 
bf0cf2c
 
 
 
 
 
 
 
 
 
 
6f96a48
 
 
aa612f6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
---
base_model: meta-llama/Meta-Llama-3-8B
tags:
  - llama
  - NorskGPT
  - instruct
  - finetune
language:
  - no

license: cc-by-nc-sa-4.0
---


# NorskGPT-Llama-3-8b-v0.1

This model is a Norwegian variant of 
Meta-Llama-3-8B, fine-tuned on a carefully selected mix of Norwegian instruction pairs. The model is tuned to understand and generate text in Norwegain. 


## Intended Use

This model is free to use for personal and research use. However a commercial license is required for commerical applications. 
This model can be used as an assistant-like chat. Try it out :)


## Prompt Template

```
<|im_start|>system
Du er NorskGPT ....<|im_end|>
<|im_start|>user
Hei<|im_end|>
<|im_start|>assistant
Hei, hva kan jeg hjelpe deg med?<|im_end|>
```

## Sample script

```python
from transformers import AutoModelForCausalLM, AutoTokenizer

device = "cuda" # the device to load the model onto

model_name = "bineric/NorskGPT-Llama3-8b"
model = AutoModelForCausalLM.from_pretrained(model_name)
tokenizer = AutoTokenizer.from_pretrained(model_name)

messages = [
    {"role": "user", "content": "Du er NorskGPT - en AI bot som hjelper brukeren med å svare på spørsmål?"},
    {"role": "assistant", "content": "Hei, jeg er NorskGPT, hva kan jeg hjelpe deg med?"},
    {"role": "user", "content": "Fortell meg om Oslo"}
]

encodeds = tokenizer.apply_chat_template(messages, return_tensors="pt")

model_inputs = encodeds.to(device)
model.to(device)

generated_ids = model.generate(model_inputs, max_new_tokens=1000, do_sample=True)
decoded = tokenizer.batch_decode(generated_ids)
print(decoded[0])
```


## Limitations
*   This is an LLM, not a knowledge model. It can not be expected to have more information about Norway than the base model.
*   It will generally preform better on tasks that involves summarization, question answering and chat, than on tasks that requires more knowledge about Norway, specific domains, or tasks where the model can answer freely.
*   The model is released as is, and would in most cases need prompt tuning to achieve optimal results.
 

## License
[Attribution-NonCommercial-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-nc-sa/4.0/)


 This model is free to use for personal and research use. However a commercial license is required for commerical applications.
 
 You are free to:

    Share — copy and redistribute the material in any medium or format
    Adapt — remix, transform, and build upon the material
    The licensor cannot revoke these freedoms as long as you follow the license terms.

Under the following terms:

    Attribution — You must give appropriate credit , provide a link to the license, and indicate if changes were made . You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
    NonCommercial — You may not use the material for commercial purposes .
    ShareAlike — If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.
    No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.