MaziyarPanahi commited on
Commit
6a55f4d
1 Parent(s): 1fb3d8a

Upload folder using huggingface_hub

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