MaziyarPanahi commited on
Commit
04164f1
1 Parent(s): fe722ff

Upload folder using huggingface_hub (#1)

Browse files

- 94edf840f50f3977600b3d71df72106390471b38b7f149ccc3cd7afd089a7829 (127b294b74c554147a7c465ef4b891281b3de350)
- 7fa0d4f2628cb046e083b576a8b5ad998e43a4816eeac23272f19c68e1e85811 (d3b573ed18bc3c96f067d1396cb7662375b267d1)
- fa3910b2ab41919b34d6979feee07854ba7beb26abb099d8b131c11c00fc57db (3759bf9c967dfb15fbacb92a1078115e76bd0864)
- a64b2541622923114895bcd77dd4b0cb41a7b501582495815bfa7edc073ea6f7 (dc2588e7e801bf2ef61ef6beb9925286d6a768ad)
- f64434c7730337935a1e726ddc7831db16f850d0f979e9dc700602de4e1bd7a5 (f36022f07c142619cf5247e942dd1d7db3b12de5)
- f162b5c49b9960c3439b17a326a72e64df85fe35d7e16cb0abac0cb66b830cdd (b82fb842c7ec3a8e410c4e18942469ba97e45e28)
- d6d995704ba3dae491063029ec0bccf5971e0ab88ce02f17629bdd86ae458a65 (4013d4ddbe5ade130441aa143adeaaac86e18c96)
- a7181b07e33b58395cb036f7822d39a33f19ea8f79fe222a1e4e398483210bb7 (d76e1be128f8eb76c2c0abeddda66b9c3b78ce08)
- 7b03f073d6e62402f659ee87c6ca698e363bb0b7252575bb4a7445888a43fe4a (bc228e17a71e6f02d59804d7611221af904f2275)
- 16c163d5934deb9eaef07d620b7decd9a8f60bfc5dd38e95a5fdf41a34fab2f4 (7d7e177252c551c53e723db8f82a136b562ce1ec)
- 97ff0c7ce98224eae6dbaff44bb1b1b2d5b3344adb956ffbcee165a5ee9be974 (8b1aa70c838a3cba24acd7048f190d72c6125763)

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