johnrachwanpruna commited on
Commit
fd91ec9
1 Parent(s): cc1b7b1

Upload folder using huggingface_hub (#1)

Browse files

- f1f48864359b65ca488c768aea4bd3479ee0b326b719693a983db5cedd50842a (2279179d8f2fe003686babb7b8d242a78d047dfe)
- a1442c07676f7da92126ab50bd5726d93303932547ed35afe5fb2a82962b6a09 (e9bad4fb9b0e6f4f6b5b34f3899f759bfeff0501)
- 1cdbb1a4be73d0565c9acdf706ae29384db8b21d2fb70bb21fbd78cb50449132 (559ef8244c152ad282cfa2cee6519cb51a8da4bc)
- 44e487d0eeb773698f06f4a24b2c327454e15fe834ced885f2248ad26de52802 (a3613c441203e4f366e4c779f71c3832a61cbc35)
- 63f82fa2f8bf418c4442d476bdd5cbbdc9ae46b1c2579b5c2e4ff85fce317f07 (59ea104ac4cf19fe6edca0a6289c616d450dc5fb)
- 115f2f7133572b1e7a7ad504a74f15d70bd09cbff2c2466d25bb84b42407d513 (28c39e38e45ccbe8c9d07920a6c9fb14424f6e0f)
- 51975ebf47753bc7cc4304b051f7af0406d552a124e87b71bb22420cf3d6d968 (8facd4f9b68873b0cff2f3a59d89941c0c73f109)
- 0981fdeb8ad9e2182cefbc8cdec00782af5e90f3a999e2b5c45e1232140860e7 (8b7564e6a43bdc51d202bc76f10a1078eb7474f9)
- 29bab55020004934f2391c47a4a541a080e28d773042ee3818adf5b85f138104 (21dfd6216e38ac93d16efeea45f46b2d3453703a)
- ed5929fead7ed1eb4dcd06dba405b05313147fb9735ea5607682b4533a3d1357 (aa783429f084bcb0c2cee62cb70357781c17f87a)
- f1a3f0ca2f2bcaa1b991ded7e6d4d4499b09312b47e76a1df61cf4361ccb45dc (02f7dc95321900047dfb3ea4787d13dc23c299ab)
- 8d861b9d8aab5e63649677a56b58cc612ce8f3f2fd30507e1d3c5802da55c31c (144a2ce0042b391811b69acbe18754aff3a126c4)
- c17e1d64a10f39dbbcde2fed5f2cf7045d199707a42205a0929f367e8367e961 (50cc309321bd103928f78397e40fa48931217aef)
- fd2234849bfc5c50bbf7ee28bdb05f2cf36699611bbbdea36f77f0083174041e (80db8659f0d1905b10e2bcb171cd52ecc6fa5af3)
- 09bc5dc6996b6366909675c4fa973f3e7bc179083bac1626e5f704ce6bd7085b (36a1298a07634d502bf389a02fa432258d8f04ff)
- 4b3f0a0fa65b1bd071889bcdcdd02f2439f11e4eaa41629f3ab4c34ac454aea9 (db6533c36e80c1d91849ae9d4e1d43ef002426e0)
- 254e40fec29c617f09b697254af9924a25ad0b1b93294754630ac02cea6343ac (21a8a74fa2b2bea0f69e0fbc4c5d932c55961365)
- 622c3a774c29862fe9114fc652c2e83756dc4808434e6a1965ced7e5e6b139e1 (9e5623ef9fcea3aeca8d7aabac39064c4c344c13)
- a63e4d936bc868f67ea5c4d9096b735878a9f547d6821d5d64e4278b73f8ba32 (fc6023a31c51b8fc14f8795287c7f0862c530537)
- 977e8457830f23c7261b0e521d600795dbda8f6f1920dd200b6e7114c8f507f0 (81f89f06fcc505cb7a83ecb0682f5caa90462f4f)
- 0bc7773a625e837f65f0ab673a15f55244926ee72299dc074ef4db919d91f84d (a81652e638de440520a6195f593e22580ba4905f)

.gitattributes CHANGED
@@ -33,3 +33,22 @@ 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
+ Mistral-22B-v0.2.IQ3_M.gguf filter=lfs diff=lfs merge=lfs -text
37
+ Mistral-22B-v0.2.IQ3_S.gguf filter=lfs diff=lfs merge=lfs -text
38
+ Mistral-22B-v0.2.IQ3_XS.gguf filter=lfs diff=lfs merge=lfs -text
39
+ Mistral-22B-v0.2.IQ4_NL.gguf filter=lfs diff=lfs merge=lfs -text
40
+ Mistral-22B-v0.2.IQ4_XS.gguf filter=lfs diff=lfs merge=lfs -text
41
+ Mistral-22B-v0.2.Q2_K.gguf filter=lfs diff=lfs merge=lfs -text
42
+ Mistral-22B-v0.2.Q3_K_L.gguf filter=lfs diff=lfs merge=lfs -text
43
+ Mistral-22B-v0.2.Q3_K_M.gguf filter=lfs diff=lfs merge=lfs -text
44
+ Mistral-22B-v0.2.Q3_K_S.gguf filter=lfs diff=lfs merge=lfs -text
45
+ Mistral-22B-v0.2.Q4_0.gguf filter=lfs diff=lfs merge=lfs -text
46
+ Mistral-22B-v0.2.Q4_1.gguf filter=lfs diff=lfs merge=lfs -text
47
+ Mistral-22B-v0.2.Q4_K_M.gguf filter=lfs diff=lfs merge=lfs -text
48
+ Mistral-22B-v0.2.Q4_K_S.gguf filter=lfs diff=lfs merge=lfs -text
49
+ Mistral-22B-v0.2.Q5_0.gguf filter=lfs diff=lfs merge=lfs -text
50
+ Mistral-22B-v0.2.Q5_1.gguf filter=lfs diff=lfs merge=lfs -text
51
+ Mistral-22B-v0.2.Q5_K_M.gguf filter=lfs diff=lfs merge=lfs -text
52
+ Mistral-22B-v0.2.Q5_K_S.gguf filter=lfs diff=lfs merge=lfs -text
53
+ Mistral-22B-v0.2.Q6_K.gguf filter=lfs diff=lfs merge=lfs -text
54
+ Mistral-22B-v0.2.Q8_0.gguf filter=lfs diff=lfs merge=lfs -text
Mistral-22B-v0.2.IQ3_M.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3787ae4926a787b381285f75787c8f0e5129321a1c019120c8fdea375ccc8aee
3
+ size 10056485216
Mistral-22B-v0.2.IQ3_S.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:34997895a5d9d6ffa41eb0fe8fd1f85f9598d2d7b187d75752813c30bb55c9a0
3
+ size 9682143584
Mistral-22B-v0.2.IQ3_XS.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fbe6c803a80239736683883c0b88b83b042e230adcfe5568742e0362d3bc134b
3
+ size 9170176352
Mistral-22B-v0.2.IQ4_NL.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5e38cf9c26d23d22dba6cef091b1142ef55b1f2de9781e362a68c715514d4f36
3
+ size 12694731104
Mistral-22B-v0.2.IQ4_XS.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8c84c3a906d9f180968cd0db9309af8b3b32e49933cb82f81cd9fc689f839f03
3
+ size 12038994272
Mistral-22B-v0.2.Q2_K.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:da4ee3dd6973ebfca352488c1354138f6b1dfb09996d46a4416fe3c4ae4ad705
3
+ size 8266652000
Mistral-22B-v0.2.Q3_K_L.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5fa82b1ede56cc1eec3677446f3e5559e3d097ca4202b12eb674868007839505
3
+ size 11724507488
Mistral-22B-v0.2.Q3_K_M.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dfae875a0aedd0d1d06141ab39809d05266af0558ef5ed1f0a9c829f056e5a72
3
+ size 10750904672
Mistral-22B-v0.2.Q3_K_S.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:812bfc14b4169446c5d5094de5615c2766b034a624e030e658f14a6e538c33e6
3
+ size 9635350880
Mistral-22B-v0.2.Q4_0.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:84c4d7132ff9499d980b5a123d4fda5477fbbac176c6ee94b3ea23a1f0c62761
3
+ size 12562610528
Mistral-22B-v0.2.Q4_1.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:01f828cd12a5870c9efb5c0797c9cad87a3cca5bb19cd4e010332c2e4b80f314
3
+ size 13940144480
Mistral-22B-v0.2.Q4_K_M.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:43947b0b573f6fed73cd5008677fe8c489cae728a3966be4cca2cd868bfabfed
3
+ size 13334690144
Mistral-22B-v0.2.Q4_K_S.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:802a3b4d1e8f622e4fa2ae2a2315c301c2663f27d259139a8c326421e4df4e9c
3
+ size 12653836640
Mistral-22B-v0.2.Q5_0.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7dbd670fe9d055ffc19dcdf838c7d87e9d3420e3d5a81ffdc687ad0ee73af7a6
3
+ size 15317678432
Mistral-22B-v0.2.Q5_1.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:64e4ae445f6c7dc7c7482cce885963e9c6f81f04fbb2724355ccb9e4d160aa64
3
+ size 16695212384
Mistral-22B-v0.2.Q5_K_M.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6eac20ba1ef744cd7a7a0eec75c9510ea9c09b76bc268c1f3ba1c108ca7afeb1
3
+ size 15715416416
Mistral-22B-v0.2.Q5_K_S.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8153a1770a20ed4aa98c5c6839045d0d6ddab848ebc29dc6c9e6b0889217f4aa
3
+ size 15317678432
Mistral-22B-v0.2.Q6_K.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3d488aefca140f8cdc26882633f0cdeb773a50e91fdc6b9803be7a8b569cb14b
3
+ size 18244938080
Mistral-22B-v0.2.Q8_0.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5acceb66fe7e50dfd7416d2c59ecfdc1abec61e2d6a2f7b9b2b080821dd4c71a
3
+ size 23630498144
Mistral-22B-v0.2.fp16.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4e7dd518af603807dd883341f26ca68854d0eaa8dd7c9d9e124d32426029498d
3
+ size 44477827392
README.md ADDED
@@ -0,0 +1,220 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ ---
3
+ thumbnail: "https://assets-global.website-files.com/646b351987a8d8ce158d1940/64ec9e96b4334c0e1ac41504_Logo%20with%20white%20text.svg"
4
+ metrics:
5
+ - memory_disk
6
+ - memory_inference
7
+ - inference_latency
8
+ - inference_throughput
9
+ - inference_CO2_emissions
10
+ - inference_energy_consumption
11
+ tags:
12
+ - pruna-ai
13
+ ---
14
+ <!-- header start -->
15
+ <!-- 200823 -->
16
+ <div style="width: auto; margin-left: auto; margin-right: auto">
17
+ <a href="https://www.pruna.ai/" target="_blank" rel="noopener noreferrer">
18
+ <img src="https://i.imgur.com/eDAlcgk.png" alt="PrunaAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
19
+ </a>
20
+ </div>
21
+ <!-- header end -->
22
+
23
+ [![Twitter](https://img.shields.io/twitter/follow/PrunaAI?style=social)](https://twitter.com/PrunaAI)
24
+ [![GitHub](https://img.shields.io/github/followers/PrunaAI?label=Follow%20%40PrunaAI&style=social)](https://github.com/PrunaAI)
25
+ [![LinkedIn](https://img.shields.io/badge/LinkedIn-Connect-blue)](https://www.linkedin.com/company/93832878/admin/feed/posts/?feedType=following)
26
+ [![Discord](https://img.shields.io/badge/Discord-Join%20Us-blue?style=social&logo=discord)](https://discord.gg/CP4VSgck)
27
+
28
+ # Simply make AI models cheaper, smaller, faster, and greener!
29
+
30
+ - Give a thumbs up if you like this model!
31
+ - Contact us and tell us which model to compress next [here](https://www.pruna.ai/contact).
32
+ - Request access to easily compress your *own* AI models [here](https://z0halsaff74.typeform.com/pruna-access?typeform-source=www.pruna.ai).
33
+ - Read the documentations to know more [here](https://pruna-ai-pruna.readthedocs-hosted.com/en/latest/)
34
+ - Join Pruna AI community on Discord [here](https://discord.gg/CP4VSgck) to share feedback/suggestions or get help.
35
+
36
+ **Frequently Asked Questions**
37
+ - ***How does the compression work?*** The model is compressed with GGUF.
38
+ - ***How does the model quality change?*** The quality of the model output might vary compared to the base model.
39
+ - ***What is the model format?*** We use GGUF format.
40
+ - ***What calibration data has been used?*** If needed by the compression method, we used WikiText as the calibration data.
41
+ - ***How to compress my own models?*** You can request premium access to more compression methods and tech support for your specific use-cases [here](https://z0halsaff74.typeform.com/pruna-access?typeform-source=www.pruna.ai).
42
+
43
+ # Downloading and running the models
44
+
45
+ You can download the individual files from the Files & versions section. Here is a list of the different versions we provide. For more info checkout [this chart](https://gist.github.com/Artefact2/b5f810600771265fc1e39442288e8ec9) and [this guide](https://www.reddit.com/r/LocalLLaMA/comments/1ba55rj/overview_of_gguf_quantization_methods/):
46
+
47
+ | Quant type | Description |
48
+ |------------|--------------------------------------------------------------------------------------------|
49
+ | Q5_K_M | High quality, recommended. |
50
+ | Q5_K_S | High quality, recommended. |
51
+ | Q4_K_M | Good quality, uses about 4.83 bits per weight, recommended. |
52
+ | Q4_K_S | Slightly lower quality with more space savings, recommended. |
53
+ | IQ4_NL | Decent quality, slightly smaller than Q4_K_S with similar performance, recommended. |
54
+ | IQ4_XS | Decent quality, smaller than Q4_K_S with similar performance, recommended. |
55
+ | Q3_K_L | Lower quality but usable, good for low RAM availability. |
56
+ | Q3_K_M | Even lower quality. |
57
+ | IQ3_M | Medium-low quality, new method with decent performance comparable to Q3_K_M. |
58
+ | IQ3_S | Lower quality, new method with decent performance, recommended over Q3_K_S quant, same size with better performance. |
59
+ | Q3_K_S | Low quality, not recommended. |
60
+ | IQ3_XS | Lower quality, new method with decent performance, slightly better than Q3_K_S. |
61
+ | Q2_K | Very low quality but surprisingly usable. |
62
+
63
+
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 file.
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
+ - **Option A** - Downloading in `text-generation-webui`:
75
+ - **Step 1**: Under Download Model, you can enter the model repo: PrunaAI/Mistral-22B-v0.2-GGUF-smashed-smashed and below it, a specific filename to download, such as: phi-2.IQ3_M.gguf.
76
+ - **Step 2**: Then click Download.
77
+
78
+ - **Option B** - Downloading on the command line (including multiple files at once):
79
+ - **Step 1**: We recommend using the `huggingface-hub` Python library:
80
+ ```shell
81
+ pip3 install huggingface-hub
82
+ ```
83
+ - **Step 2**: Then you can download any individual model file to the current directory, at high speed, with a command like this:
84
+ ```shell
85
+ huggingface-cli download PrunaAI/Mistral-22B-v0.2-GGUF-smashed-smashed Mistral-22B-v0.2.IQ3_M.gguf --local-dir . --local-dir-use-symlinks False
86
+ ```
87
+ <details>
88
+ <summary>More advanced huggingface-cli download usage (click to read)</summary>
89
+ Alternatively, you can also download multiple files at once with a pattern:
90
+
91
+ ```shell
92
+ huggingface-cli download PrunaAI/Mistral-22B-v0.2-GGUF-smashed-smashed --local-dir . --local-dir-use-symlinks False --include='*Q4_K*gguf'
93
+ ```
94
+
95
+ 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).
96
+
97
+ To accelerate downloads on fast connections (1Gbit/s or higher), install `hf_transfer`:
98
+
99
+ ```shell
100
+ pip3 install hf_transfer
101
+ ```
102
+
103
+ And set environment variable `HF_HUB_ENABLE_HF_TRANSFER` to `1`:
104
+
105
+ ```shell
106
+ HF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download PrunaAI/Mistral-22B-v0.2-GGUF-smashed-smashed Mistral-22B-v0.2.IQ3_M.gguf --local-dir . --local-dir-use-symlinks False
107
+ ```
108
+
109
+ Windows Command Line users: You can set the environment variable by running `set HF_HUB_ENABLE_HF_TRANSFER=1` before the download command.
110
+ </details>
111
+ <!-- README_GGUF.md-how-to-download end -->
112
+
113
+ <!-- README_GGUF.md-how-to-run start -->
114
+
115
+ ## How to run model in GGUF format?
116
+ - **Option A** - Introductory example with `llama.cpp` command
117
+
118
+ Make sure you are using `llama.cpp` from commit [d0cee0d](https://github.com/ggerganov/llama.cpp/commit/d0cee0d36d5be95a0d9088b674dbb27354107221) or later.
119
+
120
+ ```shell
121
+ ./main -ngl 35 -m Mistral-22B-v0.2.IQ3_M.gguf --color -c 32768 --temp 0.7 --repeat_penalty 1.1 -n -1 -p "<s>[INST] {prompt\} [/INST]"
122
+ ```
123
+
124
+ Change `-ngl 32` to the number of layers to offload to GPU. Remove it if you don't have GPU acceleration.
125
+
126
+ 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.
127
+
128
+ If you want to have a chat-style conversation, replace the `-p <PROMPT>` argument with `-i -ins`
129
+
130
+ 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)
131
+
132
+ - **Option B** - Running in `text-generation-webui`
133
+
134
+ 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).
135
+
136
+ - **Option C** - Running from Python code
137
+
138
+ 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.
139
+
140
+ ### How to load this model in Python code, using llama-cpp-python
141
+
142
+ For full documentation, please see: [llama-cpp-python docs](https://abetlen.github.io/llama-cpp-python/).
143
+
144
+ #### First install the package
145
+
146
+ Run one of the following commands, according to your system:
147
+
148
+ ```shell
149
+ # Base ctransformers with no GPU acceleration
150
+ pip install llama-cpp-python
151
+ # With NVidia CUDA acceleration
152
+ CMAKE_ARGS="-DLLAMA_CUBLAS=on" pip install llama-cpp-python
153
+ # Or with OpenBLAS acceleration
154
+ CMAKE_ARGS="-DLLAMA_BLAS=ON -DLLAMA_BLAS_VENDOR=OpenBLAS" pip install llama-cpp-python
155
+ # Or with CLBLast acceleration
156
+ CMAKE_ARGS="-DLLAMA_CLBLAST=on" pip install llama-cpp-python
157
+ # Or with AMD ROCm GPU acceleration (Linux only)
158
+ CMAKE_ARGS="-DLLAMA_HIPBLAS=on" pip install llama-cpp-python
159
+ # Or with Metal GPU acceleration for macOS systems only
160
+ CMAKE_ARGS="-DLLAMA_METAL=on" pip install llama-cpp-python
161
+
162
+ # In windows, to set the variables CMAKE_ARGS in PowerShell, follow this format; eg for NVidia CUDA:
163
+ $env:CMAKE_ARGS = "-DLLAMA_OPENBLAS=on"
164
+ pip install llama-cpp-python
165
+ ```
166
+
167
+ #### Simple llama-cpp-python example code
168
+
169
+ ```python
170
+ from llama_cpp import Llama
171
+
172
+ # Set gpu_layers to the number of layers to offload to GPU. Set to 0 if no GPU acceleration is available on your system.
173
+ llm = Llama(
174
+ model_path="./Mistral-22B-v0.2.IQ3_M.gguf", # Download the model file first
175
+ n_ctx=32768, # The max sequence length to use - note that longer sequence lengths require much more resources
176
+ n_threads=8, # The number of CPU threads to use, tailor to your system and the resulting performance
177
+ n_gpu_layers=35 # The number of layers to offload to GPU, if you have GPU acceleration available
178
+ )
179
+
180
+ # Simple inference example
181
+ output = llm(
182
+ "<s>[INST] {prompt} [/INST]", # Prompt
183
+ max_tokens=512, # Generate up to 512 tokens
184
+ stop=["</s>"], # Example stop token - not necessarily correct for this specific model! Please check before using.
185
+ echo=True # Whether to echo the prompt
186
+ )
187
+
188
+ # Chat Completion API
189
+
190
+ llm = Llama(model_path="./Mistral-22B-v0.2.IQ3_M.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
+ - **Option D** - Running 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
+ ## Configurations
210
+
211
+ The configuration info are in `smash_config.json`.
212
+
213
+ ## Credits & License
214
+
215
+ The license of the smashed model follows the license of the original model. Please check the license of the original model before using this model which provided the base model. The license of the `pruna-engine` is [here](https://pypi.org/project/pruna-engine/) on Pypi.
216
+
217
+ ## Want to compress other models?
218
+
219
+ - Contact us and tell us which model to compress next [here](https://www.pruna.ai/contact).
220
+ - Request access to easily compress your own AI models [here](https://z0halsaff74.typeform.com/pruna-access?typeform-source=www.pruna.ai).