TheBloke commited on
Commit
04b9790
1 Parent(s): f8a44c5

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +399 -0
README.md ADDED
@@ -0,0 +1,399 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: llmware/dragon-yi-6b-v0
3
+ inference: false
4
+ license: other
5
+ license_link: https://huggingface.co/01-ai/Yi-6B/blob/main/LICENSE
6
+ license_name: yi-license
7
+ model_creator: llmware
8
+ model_name: Dragon Yi 6B v0
9
+ model_type: yi
10
+ prompt_template: '<human>: {prompt}
11
+
12
+ <bot>:
13
+
14
+ '
15
+ quantized_by: TheBloke
16
+ ---
17
+ <!-- markdownlint-disable MD041 -->
18
+
19
+ <!-- header start -->
20
+ <!-- 200823 -->
21
+ <div style="width: auto; margin-left: auto; margin-right: auto">
22
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
23
+ </div>
24
+ <div style="display: flex; justify-content: space-between; width: 100%;">
25
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
26
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
27
+ </div>
28
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
29
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://www.patreon.com/TheBlokeAI">Want to contribute? TheBloke's Patreon page</a></p>
30
+ </div>
31
+ </div>
32
+ <div style="text-align:center; margin-top: 0em; margin-bottom: 0em"><p style="margin-top: 0.25em; margin-bottom: 0em;">TheBloke's LLM work is generously supported by a grant from <a href="https://a16z.com">andreessen horowitz (a16z)</a></p></div>
33
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
34
+ <!-- header end -->
35
+
36
+ # Dragon Yi 6B v0 - GGUF
37
+ - Model creator: [llmware](https://huggingface.co/llmware)
38
+ - Original model: [Dragon Yi 6B v0](https://huggingface.co/llmware/dragon-yi-6b-v0)
39
+
40
+ <!-- description start -->
41
+ ## Description
42
+
43
+ This repo contains GGUF format model files for [llmware's Dragon Yi 6B v0](https://huggingface.co/llmware/dragon-yi-6b-v0).
44
+
45
+ These files were quantised using hardware kindly provided by [Massed Compute](https://massedcompute.com/).
46
+
47
+ <!-- description end -->
48
+ <!-- README_GGUF.md-about-gguf start -->
49
+ ### About GGUF
50
+
51
+ 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.
52
+
53
+ Here is an incomplete list of clients and libraries that are known to support GGUF:
54
+
55
+ * [llama.cpp](https://github.com/ggerganov/llama.cpp). The source project for GGUF. Offers a CLI and a server option.
56
+ * [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.
57
+ * [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.
58
+ * [LM Studio](https://lmstudio.ai/), an easy-to-use and powerful local GUI for Windows and macOS (Silicon), with GPU acceleration.
59
+ * [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.
60
+ * [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.
61
+ * [ctransformers](https://github.com/marella/ctransformers), a Python library with GPU accel, LangChain support, and OpenAI-compatible AI server.
62
+ * [llama-cpp-python](https://github.com/abetlen/llama-cpp-python), a Python library with GPU accel, LangChain support, and OpenAI-compatible API server.
63
+ * [candle](https://github.com/huggingface/candle), a Rust ML framework with a focus on performance, including GPU support, and ease of use.
64
+
65
+ <!-- README_GGUF.md-about-gguf end -->
66
+ <!-- repositories-available start -->
67
+ ## Repositories available
68
+
69
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/dragon-yi-6B-v0-AWQ)
70
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/dragon-yi-6B-v0-GPTQ)
71
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/dragon-yi-6B-v0-GGUF)
72
+ * [llmware's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/llmware/dragon-yi-6b-v0)
73
+ <!-- repositories-available end -->
74
+
75
+ <!-- prompt-template start -->
76
+ ## Prompt template: human-bot
77
+
78
+ ```
79
+ <human>: {prompt}
80
+ <bot>:
81
+
82
+ ```
83
+
84
+ <!-- prompt-template end -->
85
+
86
+
87
+ <!-- compatibility_gguf start -->
88
+ ## Compatibility
89
+
90
+ These quantised GGUFv2 files are compatible with llama.cpp from August 27th onwards, as of commit [d0cee0d](https://github.com/ggerganov/llama.cpp/commit/d0cee0d36d5be95a0d9088b674dbb27354107221)
91
+
92
+ They are also compatible with many third party UIs and libraries - please see the list at the top of this README.
93
+
94
+ ## Explanation of quantisation methods
95
+
96
+ <details>
97
+ <summary>Click to see details</summary>
98
+
99
+ The new methods available are:
100
+
101
+ * 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)
102
+ * 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.
103
+ * 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.
104
+ * GGML_TYPE_Q5_K - "type-1" 5-bit quantization. Same super-block structure as GGML_TYPE_Q4_K resulting in 5.5 bpw
105
+ * 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
106
+
107
+ Refer to the Provided Files table below to see what files use which methods, and how.
108
+ </details>
109
+ <!-- compatibility_gguf end -->
110
+
111
+ <!-- README_GGUF.md-provided-files start -->
112
+ ## Provided files
113
+
114
+ | Name | Quant method | Bits | Size | Max RAM required | Use case |
115
+ | ---- | ---- | ---- | ---- | ---- | ----- |
116
+ | [dragon-yi-6b-v0.Q2_K.gguf](https://huggingface.co/TheBloke/dragon-yi-6B-v0-GGUF/blob/main/dragon-yi-6b-v0.Q2_K.gguf) | Q2_K | 2 | 2.62 GB| 5.12 GB | smallest, significant quality loss - not recommended for most purposes |
117
+ | [dragon-yi-6b-v0.Q3_K_S.gguf](https://huggingface.co/TheBloke/dragon-yi-6B-v0-GGUF/blob/main/dragon-yi-6b-v0.Q3_K_S.gguf) | Q3_K_S | 3 | 2.71 GB| 5.21 GB | very small, high quality loss |
118
+ | [dragon-yi-6b-v0.Q3_K_M.gguf](https://huggingface.co/TheBloke/dragon-yi-6B-v0-GGUF/blob/main/dragon-yi-6b-v0.Q3_K_M.gguf) | Q3_K_M | 3 | 2.99 GB| 5.49 GB | very small, high quality loss |
119
+ | [dragon-yi-6b-v0.Q3_K_L.gguf](https://huggingface.co/TheBloke/dragon-yi-6B-v0-GGUF/blob/main/dragon-yi-6b-v0.Q3_K_L.gguf) | Q3_K_L | 3 | 3.24 GB| 5.74 GB | small, substantial quality loss |
120
+ | [dragon-yi-6b-v0.Q4_0.gguf](https://huggingface.co/TheBloke/dragon-yi-6B-v0-GGUF/blob/main/dragon-yi-6b-v0.Q4_0.gguf) | Q4_0 | 4 | 3.48 GB| 5.98 GB | legacy; small, very high quality loss - prefer using Q3_K_M |
121
+ | [dragon-yi-6b-v0.Q4_K_S.gguf](https://huggingface.co/TheBloke/dragon-yi-6B-v0-GGUF/blob/main/dragon-yi-6b-v0.Q4_K_S.gguf) | Q4_K_S | 4 | 3.50 GB| 6.00 GB | small, greater quality loss |
122
+ | [dragon-yi-6b-v0.Q4_K_M.gguf](https://huggingface.co/TheBloke/dragon-yi-6B-v0-GGUF/blob/main/dragon-yi-6b-v0.Q4_K_M.gguf) | Q4_K_M | 4 | 3.67 GB| 6.17 GB | medium, balanced quality - recommended |
123
+ | [dragon-yi-6b-v0.Q5_0.gguf](https://huggingface.co/TheBloke/dragon-yi-6B-v0-GGUF/blob/main/dragon-yi-6b-v0.Q5_0.gguf) | Q5_0 | 5 | 4.20 GB| 6.70 GB | legacy; medium, balanced quality - prefer using Q4_K_M |
124
+ | [dragon-yi-6b-v0.Q5_K_S.gguf](https://huggingface.co/TheBloke/dragon-yi-6B-v0-GGUF/blob/main/dragon-yi-6b-v0.Q5_K_S.gguf) | Q5_K_S | 5 | 4.20 GB| 6.70 GB | large, low quality loss - recommended |
125
+ | [dragon-yi-6b-v0.Q5_K_M.gguf](https://huggingface.co/TheBloke/dragon-yi-6B-v0-GGUF/blob/main/dragon-yi-6b-v0.Q5_K_M.gguf) | Q5_K_M | 5 | 4.30 GB| 6.80 GB | large, very low quality loss - recommended |
126
+ | [dragon-yi-6b-v0.Q6_K.gguf](https://huggingface.co/TheBloke/dragon-yi-6B-v0-GGUF/blob/main/dragon-yi-6b-v0.Q6_K.gguf) | Q6_K | 6 | 4.97 GB| 7.47 GB | very large, extremely low quality loss |
127
+ | [dragon-yi-6b-v0.Q8_0.gguf](https://huggingface.co/TheBloke/dragon-yi-6B-v0-GGUF/blob/main/dragon-yi-6b-v0.Q8_0.gguf) | Q8_0 | 8 | 6.44 GB| 8.94 GB | very large, extremely low quality loss - not recommended |
128
+
129
+ **Note**: the above RAM figures assume no GPU offloading. If layers are offloaded to the GPU, this will reduce RAM usage and use VRAM instead.
130
+
131
+
132
+
133
+ <!-- README_GGUF.md-provided-files end -->
134
+
135
+ <!-- README_GGUF.md-how-to-download start -->
136
+ ## How to download GGUF files
137
+
138
+ **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.
139
+
140
+ The following clients/libraries will automatically download models for you, providing a list of available models to choose from:
141
+
142
+ * LM Studio
143
+ * LoLLMS Web UI
144
+ * Faraday.dev
145
+
146
+ ### In `text-generation-webui`
147
+
148
+ Under Download Model, you can enter the model repo: TheBloke/dragon-yi-6B-v0-GGUF and below it, a specific filename to download, such as: dragon-yi-6b-v0.Q4_K_M.gguf.
149
+
150
+ Then click Download.
151
+
152
+ ### On the command line, including multiple files at once
153
+
154
+ I recommend using the `huggingface-hub` Python library:
155
+
156
+ ```shell
157
+ pip3 install huggingface-hub
158
+ ```
159
+
160
+ Then you can download any individual model file to the current directory, at high speed, with a command like this:
161
+
162
+ ```shell
163
+ huggingface-cli download TheBloke/dragon-yi-6B-v0-GGUF dragon-yi-6b-v0.Q4_K_M.gguf --local-dir . --local-dir-use-symlinks False
164
+ ```
165
+
166
+ <details>
167
+ <summary>More advanced huggingface-cli download usage</summary>
168
+
169
+ You can also download multiple files at once with a pattern:
170
+
171
+ ```shell
172
+ huggingface-cli download TheBloke/dragon-yi-6B-v0-GGUF --local-dir . --local-dir-use-symlinks False --include='*Q4_K*gguf'
173
+ ```
174
+
175
+ 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).
176
+
177
+ To accelerate downloads on fast connections (1Gbit/s or higher), install `hf_transfer`:
178
+
179
+ ```shell
180
+ pip3 install hf_transfer
181
+ ```
182
+
183
+ And set environment variable `HF_HUB_ENABLE_HF_TRANSFER` to `1`:
184
+
185
+ ```shell
186
+ HF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download TheBloke/dragon-yi-6B-v0-GGUF dragon-yi-6b-v0.Q4_K_M.gguf --local-dir . --local-dir-use-symlinks False
187
+ ```
188
+
189
+ Windows Command Line users: You can set the environment variable by running `set HF_HUB_ENABLE_HF_TRANSFER=1` before the download command.
190
+ </details>
191
+ <!-- README_GGUF.md-how-to-download end -->
192
+
193
+ <!-- README_GGUF.md-how-to-run start -->
194
+ ## Example `llama.cpp` command
195
+
196
+ Make sure you are using `llama.cpp` from commit [d0cee0d](https://github.com/ggerganov/llama.cpp/commit/d0cee0d36d5be95a0d9088b674dbb27354107221) or later.
197
+
198
+ ```shell
199
+ ./main -ngl 32 -m dragon-yi-6b-v0.Q4_K_M.gguf --color -c 2048 --temp 0.7 --repeat_penalty 1.1 -n -1 -p "<human>: {prompt}\n<bot>:"
200
+ ```
201
+
202
+ Change `-ngl 32` to the number of layers to offload to GPU. Remove it if you don't have GPU acceleration.
203
+
204
+ Change `-c 2048` 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.
205
+
206
+ If you want to have a chat-style conversation, replace the `-p <PROMPT>` argument with `-i -ins`
207
+
208
+ 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)
209
+
210
+ ## How to run in `text-generation-webui`
211
+
212
+ 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).
213
+
214
+ ## How to run from Python code
215
+
216
+ 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.
217
+
218
+ ### How to load this model in Python code, using ctransformers
219
+
220
+ #### First install the package
221
+
222
+ Run one of the following commands, according to your system:
223
+
224
+ ```shell
225
+ # Base ctransformers with no GPU acceleration
226
+ pip install ctransformers
227
+ # Or with CUDA GPU acceleration
228
+ pip install ctransformers[cuda]
229
+ # Or with AMD ROCm GPU acceleration (Linux only)
230
+ CT_HIPBLAS=1 pip install ctransformers --no-binary ctransformers
231
+ # Or with Metal GPU acceleration for macOS systems only
232
+ CT_METAL=1 pip install ctransformers --no-binary ctransformers
233
+ ```
234
+
235
+ #### Simple ctransformers example code
236
+
237
+ ```python
238
+ from ctransformers import AutoModelForCausalLM
239
+
240
+ # Set gpu_layers to the number of layers to offload to GPU. Set to 0 if no GPU acceleration is available on your system.
241
+ llm = AutoModelForCausalLM.from_pretrained("TheBloke/dragon-yi-6B-v0-GGUF", model_file="dragon-yi-6b-v0.Q4_K_M.gguf", model_type="yi", gpu_layers=50)
242
+
243
+ print(llm("AI is going to"))
244
+ ```
245
+
246
+ ## How to use with LangChain
247
+
248
+ Here are guides on using llama-cpp-python and ctransformers with LangChain:
249
+
250
+ * [LangChain + llama-cpp-python](https://python.langchain.com/docs/integrations/llms/llamacpp)
251
+ * [LangChain + ctransformers](https://python.langchain.com/docs/integrations/providers/ctransformers)
252
+
253
+ <!-- README_GGUF.md-how-to-run end -->
254
+
255
+ <!-- footer start -->
256
+ <!-- 200823 -->
257
+ ## Discord
258
+
259
+ For further support, and discussions on these models and AI in general, join us at:
260
+
261
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
262
+
263
+ ## Thanks, and how to contribute
264
+
265
+ Thanks to the [chirper.ai](https://chirper.ai) team!
266
+
267
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
268
+
269
+ I've had a lot of people ask if they can contribute. I enjoy providing models and helping people, and would love to be able to spend even more time doing it, as well as expanding into new projects like fine tuning/training.
270
+
271
+ If you're able and willing to contribute it will be most gratefully received and will help me to keep providing more models, and to start work on new AI projects.
272
+
273
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
274
+
275
+ * Patreon: https://patreon.com/TheBlokeAI
276
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
277
+
278
+ **Special thanks to**: Aemon Algiz.
279
+
280
+ **Patreon special mentions**: Brandon Frisco, LangChain4j, Spiking Neurons AB, transmissions 11, Joseph William Delisle, Nitin Borwankar, Willem Michiel, Michael Dempsey, vamX, Jeffrey Morgan, zynix, jjj, Omer Bin Jawed, Sean Connelly, jinyuan sun, Jeromy Smith, Shadi, Pawan Osman, Chadd, Elijah Stavena, Illia Dulskyi, Sebastain Graf, Stephen Murray, terasurfer, Edmond Seymore, Celu Ramasamy, Mandus, Alex, biorpg, Ajan Kanaga, Clay Pascal, Raven Klaugh, 阿明, K, ya boyyy, usrbinkat, Alicia Loh, John Villwock, ReadyPlayerEmma, Chris Smitley, Cap'n Zoog, fincy, GodLy, S_X, sidney chen, Cory Kujawski, OG, Mano Prime, AzureBlack, Pieter, Kalila, Spencer Kim, Tom X Nguyen, Stanislav Ovsiannikov, Michael Levine, Andrey, Trailburnt, Vadim, Enrico Ros, Talal Aujan, Brandon Phillips, Jack West, Eugene Pentland, Michael Davis, Will Dee, webtim, Jonathan Leane, Alps Aficionado, Rooh Singh, Tiffany J. Kim, theTransient, Luke @flexchar, Elle, Caitlyn Gatomon, Ari Malik, subjectnull, Johann-Peter Hartmann, Trenton Dambrowitz, Imad Khwaja, Asp the Wyvern, Emad Mostaque, Rainer Wilmers, Alexandros Triantafyllidis, Nicholas, Pedro Madruga, SuperWojo, Harry Royden McLaughlin, James Bentley, Olakabola, David Ziegler, Ai Maven, Jeff Scroggin, Nikolai Manek, Deo Leter, Matthew Berman, Fen Risland, Ken Nordquist, Manuel Alberto Morcote, Luke Pendergrass, TL, Fred von Graf, Randy H, Dan Guido, NimbleBox.ai, Vitor Caleffi, Gabriel Tamborski, knownsqashed, Lone Striker, Erik Bjäreholt, John Detwiler, Leonard Tan, Iucharbius
281
+
282
+
283
+ Thank you to all my generous patrons and donaters!
284
+
285
+ And thank you again to a16z for their generous grant.
286
+
287
+ <!-- footer end -->
288
+
289
+ <!-- original-model-card start -->
290
+ # Original model card: llmware's Dragon Yi 6B v0
291
+
292
+
293
+ # Model Card for Model ID
294
+
295
+ <!-- Provide a quick summary of what the model is/does. -->
296
+
297
+ dragon-yi-6b-v0 part of the dRAGon ("Delivering RAG On ...") model series, RAG-instruct trained on top of a Yi-6B base model.
298
+
299
+ DRAGON models have been fine-tuned with the specific objective of fact-based question-answering over complex business and legal documents with an emphasis on reducing hallucinations and providing short, clear answers for workflow automation.
300
+
301
+
302
+ ### Benchmark Tests
303
+
304
+ Evaluated against the benchmark test: [RAG-Instruct-Benchmark-Tester](https://www.huggingface.co/datasets/llmware/rag_instruct_benchmark_tester)
305
+ Average of 2 Test Runs with 1 point for correct answer, 0.5 point for partial correct or blank / NF, 0.0 points for incorrect, and -1 points for hallucinations.
306
+
307
+ --**Accuracy Score**: **99.5** correct out of 100
308
+ --Not Found Classification: 90.0%
309
+ --Boolean: 87.5%
310
+ --Math/Logic: 77.5%
311
+ --Complex Questions (1-5): 4 (Above Average)
312
+ --Summarization Quality (1-5): 4 (Above Average)
313
+ --Hallucinations: No hallucinations observed in test runs.
314
+
315
+ For test run results (and good indicator of target use cases), please see the files ("core_rag_test" and "answer_sheet" in this repo).
316
+
317
+ ### Model Description
318
+
319
+ <!-- Provide a longer summary of what this model is. -->
320
+
321
+ - **Developed by:** llmware
322
+ - **Model type:** Yi
323
+ - **Language(s) (NLP):** English
324
+ - **License:** Yi License [Link](https://huggingface.co/01-ai/Yi-6B/blob/main/LICENSE)
325
+ - **Finetuned from model:** Yi-6B
326
+
327
+
328
+ ### Direct Use
329
+
330
+ <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
331
+
332
+ DRAGON is designed for enterprise automation use cases, especially in knowledge-intensive industries, such as financial services,
333
+ legal and regulatory industries with complex information sources.
334
+
335
+ DRAGON models have been trained for common RAG scenarios, specifically: question-answering, key-value extraction, and basic summarization as the core instruction types
336
+ without the need for a lot of complex instruction verbiage - provide a text passage context, ask questions, and get clear fact-based responses.
337
+
338
+ This model is licensed according to the terms of the license of the base model, Yi-6B, at this [link](https://huggingface.co/01-ai/Yi-6B/blob/main/LICENSE).
339
+
340
+
341
+ ## Bias, Risks, and Limitations
342
+
343
+ <!-- This section is meant to convey both technical and sociotechnical limitations. -->
344
+
345
+ Any model can provide inaccurate or incomplete information, and should be used in conjunction with appropriate safeguards and fact-checking mechanisms.
346
+
347
+
348
+ ## How to Get Started with the Model
349
+
350
+ The fastest way to get started with BLING is through direct import in transformers:
351
+
352
+ from transformers import AutoTokenizer, AutoModelForCausalLM
353
+ tokenizer = AutoTokenizer.from_pretrained("dragon-yi-6b-v0")
354
+ model = AutoModelForCausalLM.from_pretrained("dragon-yi-6b-v0")
355
+
356
+ Please refer to the generation_test .py files in the Files repository, which includes 200 samples and script to test the model. The **generation_test_llmware_script.py** includes built-in llmware capabilities for fact-checking, as well as easy integration with document parsing and actual retrieval to swap out the test set for RAG workflow consisting of business documents.
357
+
358
+ The DRAGON model was fine-tuned with a simple "\<human> and \<bot> wrapper", so to get the best results, wrap inference entries as:
359
+
360
+ full_prompt = "<human>: " + my_prompt + "\n" + "<bot>:"
361
+
362
+ The BLING model was fine-tuned with closed-context samples, which assume generally that the prompt consists of two sub-parts:
363
+
364
+ 1. Text Passage Context, and
365
+ 2. Specific question or instruction based on the text passage
366
+
367
+ To get the best results, package "my_prompt" as follows:
368
+
369
+ my_prompt = {{text_passage}} + "\n" + {{question/instruction}}
370
+
371
+
372
+ If you are using a HuggingFace generation script:
373
+
374
+ # prepare prompt packaging used in fine-tuning process
375
+ new_prompt = "<human>: " + entries["context"] + "\n" + entries["query"] + "\n" + "<bot>:"
376
+
377
+ inputs = tokenizer(new_prompt, return_tensors="pt")
378
+ start_of_output = len(inputs.input_ids[0])
379
+
380
+ # temperature: set at 0.3 for consistency of output
381
+ # max_new_tokens: set at 100 - may prematurely stop a few of the summaries
382
+
383
+ outputs = model.generate(
384
+ inputs.input_ids.to(device),
385
+ eos_token_id=tokenizer.eos_token_id,
386
+ pad_token_id=tokenizer.eos_token_id,
387
+ do_sample=True,
388
+ temperature=0.3,
389
+ max_new_tokens=100,
390
+ )
391
+
392
+ output_only = tokenizer.decode(outputs[0][start_of_output:],skip_special_tokens=True)
393
+
394
+
395
+ ## Model Card Contact
396
+
397
+ Darren Oberst & llmware team
398
+
399
+ <!-- original-model-card end -->