Files changed (1) hide show
  1. README.md +82 -0
README.md CHANGED
@@ -84,3 +84,85 @@ The NORA.LLM language model family includes (as of now):
84
  - [**NorMistral-7b-warm**](https://huggingface.co/norallm/normistral-7b-warm) -- an LLM initialized from [Mistral-7b-v0.1](https://huggingface.co/mistralai/Mistral-7B-v0.1) and continuously pretrained on Norwegian data;
85
  - [**NorMistral-7b-scratch**](https://huggingface.co/norallm/normistral-7b-scratch) -- a Mistral-based LLM pretrained from scratch on Norwegian data;
86
  - [**NorBLOOM-7b-scratch**](https://huggingface.co/norallm/NorBLOOM-7b-scratch) -- a BLOOM-based LLM pretrained from scratch on Norwegian data.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84
  - [**NorMistral-7b-warm**](https://huggingface.co/norallm/normistral-7b-warm) -- an LLM initialized from [Mistral-7b-v0.1](https://huggingface.co/mistralai/Mistral-7B-v0.1) and continuously pretrained on Norwegian data;
85
  - [**NorMistral-7b-scratch**](https://huggingface.co/norallm/normistral-7b-scratch) -- a Mistral-based LLM pretrained from scratch on Norwegian data;
86
  - [**NorBLOOM-7b-scratch**](https://huggingface.co/norallm/NorBLOOM-7b-scratch) -- a BLOOM-based LLM pretrained from scratch on Norwegian data.
87
+
88
+ _____
89
+ ## Quantization
90
+
91
+ ### Provided files
92
+
93
+ | Name | Quant method | Bits Per Weight | Size | Max RAM/VRAM required | Use case |
94
+ | ---- | ---- | ---- | ---- | ---- | ----- |
95
+ | [normistral-7b-warm-instruct.Q3_K_M.gguf](https://huggingface.co/norallm/normistral-7b-warm/blob/main/normistral-7b-warm-instruct.Q3_K_M.gguf) | Q3_K_M | 3.89 | 3.28 GB| 5.37 GB | very small, high quality loss |
96
+ | [normistral-7b-warm-instruct.Q4_K_M.gguf](https://huggingface.co/norallm/normistral-7b-warm/blob/main/normistral-7b-warm-instruct.Q4_K_M.gguf) | Q4_K_M | 4.83 | 4.07 GB| 6.16 GB | medium, balanced quality - recommended |
97
+ | [normistral-7b-warm-instruct.Q5_K_M.gguf](https://huggingface.co/norallm/normistral-7b-warm/blob/main/normistral-7b-warm-instruct.Q5_K_M.gguf) | Q5_K_M | 5.67 | 4.78 GB| 6.87 GB | large, very low quality loss - recommended |
98
+ | [normistral-7b-warm-instruct.Q6_K.gguf](https://huggingface.co/norallm/normistral-7b-warm/blob/main/normistral-7b-warm-instruct.Q6_K.gguf) | Q6_K | 6.56 | 5.54 GB| 7.63 GB | very large, extremely low quality loss |
99
+ | [normistral-7b-warm-instruct.Q8_0.gguf](https://huggingface.co/norallm/normistral-7b-warm/blob/main/normistral-7b-warm-instruct.Q8_0.gguf) | Q8_0 | 8.50 | 7.17 GB| 9.26 GB | very large, extremely low quality loss - not recommended |
100
+
101
+ ### How to run from Python code
102
+
103
+ You can use GGUF models from Python using the [llama-cpp-python](https://github.com/abetlen/llama-cpp-python) for example.
104
+
105
+ #### How to load this model in Python code, using llama-cpp-python
106
+
107
+ For full documentation, please see: [llama-cpp-python docs](https://llama-cpp-python.readthedocs.io/en/latest/).
108
+
109
+ #### First install the package
110
+
111
+ Run one of the following commands, according to your system:
112
+
113
+ ```shell
114
+ # Base llama-ccp-python with no GPU acceleration
115
+ pip install llama-cpp-python
116
+ # With NVidia CUDA acceleration
117
+ CMAKE_ARGS="-DLLAMA_CUBLAS=on" pip install llama-cpp-python
118
+ # Or with OpenBLAS acceleration
119
+ CMAKE_ARGS="-DLLAMA_BLAS=ON -DLLAMA_BLAS_VENDOR=OpenBLAS" pip install llama-cpp-python
120
+ # Or with CLBLast acceleration
121
+ CMAKE_ARGS="-DLLAMA_CLBLAST=on" pip install llama-cpp-python
122
+ # Or with AMD ROCm GPU acceleration (Linux only)
123
+ CMAKE_ARGS="-DLLAMA_HIPBLAS=on" pip install llama-cpp-python
124
+ # Or with Metal GPU acceleration for macOS systems only
125
+ CMAKE_ARGS="-DLLAMA_METAL=on" pip install llama-cpp-python
126
+
127
+ # In windows, to set the variables CMAKE_ARGS in PowerShell, follow this format; eg for NVidia CUDA:
128
+ $env:CMAKE_ARGS = "-DLLAMA_OPENBLAS=on"
129
+ pip install llama-cpp-python
130
+ ```
131
+
132
+ #### Simple llama-cpp-python example code
133
+
134
+ ```python
135
+ from llama_cpp import Llama
136
+
137
+ # Directly from huggingface-hub (requires huggingface-hub to be installed)
138
+ # Set gpu_layers to the number of layers to offload to GPU. Set to 0 if no GPU acceleration is available on your system.
139
+ llm = Llama.from_pretrained(
140
+ repo_id="norallm/normistral-7b-warm-instruct", # HuggingFace repository containing the GGUF files.
141
+ filename="*Q4_K_M.gguf", # suffix of the filename containing the level of quantization.
142
+ n_ctx=32768, # The max sequence length to use - note that longer sequence lengths require much more resources
143
+ n_threads=8, # The number of CPU threads to use, tailor to your system and the resulting performance
144
+ n_gpu_layers=16 # The number of layers to offload to GPU, if you have GPU acceleration available
145
+ )
146
+
147
+ # Simple inference example
148
+ output = llm(
149
+ """<s><|im_start|> user
150
+ Hva kan jeg bruke einstape til?<|im_end|><|im_start|> assitant
151
+ """, # Prompt
152
+ max_tokens=512, # Generate up to 512 tokens
153
+ stop=["<|im_end|>"], # Example stop token
154
+ echo=True, # Whether to echo the prompt
155
+ temperature=0.3 # Temperature to set, for Q3_K_M, Q4_K_M, Q5_K_M, and Q6_0 it is recommended to set it relatively low.
156
+ )
157
+
158
+ # Chat Completion API
159
+
160
+ llm.create_chat_completion(
161
+ messages = [
162
+ {
163
+ "role": "user",
164
+ "content": Hva kan jeg bruke einstape til?"
165
+ }
166
+ ]
167
+ )
168
+ ```