MaziyarPanahi commited on
Commit
f82f805
1 Parent(s): 6c07e11

Upload folder using huggingface_hub

Browse files
.gitattributes CHANGED
@@ -33,3 +33,13 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ BioMistral-7B-SLERP.Q2_K.gguf filter=lfs diff=lfs merge=lfs -text
37
+ BioMistral-7B-SLERP.Q3_K_L.gguf filter=lfs diff=lfs merge=lfs -text
38
+ BioMistral-7B-SLERP.Q3_K_M.gguf filter=lfs diff=lfs merge=lfs -text
39
+ BioMistral-7B-SLERP.Q3_K_S.gguf filter=lfs diff=lfs merge=lfs -text
40
+ BioMistral-7B-SLERP.Q4_K_M.gguf filter=lfs diff=lfs merge=lfs -text
41
+ BioMistral-7B-SLERP.Q4_K_S.gguf filter=lfs diff=lfs merge=lfs -text
42
+ BioMistral-7B-SLERP.Q5_K_M.gguf filter=lfs diff=lfs merge=lfs -text
43
+ BioMistral-7B-SLERP.Q5_K_S.gguf filter=lfs diff=lfs merge=lfs -text
44
+ BioMistral-7B-SLERP.Q6_K.gguf filter=lfs diff=lfs merge=lfs -text
45
+ BioMistral-7B-SLERP.Q8_0.gguf filter=lfs diff=lfs merge=lfs -text
BioMistral-7B-SLERP.Q2_K.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:372540afc40e7e62d3806495b4f84d98ee3d6a1646b5cdbfe695c7112e618605
3
+ size 2719242432
BioMistral-7B-SLERP.Q3_K_L.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1906819f14f058881368a8daa2b68adb75890a23f2b50d343e3af15587da50c6
3
+ size 3822024896
BioMistral-7B-SLERP.Q3_K_M.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0e7c1ca9a10ee2a02197231094d41f4061004fd55ecc89120bdb884937f2becb
3
+ size 3518986432
BioMistral-7B-SLERP.Q3_K_S.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a0ccf092083cb5265fbeb35513bb0b118c9a0f838552b2f130323c0eee728af4
3
+ size 3164567744
BioMistral-7B-SLERP.Q4_K_M.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:de085c1f143732d6d8a50458455236b7001a414a4bcda753d74d5fac88c22857
3
+ size 4368439488
BioMistral-7B-SLERP.Q4_K_S.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b4af2b9120bb4abe1095e32259de034306410935cd3ed1cf21543ea2a323a23c
3
+ size 4140374208
BioMistral-7B-SLERP.Q5_K_M.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d333b864c12c25fda0709fbd65608e8c96d97f456573a8cffebe9020e97490d9
3
+ size 5131409600
BioMistral-7B-SLERP.Q5_K_S.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c17e4006e43155ec389ca95411925cb0246e5359c94c9ce0b991880f9b0e0ade
3
+ size 4997716160
BioMistral-7B-SLERP.Q6_K.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:aa23fc540178f2d27b581fb3fabb450a26f64efdd5600dc9d04d7daa8052a552
3
+ size 5942065344
BioMistral-7B-SLERP.Q8_0.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ee07d0222d6260b6593f0ff291e8ec061b9a1a06aacb2d987875d9e3739dcf0c
3
+ size 7695857856
README.md ADDED
@@ -0,0 +1,241 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - quantized
4
+ - 2-bit
5
+ - 3-bit
6
+ - 4-bit
7
+ - 5-bit
8
+ - 6-bit
9
+ - 8-bit
10
+ - GGUF
11
+ - transformers
12
+ - safetensors
13
+ - mistral
14
+ - text-generation
15
+ - mergekit
16
+ - merge
17
+ - slerp
18
+ - medical
19
+ - biology
20
+ - conversational
21
+ - fr
22
+ - en
23
+ - es
24
+ - it
25
+ - pl
26
+ - nl
27
+ - de
28
+ - dataset:pubmed
29
+ - arxiv:2402.10373
30
+ - base_model:BioMistral/BioMistral-7B
31
+ - base_model:mistralai/Mistral-7B-Instruct-v0.1
32
+ - license:apache-2.0
33
+ - autotrain_compatible
34
+ - endpoints_compatible
35
+ - has_space
36
+ - text-generation-inference
37
+ - region:us
38
+ - text-generation
39
+ model_name: BioMistral-7B-SLERP-GGUF
40
+ base_model: BioMistral/BioMistral-7B-SLERP
41
+ inference: false
42
+ model_creator: BioMistral
43
+ pipeline_tag: text-generation
44
+ quantized_by: MaziyarPanahi
45
+ ---
46
+ # [MaziyarPanahi/BioMistral-7B-SLERP-GGUF](https://huggingface.co/MaziyarPanahi/BioMistral-7B-SLERP-GGUF)
47
+ - Model creator: [BioMistral](https://huggingface.co/BioMistral)
48
+ - Original model: [BioMistral/BioMistral-7B-SLERP](https://huggingface.co/BioMistral/BioMistral-7B-SLERP)
49
+
50
+ ## Description
51
+ [MaziyarPanahi/BioMistral-7B-SLERP-GGUF](https://huggingface.co/MaziyarPanahi/BioMistral-7B-SLERP-GGUF) contains GGUF format model files for [BioMistral/BioMistral-7B-SLERP](https://huggingface.co/BioMistral/BioMistral-7B-SLERP).
52
+
53
+ ## How to use
54
+ Thanks to [TheBloke](https://huggingface.co/TheBloke) for preparing an amazing README on how to use GGUF models:
55
+
56
+ ### About GGUF
57
+
58
+ GGUF is a new format introduced by the llama.cpp team on August 21st 2023. It is a replacement for GGML, which is no longer supported by llama.cpp.
59
+
60
+ Here is an incomplete list of clients and libraries that are known to support GGUF:
61
+
62
+ * [llama.cpp](https://github.com/ggerganov/llama.cpp). The source project for GGUF. Offers a CLI and a server option.
63
+ * [text-generation-webui](https://github.com/oobabooga/text-generation-webui), the most widely used web UI, with many features and powerful extensions. Supports GPU acceleration.
64
+ * [KoboldCpp](https://github.com/LostRuins/koboldcpp), a fully featured web UI, with GPU accel across all platforms and GPU architectures. Especially good for story telling.
65
+ * [GPT4All](https://gpt4all.io/index.html), a free and open source local running GUI, supporting Windows, Linux and macOS with full GPU accel.
66
+ * [LM Studio](https://lmstudio.ai/), an easy-to-use and powerful local GUI for Windows and macOS (Silicon), with GPU acceleration. Linux available, in beta as of 27/11/2023.
67
+ * [LoLLMS Web UI](https://github.com/ParisNeo/lollms-webui), a great web UI with many interesting and unique features, including a full model library for easy model selection.
68
+ * [Faraday.dev](https://faraday.dev/), an attractive and easy to use character-based chat GUI for Windows and macOS (both Silicon and Intel), with GPU acceleration.
69
+ * [llama-cpp-python](https://github.com/abetlen/llama-cpp-python), a Python library with GPU accel, LangChain support, and OpenAI-compatible API server.
70
+ * [candle](https://github.com/huggingface/candle), a Rust ML framework with a focus on performance, including GPU support, and ease of use.
71
+ * [ctransformers](https://github.com/marella/ctransformers), a Python library with GPU accel, LangChain support, and OpenAI-compatible AI server. Note, as of time of writing (November 27th 2023), ctransformers has not been updated in a long time and does not support many recent models.
72
+
73
+ ### Explanation of quantisation methods
74
+
75
+ <details>
76
+ <summary>Click to see details</summary>
77
+
78
+ The new methods available are:
79
+
80
+ * GGML_TYPE_Q2_K - "type-1" 2-bit quantization in super-blocks containing 16 blocks, each block having 16 weight. Block scales and mins are quantized with 4 bits. This ends up effectively using 2.5625 bits per weight (bpw)
81
+ * GGML_TYPE_Q3_K - "type-0" 3-bit quantization in super-blocks containing 16 blocks, each block having 16 weights. Scales are quantized with 6 bits. This end up using 3.4375 bpw.
82
+ * GGML_TYPE_Q4_K - "type-1" 4-bit quantization in super-blocks containing 8 blocks, each block having 32 weights. Scales and mins are quantized with 6 bits. This ends up using 4.5 bpw.
83
+ * GGML_TYPE_Q5_K - "type-1" 5-bit quantization. Same super-block structure as GGML_TYPE_Q4_K resulting in 5.5 bpw
84
+ * GGML_TYPE_Q6_K - "type-0" 6-bit quantization. Super-blocks with 16 blocks, each block having 16 weights. Scales are quantized with 8 bits. This ends up using 6.5625 bpw
85
+
86
+ ## How to download GGUF files
87
+
88
+ **Note for manual downloaders:** You almost never want to clone the entire repo! Multiple different quantisation formats are provided, and most users only want to pick and download a single file.
89
+
90
+ The following clients/libraries will automatically download models for you, providing a list of available models to choose from:
91
+
92
+ * LM Studio
93
+ * LoLLMS Web UI
94
+ * Faraday.dev
95
+
96
+ ### In `text-generation-webui`
97
+
98
+ Under Download Model, you can enter the model repo: [MaziyarPanahi/BioMistral-7B-SLERP-GGUF](https://huggingface.co/MaziyarPanahi/BioMistral-7B-SLERP-GGUF) and below it, a specific filename to download, such as: BioMistral-7B-SLERP-GGUF.Q4_K_M.gguf.
99
+
100
+ Then click Download.
101
+
102
+ ### On the command line, including multiple files at once
103
+
104
+ I recommend using the `huggingface-hub` Python library:
105
+
106
+ ```shell
107
+ pip3 install huggingface-hub
108
+ ```
109
+
110
+ Then you can download any individual model file to the current directory, at high speed, with a command like this:
111
+
112
+ ```shell
113
+ huggingface-cli download MaziyarPanahi/BioMistral-7B-SLERP-GGUF BioMistral-7B-SLERP-GGUF.Q4_K_M.gguf --local-dir . --local-dir-use-symlinks False
114
+ ```
115
+ </details>
116
+ <details>
117
+ <summary>More advanced huggingface-cli download usage (click to read)</summary>
118
+
119
+ You can also download multiple files at once with a pattern:
120
+
121
+ ```shell
122
+ huggingface-cli download [MaziyarPanahi/BioMistral-7B-SLERP-GGUF](https://huggingface.co/MaziyarPanahi/BioMistral-7B-SLERP-GGUF) --local-dir . --local-dir-use-symlinks False --include='*Q4_K*gguf'
123
+ ```
124
+
125
+ For more documentation on downloading with `huggingface-cli`, please see: [HF -> Hub Python Library -> Download files -> Download from the CLI](https://huggingface.co/docs/huggingface_hub/guides/download#download-from-the-cli).
126
+
127
+ To accelerate downloads on fast connections (1Gbit/s or higher), install `hf_transfer`:
128
+
129
+ ```shell
130
+ pip3 install hf_transfer
131
+ ```
132
+
133
+ And set environment variable `HF_HUB_ENABLE_HF_TRANSFER` to `1`:
134
+
135
+ ```shell
136
+ HF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download MaziyarPanahi/BioMistral-7B-SLERP-GGUF BioMistral-7B-SLERP-GGUF.Q4_K_M.gguf --local-dir . --local-dir-use-symlinks False
137
+ ```
138
+
139
+ Windows Command Line users: You can set the environment variable by running `set HF_HUB_ENABLE_HF_TRANSFER=1` before the download command.
140
+ </details>
141
+
142
+ ## Example `llama.cpp` command
143
+
144
+ Make sure you are using `llama.cpp` from commit [d0cee0d](https://github.com/ggerganov/llama.cpp/commit/d0cee0d36d5be95a0d9088b674dbb27354107221) or later.
145
+
146
+ ```shell
147
+ ./main -ngl 35 -m BioMistral-7B-SLERP-GGUF.Q4_K_M.gguf --color -c 32768 --temp 0.7 --repeat_penalty 1.1 -n -1 -p "<|im_start|>system
148
+ {system_message}<|im_end|>
149
+ <|im_start|>user
150
+ {prompt}<|im_end|>
151
+ <|im_start|>assistant"
152
+ ```
153
+
154
+ Change `-ngl 32` to the number of layers to offload to GPU. Remove it if you don't have GPU acceleration.
155
+
156
+ Change `-c 32768` to the desired sequence length. For extended sequence models - eg 8K, 16K, 32K - the necessary RoPE scaling parameters are read from the GGUF file and set by llama.cpp automatically. Note that longer sequence lengths require much more resources, so you may need to reduce this value.
157
+
158
+ If you want to have a chat-style conversation, replace the `-p <PROMPT>` argument with `-i -ins`
159
+
160
+ For other parameters and how to use them, please refer to [the llama.cpp documentation](https://github.com/ggerganov/llama.cpp/blob/master/examples/main/README.md)
161
+
162
+ ## How to run in `text-generation-webui`
163
+
164
+ Further instructions can be found in the text-generation-webui documentation, here: [text-generation-webui/docs/04 ‐ Model Tab.md](https://github.com/oobabooga/text-generation-webui/blob/main/docs/04%20%E2%80%90%20Model%20Tab.md#llamacpp).
165
+
166
+ ## How to run from Python code
167
+
168
+ You can use GGUF models from Python using the [llama-cpp-python](https://github.com/abetlen/llama-cpp-python) or [ctransformers](https://github.com/marella/ctransformers) libraries. Note that at the time of writing (Nov 27th 2023), ctransformers has not been updated for some time and is not compatible with some recent models. Therefore I recommend you use llama-cpp-python.
169
+
170
+ ### How to load this model in Python code, using llama-cpp-python
171
+
172
+ For full documentation, please see: [llama-cpp-python docs](https://abetlen.github.io/llama-cpp-python/).
173
+
174
+ #### First install the package
175
+
176
+ Run one of the following commands, according to your system:
177
+
178
+ ```shell
179
+ # Base ctransformers with no GPU acceleration
180
+ pip install llama-cpp-python
181
+ # With NVidia CUDA acceleration
182
+ CMAKE_ARGS="-DLLAMA_CUBLAS=on" pip install llama-cpp-python
183
+ # Or with OpenBLAS acceleration
184
+ CMAKE_ARGS="-DLLAMA_BLAS=ON -DLLAMA_BLAS_VENDOR=OpenBLAS" pip install llama-cpp-python
185
+ # Or with CLBLast acceleration
186
+ CMAKE_ARGS="-DLLAMA_CLBLAST=on" pip install llama-cpp-python
187
+ # Or with AMD ROCm GPU acceleration (Linux only)
188
+ CMAKE_ARGS="-DLLAMA_HIPBLAS=on" pip install llama-cpp-python
189
+ # Or with Metal GPU acceleration for macOS systems only
190
+ CMAKE_ARGS="-DLLAMA_METAL=on" pip install llama-cpp-python
191
+
192
+ # In windows, to set the variables CMAKE_ARGS in PowerShell, follow this format; eg for NVidia CUDA:
193
+ $env:CMAKE_ARGS = "-DLLAMA_OPENBLAS=on"
194
+ pip install llama-cpp-python
195
+ ```
196
+
197
+ #### Simple llama-cpp-python example code
198
+
199
+ ```python
200
+ from llama_cpp import Llama
201
+
202
+ # Set gpu_layers to the number of layers to offload to GPU. Set to 0 if no GPU acceleration is available on your system.
203
+ llm = Llama(
204
+ model_path="./BioMistral-7B-SLERP-GGUF.Q4_K_M.gguf", # Download the model file first
205
+ n_ctx=32768, # The max sequence length to use - note that longer sequence lengths require much more resources
206
+ n_threads=8, # The number of CPU threads to use, tailor to your system and the resulting performance
207
+ n_gpu_layers=35 # The number of layers to offload to GPU, if you have GPU acceleration available
208
+ )
209
+
210
+ # Simple inference example
211
+ output = llm(
212
+ "<|im_start|>system
213
+ {system_message}<|im_end|>
214
+ <|im_start|>user
215
+ {prompt}<|im_end|>
216
+ <|im_start|>assistant", # Prompt
217
+ max_tokens=512, # Generate up to 512 tokens
218
+ stop=["</s>"], # Example stop token - not necessarily correct for this specific model! Please check before using.
219
+ echo=True # Whether to echo the prompt
220
+ )
221
+
222
+ # Chat Completion API
223
+
224
+ llm = Llama(model_path="./BioMistral-7B-SLERP-GGUF.Q4_K_M.gguf", chat_format="llama-2") # Set chat_format according to the model you are using
225
+ llm.create_chat_completion(
226
+ messages = [
227
+ {"role": "system", "content": "You are a story writing assistant."},
228
+ {
229
+ "role": "user",
230
+ "content": "Write a story about llamas."
231
+ }
232
+ ]
233
+ )
234
+ ```
235
+
236
+ ## How to use with LangChain
237
+
238
+ Here are guides on using llama-cpp-python and ctransformers with LangChain:
239
+
240
+ * [LangChain + llama-cpp-python](https://python.langchain.com/docs/integrations/llms/llamacpp)
241
+ * [LangChain + ctransformers](https://python.langchain.com/docs/integrations/providers/ctransformers)