MaziyarPanahi commited on
Commit
f8f149f
1 Parent(s): 1bef9bf

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.Q2_K.gguf filter=lfs diff=lfs merge=lfs -text
37
+ BioMistral-7B.Q3_K_L.gguf filter=lfs diff=lfs merge=lfs -text
38
+ BioMistral-7B.Q3_K_M.gguf filter=lfs diff=lfs merge=lfs -text
39
+ BioMistral-7B.Q3_K_S.gguf filter=lfs diff=lfs merge=lfs -text
40
+ BioMistral-7B.Q4_K_M.gguf filter=lfs diff=lfs merge=lfs -text
41
+ BioMistral-7B.Q4_K_S.gguf filter=lfs diff=lfs merge=lfs -text
42
+ BioMistral-7B.Q5_K_M.gguf filter=lfs diff=lfs merge=lfs -text
43
+ BioMistral-7B.Q5_K_S.gguf filter=lfs diff=lfs merge=lfs -text
44
+ BioMistral-7B.Q6_K.gguf filter=lfs diff=lfs merge=lfs -text
45
+ BioMistral-7B.Q8_0.gguf filter=lfs diff=lfs merge=lfs -text
BioMistral-7B.Q2_K.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c8bc5dc20f1442c47b4a640a65f5f947c1ad68c619ddf1f0a92a32f5c43eaf9b
3
+ size 2719242368
BioMistral-7B.Q3_K_L.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4b7aec1a72c2b6e5aff8b7db581c31b1a8b1af8452e9e61040d2ce1c4d8b1b0c
3
+ size 3822024832
BioMistral-7B.Q3_K_M.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:22e92e7dc6dd90b2c3f08d3ea827227ae8982046e246abd3d3b07b5008708e82
3
+ size 3518986368
BioMistral-7B.Q3_K_S.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9ac7526f17d9a9978e72d109fbb9175ff2698922bca19f37414837d2a55c09b4
3
+ size 3164567680
BioMistral-7B.Q4_K_M.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3a73107045dfe7e3f113b392b0a67e3e6ca9fa9dae2abe301424ce5abd1721a6
3
+ size 4368439424
BioMistral-7B.Q4_K_S.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c74018c411d9d6b3dff26572e90cd856fd029c59c8cabe9e2302156bff2a2335
3
+ size 4140374144
BioMistral-7B.Q5_K_M.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:06a08ba27eb65da67b0c039bd6c1b4a4f5f2a7492709696cc65286b39a226732
3
+ size 5131409536
BioMistral-7B.Q5_K_S.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:698f37a0ee6c84b1571381c57f3b676bf51ccee24564fcb8fe4011f1ae5c6503
3
+ size 4997716096
BioMistral-7B.Q6_K.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5efba7d67501c113f9d7df9fc44f31abe047fe1fe9c6380b7b367ae0065f0c2f
3
+ size 5942065280
BioMistral-7B.Q8_0.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5f7522dd82dcd9ffc95ba440303a2a4fcc13e86a9b81c73fbdb64daf42680bc6
3
+ size 7695857792
README.md ADDED
@@ -0,0 +1,238 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ - pytorch
13
+ - tensorboard
14
+ - mistral
15
+ - text-generation
16
+ - medical
17
+ - biology
18
+ - conversational
19
+ - fr
20
+ - en
21
+ - de
22
+ - nl
23
+ - es
24
+ - pt
25
+ - pl
26
+ - ro
27
+ - it
28
+ - dataset:pubmed
29
+ - arxiv:2402.10373
30
+ - license:apache-2.0
31
+ - autotrain_compatible
32
+ - endpoints_compatible
33
+ - text-generation-inference
34
+ - region:us
35
+ - text-generation
36
+ model_name: BioMistral-7B-GGUF
37
+ base_model: BioMistral/BioMistral-7B
38
+ inference: false
39
+ model_creator: BioMistral
40
+ pipeline_tag: text-generation
41
+ quantized_by: MaziyarPanahi
42
+ ---
43
+ # [MaziyarPanahi/BioMistral-7B-GGUF](https://huggingface.co/MaziyarPanahi/BioMistral-7B-GGUF)
44
+ - Model creator: [BioMistral](https://huggingface.co/BioMistral)
45
+ - Original model: [BioMistral/BioMistral-7B](https://huggingface.co/BioMistral/BioMistral-7B)
46
+
47
+ ## Description
48
+ [MaziyarPanahi/BioMistral-7B-GGUF](https://huggingface.co/MaziyarPanahi/BioMistral-7B-GGUF) contains GGUF format model files for [BioMistral/BioMistral-7B](https://huggingface.co/BioMistral/BioMistral-7B).
49
+
50
+ ## How to use
51
+ Thanks to [TheBloke](https://huggingface.co/TheBloke) for preparing an amazing README on how to use GGUF models:
52
+
53
+ ### About GGUF
54
+
55
+ 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.
56
+
57
+ Here is an incomplete list of clients and libraries that are known to support GGUF:
58
+
59
+ * [llama.cpp](https://github.com/ggerganov/llama.cpp). The source project for GGUF. Offers a CLI and a server option.
60
+ * [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.
61
+ * [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.
62
+ * [GPT4All](https://gpt4all.io/index.html), a free and open source local running GUI, supporting Windows, Linux and macOS with full GPU accel.
63
+ * [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.
64
+ * [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.
65
+ * [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.
66
+ * [llama-cpp-python](https://github.com/abetlen/llama-cpp-python), a Python library with GPU accel, LangChain support, and OpenAI-compatible API server.
67
+ * [candle](https://github.com/huggingface/candle), a Rust ML framework with a focus on performance, including GPU support, and ease of use.
68
+ * [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.
69
+
70
+ ### Explanation of quantisation methods
71
+
72
+ <details>
73
+ <summary>Click to see details</summary>
74
+
75
+ The new methods available are:
76
+
77
+ * 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)
78
+ * 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.
79
+ * 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.
80
+ * GGML_TYPE_Q5_K - "type-1" 5-bit quantization. Same super-block structure as GGML_TYPE_Q4_K resulting in 5.5 bpw
81
+ * 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
82
+
83
+ ## How to download GGUF files
84
+
85
+ **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.
86
+
87
+ The following clients/libraries will automatically download models for you, providing a list of available models to choose from:
88
+
89
+ * LM Studio
90
+ * LoLLMS Web UI
91
+ * Faraday.dev
92
+
93
+ ### In `text-generation-webui`
94
+
95
+ Under Download Model, you can enter the model repo: [MaziyarPanahi/BioMistral-7B-GGUF](https://huggingface.co/MaziyarPanahi/BioMistral-7B-GGUF) and below it, a specific filename to download, such as: BioMistral-7B-GGUF.Q4_K_M.gguf.
96
+
97
+ Then click Download.
98
+
99
+ ### On the command line, including multiple files at once
100
+
101
+ I recommend using the `huggingface-hub` Python library:
102
+
103
+ ```shell
104
+ pip3 install huggingface-hub
105
+ ```
106
+
107
+ Then you can download any individual model file to the current directory, at high speed, with a command like this:
108
+
109
+ ```shell
110
+ huggingface-cli download MaziyarPanahi/BioMistral-7B-GGUF BioMistral-7B-GGUF.Q4_K_M.gguf --local-dir . --local-dir-use-symlinks False
111
+ ```
112
+ </details>
113
+ <details>
114
+ <summary>More advanced huggingface-cli download usage (click to read)</summary>
115
+
116
+ You can also download multiple files at once with a pattern:
117
+
118
+ ```shell
119
+ huggingface-cli download [MaziyarPanahi/BioMistral-7B-GGUF](https://huggingface.co/MaziyarPanahi/BioMistral-7B-GGUF) --local-dir . --local-dir-use-symlinks False --include='*Q4_K*gguf'
120
+ ```
121
+
122
+ 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).
123
+
124
+ To accelerate downloads on fast connections (1Gbit/s or higher), install `hf_transfer`:
125
+
126
+ ```shell
127
+ pip3 install hf_transfer
128
+ ```
129
+
130
+ And set environment variable `HF_HUB_ENABLE_HF_TRANSFER` to `1`:
131
+
132
+ ```shell
133
+ HF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download MaziyarPanahi/BioMistral-7B-GGUF BioMistral-7B-GGUF.Q4_K_M.gguf --local-dir . --local-dir-use-symlinks False
134
+ ```
135
+
136
+ Windows Command Line users: You can set the environment variable by running `set HF_HUB_ENABLE_HF_TRANSFER=1` before the download command.
137
+ </details>
138
+
139
+ ## Example `llama.cpp` command
140
+
141
+ Make sure you are using `llama.cpp` from commit [d0cee0d](https://github.com/ggerganov/llama.cpp/commit/d0cee0d36d5be95a0d9088b674dbb27354107221) or later.
142
+
143
+ ```shell
144
+ ./main -ngl 35 -m BioMistral-7B-GGUF.Q4_K_M.gguf --color -c 32768 --temp 0.7 --repeat_penalty 1.1 -n -1 -p "<|im_start|>system
145
+ {system_message}<|im_end|>
146
+ <|im_start|>user
147
+ {prompt}<|im_end|>
148
+ <|im_start|>assistant"
149
+ ```
150
+
151
+ Change `-ngl 32` to the number of layers to offload to GPU. Remove it if you don't have GPU acceleration.
152
+
153
+ 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.
154
+
155
+ If you want to have a chat-style conversation, replace the `-p <PROMPT>` argument with `-i -ins`
156
+
157
+ 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)
158
+
159
+ ## How to run in `text-generation-webui`
160
+
161
+ 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).
162
+
163
+ ## How to run from Python code
164
+
165
+ 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.
166
+
167
+ ### How to load this model in Python code, using llama-cpp-python
168
+
169
+ For full documentation, please see: [llama-cpp-python docs](https://abetlen.github.io/llama-cpp-python/).
170
+
171
+ #### First install the package
172
+
173
+ Run one of the following commands, according to your system:
174
+
175
+ ```shell
176
+ # Base ctransformers with no GPU acceleration
177
+ pip install llama-cpp-python
178
+ # With NVidia CUDA acceleration
179
+ CMAKE_ARGS="-DLLAMA_CUBLAS=on" pip install llama-cpp-python
180
+ # Or with OpenBLAS acceleration
181
+ CMAKE_ARGS="-DLLAMA_BLAS=ON -DLLAMA_BLAS_VENDOR=OpenBLAS" pip install llama-cpp-python
182
+ # Or with CLBLast acceleration
183
+ CMAKE_ARGS="-DLLAMA_CLBLAST=on" pip install llama-cpp-python
184
+ # Or with AMD ROCm GPU acceleration (Linux only)
185
+ CMAKE_ARGS="-DLLAMA_HIPBLAS=on" pip install llama-cpp-python
186
+ # Or with Metal GPU acceleration for macOS systems only
187
+ CMAKE_ARGS="-DLLAMA_METAL=on" pip install llama-cpp-python
188
+
189
+ # In windows, to set the variables CMAKE_ARGS in PowerShell, follow this format; eg for NVidia CUDA:
190
+ $env:CMAKE_ARGS = "-DLLAMA_OPENBLAS=on"
191
+ pip install llama-cpp-python
192
+ ```
193
+
194
+ #### Simple llama-cpp-python example code
195
+
196
+ ```python
197
+ from llama_cpp import Llama
198
+
199
+ # Set gpu_layers to the number of layers to offload to GPU. Set to 0 if no GPU acceleration is available on your system.
200
+ llm = Llama(
201
+ model_path="./BioMistral-7B-GGUF.Q4_K_M.gguf", # Download the model file first
202
+ n_ctx=32768, # The max sequence length to use - note that longer sequence lengths require much more resources
203
+ n_threads=8, # The number of CPU threads to use, tailor to your system and the resulting performance
204
+ n_gpu_layers=35 # The number of layers to offload to GPU, if you have GPU acceleration available
205
+ )
206
+
207
+ # Simple inference example
208
+ output = llm(
209
+ "<|im_start|>system
210
+ {system_message}<|im_end|>
211
+ <|im_start|>user
212
+ {prompt}<|im_end|>
213
+ <|im_start|>assistant", # Prompt
214
+ max_tokens=512, # Generate up to 512 tokens
215
+ stop=["</s>"], # Example stop token - not necessarily correct for this specific model! Please check before using.
216
+ echo=True # Whether to echo the prompt
217
+ )
218
+
219
+ # Chat Completion API
220
+
221
+ llm = Llama(model_path="./BioMistral-7B-GGUF.Q4_K_M.gguf", chat_format="llama-2") # Set chat_format according to the model you are using
222
+ llm.create_chat_completion(
223
+ messages = [
224
+ {"role": "system", "content": "You are a story writing assistant."},
225
+ {
226
+ "role": "user",
227
+ "content": "Write a story about llamas."
228
+ }
229
+ ]
230
+ )
231
+ ```
232
+
233
+ ## How to use with LangChain
234
+
235
+ Here are guides on using llama-cpp-python and ctransformers with LangChain:
236
+
237
+ * [LangChain + llama-cpp-python](https://python.langchain.com/docs/integrations/llms/llamacpp)
238
+ * [LangChain + ctransformers](https://python.langchain.com/docs/integrations/providers/ctransformers)