andrijdavid
commited on
Commit
•
8924180
1
Parent(s):
0529ad5
Upload folder using huggingface_hub
Browse files- .gitattributes +14 -0
- Q2_K/Q2_K-00001-of-00001.gguf +3 -0
- Q3_K_L/Q3_K_L-00001-of-00001.gguf +3 -0
- Q3_K_M/Q3_K_M-00001-of-00001.gguf +3 -0
- Q3_K_S/Q3_K_S-00001-of-00001.gguf +3 -0
- Q4_0/Q4_0-00001-of-00001.gguf +3 -0
- Q4_1/Q4_1-00001-of-00001.gguf +3 -0
- Q4_K_M/Q4_K_M-00001-of-00001.gguf +3 -0
- Q4_K_S/Q4_K_S-00001-of-00001.gguf +3 -0
- Q5_0/Q5_0-00001-of-00001.gguf +3 -0
- Q5_1/Q5_1-00001-of-00001.gguf +3 -0
- Q5_K_M/Q5_K_M-00001-of-00001.gguf +3 -0
- Q5_K_S/Q5_K_S-00001-of-00001.gguf +3 -0
- Q6_K/Q6_K-00001-of-00001.gguf +3 -0
- Q8_0/Q8_0-00001-of-00001.gguf +3 -0
- README.md +411 -0
.gitattributes
CHANGED
@@ -33,3 +33,17 @@ 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 |
+
Q2_K/Q2_K-00001-of-00001.gguf filter=lfs diff=lfs merge=lfs -text
|
37 |
+
Q3_K_L/Q3_K_L-00001-of-00001.gguf filter=lfs diff=lfs merge=lfs -text
|
38 |
+
Q3_K_M/Q3_K_M-00001-of-00001.gguf filter=lfs diff=lfs merge=lfs -text
|
39 |
+
Q3_K_S/Q3_K_S-00001-of-00001.gguf filter=lfs diff=lfs merge=lfs -text
|
40 |
+
Q4_0/Q4_0-00001-of-00001.gguf filter=lfs diff=lfs merge=lfs -text
|
41 |
+
Q4_1/Q4_1-00001-of-00001.gguf filter=lfs diff=lfs merge=lfs -text
|
42 |
+
Q4_K_M/Q4_K_M-00001-of-00001.gguf filter=lfs diff=lfs merge=lfs -text
|
43 |
+
Q4_K_S/Q4_K_S-00001-of-00001.gguf filter=lfs diff=lfs merge=lfs -text
|
44 |
+
Q5_0/Q5_0-00001-of-00001.gguf filter=lfs diff=lfs merge=lfs -text
|
45 |
+
Q5_1/Q5_1-00001-of-00001.gguf filter=lfs diff=lfs merge=lfs -text
|
46 |
+
Q5_K_M/Q5_K_M-00001-of-00001.gguf filter=lfs diff=lfs merge=lfs -text
|
47 |
+
Q5_K_S/Q5_K_S-00001-of-00001.gguf filter=lfs diff=lfs merge=lfs -text
|
48 |
+
Q6_K/Q6_K-00001-of-00001.gguf filter=lfs diff=lfs merge=lfs -text
|
49 |
+
Q8_0/Q8_0-00001-of-00001.gguf filter=lfs diff=lfs merge=lfs -text
|
Q2_K/Q2_K-00001-of-00001.gguf
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0faa881d3d9a34adf60bf625d4df2fdc41c6c2620e8e2b0123ddfcdd615486f8
|
3 |
+
size 3481447712
|
Q3_K_L/Q3_K_L-00001-of-00001.gguf
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:36ac8a7c71a1208d15d500fe5704dae26072a4585a8cc26cdb5a8f1f1594ce25
|
3 |
+
size 4709068064
|
Q3_K_M/Q3_K_M-00001-of-00001.gguf
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d7e0a153f578f030159a777f2f198a2897473497fb30a4cac1de551c97fbf32f
|
3 |
+
size 4369329440
|
Q3_K_S/Q3_K_S-00001-of-00001.gguf
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a75b274561e00abede5b65e5bb5d949dd17577d3083221209ab27a9a08ccf2c9
|
3 |
+
size 3982404896
|
Q4_0/Q4_0-00001-of-00001.gguf
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e5ad1712c169e1eb4bab7a7a842caf4c99afb973ee5f7593edbb104dac1a163c
|
3 |
+
size 5011844384
|
Q4_1/Q4_1-00001-of-00001.gguf
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:790acb8a371ef0fa598f6ecce4e377fadba9014a3259a1de30ff5cacf9a59f1f
|
3 |
+
size 5496286496
|
Q4_K_M/Q4_K_M-00001-of-00001.gguf
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:8e2e34554b5ce0086c07f2815fef6b86b3d0cb2a1c103722d1e273521a50bd7b
|
3 |
+
size 5329759520
|
Q4_K_S/Q4_K_S-00001-of-00001.gguf
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:3723977daed343ad964e1958825a2920ef002a3f3294071e2323b8d2667a66e0
|
3 |
+
size 5046447392
|
Q5_0/Q5_0-00001-of-00001.gguf
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d6998a0e5e6bc9cfe617dc0ee7b84bce63eb4d4f356a9e03459b4fde0e41b37e
|
3 |
+
size 5980728608
|
Q5_1/Q5_1-00001-of-00001.gguf
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7582db3a0c3e80058694fb978270fd7e270705f4fa896758ff1465ed5795ae82
|
3 |
+
size 6465170720
|
Q5_K_M/Q5_K_M-00001-of-00001.gguf
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:3188fed0f101327f98935bbec257e0c85c121965c5ac48ff6cd34a690d4fde98
|
3 |
+
size 6144503072
|
Q5_K_S/Q5_K_S-00001-of-00001.gguf
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f935acd5fa3560c9553ef04cd8f88fd22bda26e3af859d638a6546ac11f9f483
|
3 |
+
size 5980728608
|
Q6_K/Q6_K-00001-of-00001.gguf
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9454fa23b6e6e7c8dfa1d50fab8a7d178971de6720ecbd39d271ac4672fe4145
|
3 |
+
size 7010168096
|
Q8_0/Q8_0-00001-of-00001.gguf
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:64c7f87c2f9ab2f76eaa9e194f5bb2ef89cdd5c545ba2b470688a1fdce6337c2
|
3 |
+
size 9077845280
|
README.md
ADDED
@@ -0,0 +1,411 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
|
3 |
+
---
|
4 |
+
license: gemma
|
5 |
+
library_name: transformers
|
6 |
+
tags:
|
7 |
+
- GGUF
|
8 |
+
widget:
|
9 |
+
- messages:
|
10 |
+
- role: user
|
11 |
+
content: How does the brain work?
|
12 |
+
inference:
|
13 |
+
parameters:
|
14 |
+
max_new_tokens: 200
|
15 |
+
extra_gated_heading: Access Gemma on Hugging Face
|
16 |
+
extra_gated_prompt: To access Gemma on Hugging Face, you’re required to review and
|
17 |
+
agree to Google’s usage license. To do this, please ensure you’re logged-in to Hugging
|
18 |
+
Face and click below. Requests are processed immediately.
|
19 |
+
extra_gated_button_content: Acknowledge license
|
20 |
+
quantized_by: andrijdavid
|
21 |
+
---
|
22 |
+
# gemma-1.1-7b-it-GGUF
|
23 |
+
- Original model: [gemma-1.1-7b-it](https://huggingface.co/google/gemma-1.1-7b-it)
|
24 |
+
|
25 |
+
<!-- description start -->
|
26 |
+
## Description
|
27 |
+
|
28 |
+
This repo contains GGUF format model files for [gemma-1.1-7b-it](https://huggingface.co/google/gemma-1.1-7b-it).
|
29 |
+
|
30 |
+
<!-- description end -->
|
31 |
+
<!-- README_GGUF.md-about-gguf start -->
|
32 |
+
### About GGUF
|
33 |
+
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.
|
34 |
+
Here is an incomplete list of clients and libraries that are known to support GGUF:
|
35 |
+
* [llama.cpp](https://github.com/ggerganov/llama.cpp). This is the source project for GGUF, providing both a Command Line Interface (CLI) and a server option.
|
36 |
+
* [text-generation-webui](https://github.com/oobabooga/text-generation-webui), Known as the most widely used web UI, this project boasts numerous features and powerful extensions, and supports GPU acceleration.
|
37 |
+
* [Ollama](https://github.com/jmorganca/ollama) Ollama is a lightweight and extensible framework designed for building and running language models locally. It features a simple API for creating, managing, and executing models, along with a library of pre-built models for use in various applications
|
38 |
+
* [KoboldCpp](https://github.com/LostRuins/koboldcpp), A comprehensive web UI offering GPU acceleration across all platforms and architectures, particularly renowned for storytelling.
|
39 |
+
* [GPT4All](https://gpt4all.io), This is a free and open source GUI that runs locally, supporting Windows, Linux, and macOS with full GPU acceleration.
|
40 |
+
* [LM Studio](https://lmstudio.ai/) An intuitive and powerful local GUI for Windows and macOS (Silicon), featuring GPU acceleration.
|
41 |
+
* [LoLLMS Web UI](https://github.com/ParisNeo/lollms-webui). A notable web UI with a variety of unique features, including a comprehensive model library for easy model selection.
|
42 |
+
* [Faraday.dev](https://faraday.dev/), An attractive, user-friendly character-based chat GUI for Windows and macOS (both Silicon and Intel), also offering GPU acceleration.
|
43 |
+
* [llama-cpp-python](https://github.com/abetlen/llama-cpp-python), A Python library equipped with GPU acceleration, LangChain support, and an OpenAI-compatible API server.
|
44 |
+
* [candle](https://github.com/huggingface/candle), A Rust-based ML framework focusing on performance, including GPU support, and designed for ease of use.
|
45 |
+
* [ctransformers](https://github.com/marella/ctransformers), A Python library featuring GPU acceleration, LangChain support, and an OpenAI-compatible AI server.
|
46 |
+
* [localGPT](https://github.com/PromtEngineer/localGPT) An open-source initiative enabling private conversations with documents.
|
47 |
+
<!-- README_GGUF.md-about-gguf end -->
|
48 |
+
|
49 |
+
<!-- compatibility_gguf start -->
|
50 |
+
## Explanation of quantisation methods
|
51 |
+
<details>
|
52 |
+
<summary>Click to see details</summary>
|
53 |
+
The new methods available are:
|
54 |
+
|
55 |
+
* 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)
|
56 |
+
* 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.
|
57 |
+
* 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.
|
58 |
+
* GGML_TYPE_Q5_K - "type-1" 5-bit quantization. Same super-block structure as GGML_TYPE_Q4_K resulting in 5.5 bpw
|
59 |
+
* 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.
|
60 |
+
</details>
|
61 |
+
<!-- compatibility_gguf end -->
|
62 |
+
|
63 |
+
<!-- README_GGUF.md-how-to-download start -->
|
64 |
+
## How to download GGUF files
|
65 |
+
|
66 |
+
**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 folder.
|
67 |
+
|
68 |
+
The following clients/libraries will automatically download models for you, providing a list of available models to choose from:
|
69 |
+
|
70 |
+
* LM Studio
|
71 |
+
* LoLLMS Web UI
|
72 |
+
* Faraday.dev
|
73 |
+
|
74 |
+
### In `text-generation-webui`
|
75 |
+
|
76 |
+
Under Download Model, you can enter the model repo: LiteLLMs/gemma-1.1-7b-it-GGUF and below it, a specific filename to download, such as: Q4_0/Q4_0-00001-of-00009.gguf.
|
77 |
+
|
78 |
+
Then click Download.
|
79 |
+
|
80 |
+
### On the command line, including multiple files at once
|
81 |
+
|
82 |
+
I recommend using the `huggingface-hub` Python library:
|
83 |
+
|
84 |
+
```shell
|
85 |
+
pip3 install huggingface-hub
|
86 |
+
```
|
87 |
+
|
88 |
+
Then you can download any individual model file to the current directory, at high speed, with a command like this:
|
89 |
+
|
90 |
+
```shell
|
91 |
+
huggingface-cli download LiteLLMs/gemma-1.1-7b-it-GGUF Q4_0/Q4_0-00001-of-00009.gguf --local-dir . --local-dir-use-symlinks False
|
92 |
+
```
|
93 |
+
|
94 |
+
<details>
|
95 |
+
<summary>More advanced huggingface-cli download usage (click to read)</summary>
|
96 |
+
|
97 |
+
You can also download multiple files at once with a pattern:
|
98 |
+
|
99 |
+
```shell
|
100 |
+
huggingface-cli download LiteLLMs/gemma-1.1-7b-it-GGUF --local-dir . --local-dir-use-symlinks False --include='*Q4_K*gguf'
|
101 |
+
```
|
102 |
+
|
103 |
+
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).
|
104 |
+
|
105 |
+
To accelerate downloads on fast connections (1Gbit/s or higher), install `hf_transfer`:
|
106 |
+
|
107 |
+
```shell
|
108 |
+
pip3 install huggingface_hub[hf_transfer]
|
109 |
+
```
|
110 |
+
|
111 |
+
And set environment variable `HF_HUB_ENABLE_HF_TRANSFER` to `1`:
|
112 |
+
|
113 |
+
```shell
|
114 |
+
HF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download LiteLLMs/gemma-1.1-7b-it-GGUF Q4_0/Q4_0-00001-of-00009.gguf --local-dir . --local-dir-use-symlinks False
|
115 |
+
```
|
116 |
+
|
117 |
+
Windows Command Line users: You can set the environment variable by running `set HF_HUB_ENABLE_HF_TRANSFER=1` before the download command.
|
118 |
+
</details>
|
119 |
+
<!-- README_GGUF.md-how-to-download end -->
|
120 |
+
<!-- README_GGUF.md-how-to-run start -->
|
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 Q4_0/Q4_0-00001-of-00009.gguf --color -c 8192 --temp 0.7 --repeat_penalty 1.1 -n -1 -p "<PROMPT>"
|
127 |
+
```
|
128 |
+
|
129 |
+
Change `-ngl 32` to the number of layers to offload to GPU. Remove it if you don't have GPU acceleration.
|
130 |
+
|
131 |
+
Change `-c 8192` 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.
|
132 |
+
|
133 |
+
If you want to have a chat-style conversation, replace the `-p <PROMPT>` argument with `-i -ins`
|
134 |
+
|
135 |
+
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)
|
136 |
+
|
137 |
+
## How to run in `text-generation-webui`
|
138 |
+
|
139 |
+
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).
|
140 |
+
|
141 |
+
## How to run from Python code
|
142 |
+
|
143 |
+
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.
|
144 |
+
|
145 |
+
### How to load this model in Python code, using llama-cpp-python
|
146 |
+
|
147 |
+
For full documentation, please see: [llama-cpp-python docs](https://abetlen.github.io/llama-cpp-python/).
|
148 |
+
|
149 |
+
#### First install the package
|
150 |
+
|
151 |
+
Run one of the following commands, according to your system:
|
152 |
+
|
153 |
+
```shell
|
154 |
+
# Base ctransformers with no GPU acceleration
|
155 |
+
pip install llama-cpp-python
|
156 |
+
# With NVidia CUDA acceleration
|
157 |
+
CMAKE_ARGS="-DLLAMA_CUBLAS=on" pip install llama-cpp-python
|
158 |
+
# Or with OpenBLAS acceleration
|
159 |
+
CMAKE_ARGS="-DLLAMA_BLAS=ON -DLLAMA_BLAS_VENDOR=OpenBLAS" pip install llama-cpp-python
|
160 |
+
# Or with CLBLast acceleration
|
161 |
+
CMAKE_ARGS="-DLLAMA_CLBLAST=on" pip install llama-cpp-python
|
162 |
+
# Or with AMD ROCm GPU acceleration (Linux only)
|
163 |
+
CMAKE_ARGS="-DLLAMA_HIPBLAS=on" pip install llama-cpp-python
|
164 |
+
# Or with Metal GPU acceleration for macOS systems only
|
165 |
+
CMAKE_ARGS="-DLLAMA_METAL=on" pip install llama-cpp-python
|
166 |
+
# In windows, to set the variables CMAKE_ARGS in PowerShell, follow this format; eg for NVidia CUDA:
|
167 |
+
$env:CMAKE_ARGS = "-DLLAMA_OPENBLAS=on"
|
168 |
+
pip install llama-cpp-python
|
169 |
+
```
|
170 |
+
|
171 |
+
#### Simple llama-cpp-python example code
|
172 |
+
|
173 |
+
```python
|
174 |
+
from llama_cpp import Llama
|
175 |
+
# Set gpu_layers to the number of layers to offload to GPU. Set to 0 if no GPU acceleration is available on your system.
|
176 |
+
llm = Llama(
|
177 |
+
model_path="./Q4_0/Q4_0-00001-of-00009.gguf", # Download the model file first
|
178 |
+
n_ctx=32768, # The max sequence length to use - note that longer sequence lengths require much more resources
|
179 |
+
n_threads=8, # The number of CPU threads to use, tailor to your system and the resulting performance
|
180 |
+
n_gpu_layers=35 # The number of layers to offload to GPU, if you have GPU acceleration available
|
181 |
+
)
|
182 |
+
# Simple inference example
|
183 |
+
output = llm(
|
184 |
+
"<PROMPT>", # Prompt
|
185 |
+
max_tokens=512, # Generate up to 512 tokens
|
186 |
+
stop=["</s>"], # Example stop token - not necessarily correct for this specific model! Please check before using.
|
187 |
+
echo=True # Whether to echo the prompt
|
188 |
+
)
|
189 |
+
# Chat Completion API
|
190 |
+
llm = Llama(model_path="./Q4_0/Q4_0-00001-of-00009.gguf", chat_format="llama-2") # Set chat_format according to the model you are using
|
191 |
+
llm.create_chat_completion(
|
192 |
+
messages = [
|
193 |
+
{"role": "system", "content": "You are a story writing assistant."},
|
194 |
+
{
|
195 |
+
"role": "user",
|
196 |
+
"content": "Write a story about llamas."
|
197 |
+
}
|
198 |
+
]
|
199 |
+
)
|
200 |
+
```
|
201 |
+
|
202 |
+
## How to use with LangChain
|
203 |
+
|
204 |
+
Here are guides on using llama-cpp-python and ctransformers with LangChain:
|
205 |
+
|
206 |
+
* [LangChain + llama-cpp-python](https://python.langchain.com/docs/integrations/llms/llamacpp)
|
207 |
+
* [LangChain + ctransformers](https://python.langchain.com/docs/integrations/providers/ctransformers)
|
208 |
+
|
209 |
+
<!-- README_GGUF.md-how-to-run end -->
|
210 |
+
|
211 |
+
<!-- footer end -->
|
212 |
+
|
213 |
+
<!-- original-model-card start -->
|
214 |
+
# Original model card: gemma-1.1-7b-it
|
215 |
+
|
216 |
+
|
217 |
+
# Gemma Model Card
|
218 |
+
|
219 |
+
**Model Page**: [Gemma](https://ai.google.dev/gemma/docs)
|
220 |
+
|
221 |
+
This model card corresponds to the latest 7B instruct version of the Gemma model. Here you can find other models in the Gemma family:
|
222 |
+
|
223 |
+
| | Base | Instruct |
|
224 |
+
| - | - | |
|
225 |
+
| [MMLU](https://arxiv.org/abs/2009.03300) | 5-shot, top-1 | 42.3 | 64.3 |
|
226 |
+
| [HellaSwag](https://arxiv.org/abs/1905.07830) | 0-shot | 71.4 | 81.2 |
|
227 |
+
| [PIQA](https://arxiv.org/abs/1911.11641) | 0-shot | 77.3 | 81.2 |
|
228 |
+
| [SocialIQA](https://arxiv.org/abs/1904.09728) | 0-shot | 49.7 | 51.8 |
|
229 |
+
| [BooIQ](https://arxiv.org/abs/1905.10044) | 0-shot | 69.4 | 83.2 |
|
230 |
+
| [WinoGrande](https://arxiv.org/abs/1907.10641) | partial score | 65.4 | 72.3 |
|
231 |
+
| [CommonsenseQA](https://arxiv.org/abs/1811.00937) | 7-shot | 65.3 | 71.3 |
|
232 |
+
| [OpenBookQA](https://arxiv.org/abs/1809.02789) | | 47.8 | 52.8 |
|
233 |
+
| [ARC-e](https://arxiv.org/abs/1911.01547) | | 73.2 | 81.5 |
|
234 |
+
| [ARC-c](https://arxiv.org/abs/1911.01547) | | 42.1 | 53.2 |
|
235 |
+
| [TriviaQA](https://arxiv.org/abs/1705.03551) | 5-shot | 53.2 | 63.4 |
|
236 |
+
| [Natural Questions](https://github.com/google-research-datasets/natural-questions) | 5-shot | 12.5 | 23 |
|
237 |
+
| [HumanEval](https://arxiv.org/abs/2107.03374) | pass@1 | 22.0 | 32.3 |
|
238 |
+
| [MBPP](https://arxiv.org/abs/2108.07732) | 3-shot | 29.2 | 44.4 |
|
239 |
+
| [GSM8K](https://arxiv.org/abs/2110.14168) | maj@1 | 17.7 | 46.4 |
|
240 |
+
| [MATH](https://arxiv.org/abs/2108.07732) | 4-shot | 11.8 | 24.3 |
|
241 |
+
| [AGIEval](https://arxiv.org/abs/2304.06364) | | 24.2 | 41.7 |
|
242 |
+
| [BIG-Bench](https://arxiv.org/abs/2206.04615) | | 35.2 | 55.1 |
|
243 |
+
| | - | |
|
244 |
+
| **Average** | | **45.0** | **56.9** |
|
245 |
+
|
246 |
+
## Ethics and Safety
|
247 |
+
|
248 |
+
Ethics and safety evaluation approach and results.
|
249 |
+
|
250 |
+
### Evaluation Approach
|
251 |
+
|
252 |
+
Our evaluation methods include structured evaluations and internal red-teaming
|
253 |
+
testing of relevant content policies. Red-teaming was conducted by a number of
|
254 |
+
different teams, each with different goals and human evaluation metrics. These
|
255 |
+
models were evaluated against a number of different categories relevant to
|
256 |
+
ethics and safety, including:
|
257 |
+
|
258 |
+
* Text-to-Text Content Safety: Human evaluation on prompts covering safety
|
259 |
+
policies including child sexual abuse and exploitation, harassment, violence
|
260 |
+
and gore, and hate speech.
|
261 |
+
* Text-to-Text Representational Harms: Benchmark against relevant academic
|
262 |
+
datasets such as [WinoBias](https://arxiv.org/abs/1804.06876) and [BBQ Dataset](https://arxiv.org/abs/2110.08193v2).
|
263 |
+
* Memorization: Automated evaluation of memorization of training data, including
|
264 |
+
the risk of personally identifiable information exposure.
|
265 |
+
* Large-scale harm: Tests for "dangerous capabilities," such as chemical,
|
266 |
+
biological, radiological, and nuclear (CBRN) risks.
|
267 |
+
|
268 |
+
### Evaluation Results
|
269 |
+
|
270 |
+
The results of ethics and safety evaluations are within acceptable thresholds
|
271 |
+
for meeting [internal policies](https://storage.googleapis.com/gweb-uniblog-publish-prod/documents/2023_Google_AI_Principles_Progress_Update.pdf#page=11) for categories such as child
|
272 |
+
safety, content safety, representational harms, memorization, large-scale harms.
|
273 |
+
On top of robust internal evaluations, the results of well known safety
|
274 |
+
benchmarks like BBQ, BOLD, Winogender, Winobias, RealToxicity, and TruthfulQA
|
275 |
+
are shown here.
|
276 |
+
|
277 |
+
#### Gemma 1.0
|
278 |
+
|
279 |
+
| Benchmark | Metric | Gemma 1.0 IT 2B | Gemma 1.0 IT 7B |
|
280 |
+
| | - | |
|
281 |
+
| [RealToxicity][realtox] | average | 6.86 | 7.90 |
|
282 |
+
| [BOLD][bold] | | 45.57 | 49.08 |
|
283 |
+
| [CrowS-Pairs][crows] | top-1 | 45.82 | 51.33 |
|
284 |
+
| [BBQ Ambig][bbq] | 1-shot, top-1 | 62.58 | 92.54 |
|
285 |
+
| [BBQ Disambig][bbq] | top-1 | 54.62 | 71.99 |
|
286 |
+
| [Winogender][winogender] | top-1 | 51.25 | 54.17 |
|
287 |
+
| [TruthfulQA][truthfulqa] | | 44.84 | 31.81 |
|
288 |
+
| [Winobias 1_2][winobias] | | 56.12 | 59.09 |
|
289 |
+
| [Winobias 2_2][winobias] | | 91.10 | 92.23 |
|
290 |
+
| [Toxigen][toxigen] | | 29.77 | 39.59 |
|
291 |
+
| | - | |
|
292 |
+
|
293 |
+
#### Gemma 1.1
|
294 |
+
|
295 |
+
| Benchmark | Metric | Gemma 1.1 IT 2B | Gemma 1.1 IT 7B |
|
296 |
+
| | - | |
|
297 |
+
| [RealToxicity][realtox] | average | 7.03 | 8.04 |
|
298 |
+
| [BOLD][bold] | | 47.76 | |
|
299 |
+
| [CrowS-Pairs][crows] | top-1 | 45.89 | 49.67 |
|
300 |
+
| [BBQ Ambig][bbq] | 1-shot, top-1 | 58.97 | 86.06 |
|
301 |
+
| [BBQ Disambig][bbq] | top-1 | 53.90 | 85.08 |
|
302 |
+
| [Winogender][winogender] | top-1 | 50.14 | 57.64 |
|
303 |
+
| [TruthfulQA][truthfulqa] | | 44.24 | 45.34 |
|
304 |
+
| [Winobias 1_2][winobias] | | 55.93 | 59.22 |
|
305 |
+
| [Winobias 2_2][winobias] | | 89.46 | 89.2 |
|
306 |
+
| [Toxigen][toxigen] | | 29.64 | 38.75 |
|
307 |
+
| | - | |
|
308 |
+
|
309 |
+
|
310 |
+
## Usage and Limitations
|
311 |
+
|
312 |
+
These models have certain limitations that users should be aware of.
|
313 |
+
|
314 |
+
### Intended Usage
|
315 |
+
|
316 |
+
Open Large Language Models (LLMs) have a wide range of applications across
|
317 |
+
various industries and domains. The following list of potential uses is not
|
318 |
+
comprehensive. The purpose of this list is to provide contextual information
|
319 |
+
about the possible use-cases that the model creators considered as part of model
|
320 |
+
training and development.
|
321 |
+
|
322 |
+
* Content Creation and Communication
|
323 |
+
* Text Generation: These models can be used to generate creative text formats
|
324 |
+
such as poems, scripts, code, marketing copy, and email drafts.
|
325 |
+
* Chatbots and Conversational AI: Power conversational interfaces for customer
|
326 |
+
service, virtual assistants, or interactive applications.
|
327 |
+
* Text Summarization: Generate concise summaries of a text corpus, research
|
328 |
+
papers, or reports.
|
329 |
+
* Research and Education
|
330 |
+
* Natural Language Processing (NLP) Research: These models can serve as a
|
331 |
+
foundation for researchers to experiment with NLP techniques, develop
|
332 |
+
algorithms, and contribute to the advancement of the field.
|
333 |
+
* Language Learning Tools: Support interactive language learning experiences,
|
334 |
+
aiding in grammar correction or providing writing practice.
|
335 |
+
* Knowledge Exploration: Assist researchers in exploring large bodies of text
|
336 |
+
by generating summaries or answering questions about specific topics.
|
337 |
+
|
338 |
+
### Limitations
|
339 |
+
|
340 |
+
* Training Data
|
341 |
+
* The quality and diversity of the training data significantly influence the
|
342 |
+
model's capabilities. Biases or gaps in the training data can lead to
|
343 |
+
limitations in the model's responses.
|
344 |
+
* The scope of the training dataset determines the subject areas the model can
|
345 |
+
handle effectively.
|
346 |
+
* Context and Task Complexity
|
347 |
+
* LLMs are better at tasks that can be framed with clear prompts and
|
348 |
+
instructions. Open-ended or highly complex tasks might be challenging.
|
349 |
+
* A model's performance can be influenced by the amount of context provided
|
350 |
+
(longer context generally leads to better outputs, up to a certain point).
|
351 |
+
* Language Ambiguity and Nuance
|
352 |
+
* Natural language is inherently complex. LLMs might struggle to grasp subtle
|
353 |
+
nuances, sarcasm, or figurative language.
|
354 |
+
* Factual Accuracy
|
355 |
+
* LLMs generate responses based on information they learned from their
|
356 |
+
training datasets, but they are not knowledge bases. They may generate
|
357 |
+
incorrect or outdated factual statements.
|
358 |
+
* Common Sense
|
359 |
+
* LLMs rely on statistical patterns in language. They might lack the ability
|
360 |
+
to apply common sense reasoning in certain situations.
|
361 |
+
|
362 |
+
### Ethical Considerations and Risks
|
363 |
+
|
364 |
+
The development of large language models (LLMs) raises several ethical concerns.
|
365 |
+
In creating an open model, we have carefully considered the following:
|
366 |
+
|
367 |
+
* Bias and Fairness
|
368 |
+
* LLMs trained on large-scale, real-world text data can reflect socio-cultural
|
369 |
+
biases embedded in the training material. These models underwent careful
|
370 |
+
scrutiny, input data pre-processing described and posterior evaluations
|
371 |
+
reported in this card.
|
372 |
+
* Misinformation and Misuse
|
373 |
+
* LLMs can be misused to generate text that is false, misleading, or harmful.
|
374 |
+
* Guidelines are provided for responsible use with the model, see the
|
375 |
+
[Responsible Generative AI Toolkit](http://ai.google.dev/gemma/responsible).
|
376 |
+
* Transparency and Accountability:
|
377 |
+
* This model card summarizes details on the models' architecture,
|
378 |
+
capabilities, limitations, and evaluation processes.
|
379 |
+
* A responsibly developed open model offers the opportunity to share
|
380 |
+
innovation by making LLM technology accessible to developers and researchers
|
381 |
+
across the AI ecosystem.
|
382 |
+
|
383 |
+
Risks identified and mitigations:
|
384 |
+
|
385 |
+
* Perpetuation of biases: It's encouraged to perform continuous monitoring
|
386 |
+
(using evaluation metrics, human review) and the exploration of de-biasing
|
387 |
+
techniques during model training, fine-tuning, and other use cases.
|
388 |
+
* Generation of harmful content: Mechanisms and guidelines for content safety
|
389 |
+
are essential. Developers are encouraged to exercise caution and implement
|
390 |
+
appropriate content safety safeguards based on their specific product policies
|
391 |
+
and application use cases.
|
392 |
+
* Misuse for malicious purposes: Technical limitations and developer and
|
393 |
+
end-user education can help mitigate against malicious applications of LLMs.
|
394 |
+
Educational resources and reporting mechanisms for users to flag misuse are
|
395 |
+
provided. Prohibited uses of Gemma models are outlined in the
|
396 |
+
[Gemma Prohibited Use Policy](https://ai.google.dev/gemma/prohibited_use_policy).
|
397 |
+
* Privacy violations: Models were trained on data filtered for removal of PII
|
398 |
+
(Personally Identifiable Information). Developers are encouraged to adhere to
|
399 |
+
privacy regulations with privacy-preserving techniques.
|
400 |
+
|
401 |
+
### Benefits
|
402 |
+
|
403 |
+
At the time of release, this family of models provides high-performance open
|
404 |
+
large language model implementations designed from the ground up for Responsible
|
405 |
+
AI development compared to similarly sized models.
|
406 |
+
|
407 |
+
Using the benchmark evaluation metrics described in this document, these models
|
408 |
+
have shown to provide superior performance to other, comparably-sized open model
|
409 |
+
alternatives.
|
410 |
+
|
411 |
+
<!-- original-model-card end -->
|