andrijdavid commited on
Commit
1b88350
1 Parent(s): 19979ca

Upload folder using huggingface_hub

Browse files
.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:35870614a5b85a69302bb0d6283c172a8fde315606fdc2410cecdd375b70af1f
3
+ size 3179132128
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:edf1c58d8004c728b2907fb29f129b264e0b359925ee58da69559199a6096430
3
+ size 4321957088
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:d2c364f0cc700390341943250aa03153eb619be231fb7864bd2b262f0858b1dd
3
+ size 4018918624
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:d765c10d1a08e616c6fca7b6b573918765be9d1755dd4b868cc31f724da3afb9
3
+ size 3664499936
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:7c6ac467ac74f7bcbb643cf9b5eaa3c146cd23abdf6e5f59a78079e790002024
3
+ size 4661212384
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:1a99f2a38c7698270f3975bd7faeff7f24edaedd8f6c7786ece87b7a8c14fc2c
3
+ size 5130253536
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:807d672c00af74b8cfee2542da5f23bceeae4648187cda9291e3748c1a427190
3
+ size 4920734944
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:240ce7bca4cb1600b21672f93b7a56a250fc011723d33f24d1b2e231cfaabde6
3
+ size 4692669664
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:3e7060bb952d17acf4ac5823b4408961ec1340d71177af7cdecdfe5acd6970f4
3
+ size 5599294688
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:8afa9e70bf3e0469edba2bdb37b0fdd79da19e759b495ba4393faf6847cfb7c1
3
+ size 6068335840
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:99a2c3a58ee25931cef691107da77a7a9d007778c087f1a1addcb5bc3fa6d805
3
+ size 5732988128
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:d25e7ddc0888faf4f4da4be99bd31e3c524f17ae10a8ead927a5aae3eedcce87
3
+ size 5599294688
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:ebe14e90c64c3803b0ef6218e6e71da93b9532f5d3513ff95dba8d9ee17f6471
3
+ size 6596007136
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:65d74e4b37841dc1170108ddda3f5f82408d5b575940658c55aa4fac85c6a34e
3
+ size 8540771552
README.md ADDED
@@ -0,0 +1,659 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+
3
+ ---
4
+ language:
5
+ - en
6
+ license: llama3
7
+ tags:
8
+ - facebook
9
+ - meta
10
+ - pytorch
11
+ - llama
12
+ - llama-3
13
+ - GGUF
14
+ pipeline_tag: text-generation
15
+ extra_gated_prompt: "### META LLAMA 3 COMMUNITY LICENSE AGREEMENT\nMeta Llama 3 Version\
16
+ \ Release Date: April 18, 2024\n\"Agreement\" means the terms and conditions for\
17
+ \ use, reproduction, distribution and modification of the Llama Materials set forth\
18
+ \ herein.\n\"Documentation\" means the specifications, manuals and documentation\
19
+ \ accompanying Meta Llama 3 distributed by Meta at https://llama.meta.com/get-started/.\n\
20
+ \"Licensee\" or \"you\" means you, or your employer or any other person or entity\
21
+ \ (if you are entering into this Agreement on such person or entity’s behalf), of\
22
+ \ the age required under applicable laws, rules or regulations to provide legal\
23
+ \ consent and that has legal authority to bind your employer or such other person\
24
+ \ or entity if you are entering in this Agreement on their behalf.\n\"Meta Llama\
25
+ \ 3\" means the foundational large language models and software and algorithms,\
26
+ \ including machine-learning model code, trained model weights, inference-enabling\
27
+ \ code, training-enabling code, fine-tuning enabling code and other elements of\
28
+ \ the foregoing distributed by Meta at https://llama.meta.com/llama-downloads.\n\
29
+ \"Llama Materials\" means, collectively, Meta’s proprietary Meta Llama 3 and Documentation\
30
+ \ (and any portion thereof) made available under this Agreement.\n\"Meta\" or \"\
31
+ we\" means Meta Platforms Ireland Limited (if you are located in or, if you are\
32
+ \ an entity, your principal place of business is in the EEA or Switzerland) and\
33
+ \ Meta Platforms, Inc. (if you are located outside of the EEA or Switzerland).\n\
34
+ \ \n1. License Rights and Redistribution.\na. Grant of Rights. You are granted\
35
+ \ a non-exclusive, worldwide, non-transferable and royalty-free limited license\
36
+ \ under Meta’s intellectual property or other rights owned by Meta embodied in the\
37
+ \ Llama Materials to use, reproduce, distribute, copy, create derivative works of,\
38
+ \ and make modifications to the Llama Materials.\nb. Redistribution and Use.\ni.\
39
+ \ If you distribute or make available the Llama Materials (or any derivative works\
40
+ \ thereof), or a product or service that uses any of them, including another AI\
41
+ \ model, you shall (A) provide a copy of this Agreement with any such Llama Materials;\
42
+ \ and (B) prominently display “Built with Meta Llama 3” on a related website, user\
43
+ \ interface, blogpost, about page, or product documentation. If you use the Llama\
44
+ \ Materials to create, train, fine tune, or otherwise improve an AI model, which\
45
+ \ is distributed or made available, you shall also include “Llama 3” at the beginning\
46
+ \ of any such AI model name.\nii. If you receive Llama Materials, or any derivative\
47
+ \ works thereof, from a Licensee as part of an integrated end user product, then\
48
+ \ Section 2 of this Agreement will not apply to you.\niii. You must retain in all\
49
+ \ copies of the Llama Materials that you distribute the following attribution notice\
50
+ \ within a “Notice” text file distributed as a part of such copies: “Meta Llama\
51
+ \ 3 is licensed under the Meta Llama 3 Community License, Copyright © Meta Platforms,\
52
+ \ Inc. All Rights Reserved.”\niv. Your use of the Llama Materials must comply with\
53
+ \ applicable laws and regulations (including trade compliance laws and regulations)\
54
+ \ and adhere to the Acceptable Use Policy for the Llama Materials (available at\
55
+ \ https://llama.meta.com/llama3/use-policy), which is hereby incorporated by reference\
56
+ \ into this Agreement.\nv. You will not use the Llama Materials or any output or\
57
+ \ results of the Llama Materials to improve any other large language model (excluding\
58
+ \ Meta Llama 3 or derivative works thereof).\n2. Additional Commercial Terms. If,\
59
+ \ on the Meta Llama 3 version release date, the monthly active users of the products\
60
+ \ or services made available by or for Licensee, or Licensee’s affiliates, is greater\
61
+ \ than 700 million monthly active users in the preceding calendar month, you must\
62
+ \ request a license from Meta, which Meta may grant to you in its sole discretion,\
63
+ \ and you are not authorized to exercise any of the rights under this Agreement\
64
+ \ unless or until Meta otherwise expressly grants you such rights.\n3. Disclaimer\
65
+ \ of Warranty. UNLESS REQUIRED BY APPLICABLE LAW, THE LLAMA MATERIALS AND ANY OUTPUT\
66
+ \ AND RESULTS THEREFROM ARE PROVIDED ON AN “AS IS” BASIS, WITHOUT WARRANTIES OF\
67
+ \ ANY KIND, AND META DISCLAIMS ALL WARRANTIES OF ANY KIND, BOTH EXPRESS AND IMPLIED,\
68
+ \ INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY,\
69
+ \ OR FITNESS FOR A PARTICULAR PURPOSE. YOU ARE SOLELY RESPONSIBLE FOR DETERMINING\
70
+ \ THE APPROPRIATENESS OF USING OR REDISTRIBUTING THE LLAMA MATERIALS AND ASSUME\
71
+ \ ANY RISKS ASSOCIATED WITH YOUR USE OF THE LLAMA MATERIALS AND ANY OUTPUT AND RESULTS.\n\
72
+ 4. Limitation of Liability. IN NO EVENT WILL META OR ITS AFFILIATES BE LIABLE UNDER\
73
+ \ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, TORT, NEGLIGENCE, PRODUCTS LIABILITY,\
74
+ \ OR OTHERWISE, ARISING OUT OF THIS AGREEMENT, FOR ANY LOST PROFITS OR ANY INDIRECT,\
75
+ \ SPECIAL, CONSEQUENTIAL, INCIDENTAL, EXEMPLARY OR PUNITIVE DAMAGES, EVEN IF META\
76
+ \ OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF ANY OF THE FOREGOING.\n\
77
+ 5. Intellectual Property.\na. No trademark licenses are granted under this Agreement,\
78
+ \ and in connection with the Llama Materials, neither Meta nor Licensee may use\
79
+ \ any name or mark owned by or associated with the other or any of its affiliates,\
80
+ \ except as required for reasonable and customary use in describing and redistributing\
81
+ \ the Llama Materials or as set forth in this Section 5(a). Meta hereby grants you\
82
+ \ a license to use “Llama 3” (the “Mark”) solely as required to comply with the\
83
+ \ last sentence of Section 1.b.i. You will comply with Meta’s brand guidelines (currently\
84
+ \ accessible at https://about.meta.com/brand/resources/meta/company-brand/ ). All\
85
+ \ goodwill arising out of your use of the Mark will inure to the benefit of Meta.\n\
86
+ b. Subject to Meta’s ownership of Llama Materials and derivatives made by or for\
87
+ \ Meta, with respect to any derivative works and modifications of the Llama Materials\
88
+ \ that are made by you, as between you and Meta, you are and will be the owner of\
89
+ \ such derivative works and modifications.\nc. If you institute litigation or other\
90
+ \ proceedings against Meta or any entity (including a cross-claim or counterclaim\
91
+ \ in a lawsuit) alleging that the Llama Materials or Meta Llama 3 outputs or results,\
92
+ \ or any portion of any of the foregoing, constitutes infringement of intellectual\
93
+ \ property or other rights owned or licensable by you, then any licenses granted\
94
+ \ to you under this Agreement shall terminate as of the date such litigation or\
95
+ \ claim is filed or instituted. You will indemnify and hold harmless Meta from and\
96
+ \ against any claim by any third party arising out of or related to your use or\
97
+ \ distribution of the Llama Materials.\n6. Term and Termination. The term of this\
98
+ \ Agreement will commence upon your acceptance of this Agreement or access to the\
99
+ \ Llama Materials and will continue in full force and effect until terminated in\
100
+ \ accordance with the terms and conditions herein. Meta may terminate this Agreement\
101
+ \ if you are in breach of any term or condition of this Agreement. Upon termination\
102
+ \ of this Agreement, you shall delete and cease use of the Llama Materials. Sections\
103
+ \ 3, 4 and 7 shall survive the termination of this Agreement.\n7. Governing Law\
104
+ \ and Jurisdiction. This Agreement will be governed and construed under the laws\
105
+ \ of the State of California without regard to choice of law principles, and the\
106
+ \ UN Convention on Contracts for the International Sale of Goods does not apply\
107
+ \ to this Agreement. The courts of California shall have exclusive jurisdiction\
108
+ \ of any dispute arising out of this Agreement.\n### Meta Llama 3 Acceptable Use\
109
+ \ Policy\nMeta is committed to promoting safe and fair use of its tools and features,\
110
+ \ including Meta Llama 3. If you access or use Meta Llama 3, you agree to this Acceptable\
111
+ \ Use Policy (“Policy”). The most recent copy of this policy can be found at [https://llama.meta.com/llama3/use-policy](https://llama.meta.com/llama3/use-policy)\n\
112
+ #### Prohibited Uses\nWe want everyone to use Meta Llama 3 safely and responsibly.\
113
+ \ You agree you will not use, or allow others to use, Meta Llama 3 to: 1. Violate\
114
+ \ the law or others’ rights, including to:\n 1. Engage in, promote, generate,\
115
+ \ contribute to, encourage, plan, incite, or further illegal or unlawful activity\
116
+ \ or content, such as:\n 1. Violence or terrorism\n 2. Exploitation\
117
+ \ or harm to children, including the solicitation, creation, acquisition, or dissemination\
118
+ \ of child exploitative content or failure to report Child Sexual Abuse Material\n\
119
+ \ 3. Human trafficking, exploitation, and sexual violence\n 4. The\
120
+ \ illegal distribution of information or materials to minors, including obscene\
121
+ \ materials, or failure to employ legally required age-gating in connection with\
122
+ \ such information or materials.\n 5. Sexual solicitation\n 6. Any\
123
+ \ other criminal activity\n 2. Engage in, promote, incite, or facilitate the\
124
+ \ harassment, abuse, threatening, or bullying of individuals or groups of individuals\n\
125
+ \ 3. Engage in, promote, incite, or facilitate discrimination or other unlawful\
126
+ \ or harmful conduct in the provision of employment, employment benefits, credit,\
127
+ \ housing, other economic benefits, or other essential goods and services\n 4.\
128
+ \ Engage in the unauthorized or unlicensed practice of any profession including,\
129
+ \ but not limited to, financial, legal, medical/health, or related professional\
130
+ \ practices\n 5. Collect, process, disclose, generate, or infer health, demographic,\
131
+ \ or other sensitive personal or private information about individuals without rights\
132
+ \ and consents required by applicable laws\n 6. Engage in or facilitate any action\
133
+ \ or generate any content that infringes, misappropriates, or otherwise violates\
134
+ \ any third-party rights, including the outputs or results of any products or services\
135
+ \ using the Llama Materials\n 7. Create, generate, or facilitate the creation\
136
+ \ of malicious code, malware, computer viruses or do anything else that could disable,\
137
+ \ overburden, interfere with or impair the proper working, integrity, operation\
138
+ \ or appearance of a website or computer system\n2. Engage in, promote, incite,\
139
+ \ facilitate, or assist in the planning or development of activities that present\
140
+ \ a risk of death or bodily harm to individuals, including use of Meta Llama 3 related\
141
+ \ to the following:\n 1. Military, warfare, nuclear industries or applications,\
142
+ \ espionage, use for materials or activities that are subject to the International\
143
+ \ Traffic Arms Regulations (ITAR) maintained by the United States Department of\
144
+ \ State\n 2. Guns and illegal weapons (including weapon development)\n 3.\
145
+ \ Illegal drugs and regulated/controlled substances\n 4. Operation of critical\
146
+ \ infrastructure, transportation technologies, or heavy machinery\n 5. Self-harm\
147
+ \ or harm to others, including suicide, cutting, and eating disorders\n 6. Any\
148
+ \ content intended to incite or promote violence, abuse, or any infliction of bodily\
149
+ \ harm to an individual\n3. Intentionally deceive or mislead others, including use\
150
+ \ of Meta Llama 3 related to the following:\n 1. Generating, promoting, or furthering\
151
+ \ fraud or the creation or promotion of disinformation\n 2. Generating, promoting,\
152
+ \ or furthering defamatory content, including the creation of defamatory statements,\
153
+ \ images, or other content\n 3. Generating, promoting, or further distributing\
154
+ \ spam\n 4. Impersonating another individual without consent, authorization,\
155
+ \ or legal right\n 5. Representing that the use of Meta Llama 3 or outputs are\
156
+ \ human-generated\n 6. Generating or facilitating false online engagement, including\
157
+ \ fake reviews and other means of fake online engagement\n4. Fail to appropriately\
158
+ \ disclose to end users any known dangers of your AI system\nPlease report any violation\
159
+ \ of this Policy, software “bug,” or other problems that could lead to a violation\
160
+ \ of this Policy through one of the following means:\n * Reporting issues with\
161
+ \ the model: [https://github.com/meta-llama/llama3](https://github.com/meta-llama/llama3)\n\
162
+ \ * Reporting risky content generated by the model:\n developers.facebook.com/llama_output_feedback\n\
163
+ \ * Reporting bugs and security concerns: facebook.com/whitehat/info\n * Reporting\
164
+ \ violations of the Acceptable Use Policy or unlicensed uses of Meta Llama 3: LlamaUseReport@meta.com"
165
+ extra_gated_fields:
166
+ First Name: text
167
+ Last Name: text
168
+ Date of birth: date_picker
169
+ Country: country
170
+ Affiliation: text
171
+ geo: ip_location
172
+ ? By clicking Submit below I accept the terms of the license and acknowledge that
173
+ the information I provide will be collected stored processed and shared in accordance
174
+ with the Meta Privacy Policy
175
+ : checkbox
176
+ extra_gated_description: The information you provide will be collected, stored, processed
177
+ and shared in accordance with the [Meta Privacy Policy](https://www.facebook.com/privacy/policy/).
178
+ extra_gated_button_content: Submit
179
+ quantized_by: andrijdavid
180
+ ---
181
+ # Meta-Llama-Guard-2-8B-GGUF
182
+ - Original model: [Meta-Llama-Guard-2-8B](https://huggingface.co/meta-llama/Meta-Llama-Guard-2-8B)
183
+
184
+ <!-- description start -->
185
+ ## Description
186
+
187
+ This repo contains GGUF format model files for [Meta-Llama-Guard-2-8B](https://huggingface.co/meta-llama/Meta-Llama-Guard-2-8B).
188
+
189
+ <!-- description end -->
190
+ <!-- README_GGUF.md-about-gguf start -->
191
+ ### About GGUF
192
+ 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.
193
+ Here is an incomplete list of clients and libraries that are known to support GGUF:
194
+ * [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.
195
+ * [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.
196
+ * [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​
197
+ * [KoboldCpp](https://github.com/LostRuins/koboldcpp), A comprehensive web UI offering GPU acceleration across all platforms and architectures, particularly renowned for storytelling.
198
+ * [GPT4All](https://gpt4all.io), This is a free and open source GUI that runs locally, supporting Windows, Linux, and macOS with full GPU acceleration.
199
+ * [LM Studio](https://lmstudio.ai/) An intuitive and powerful local GUI for Windows and macOS (Silicon), featuring GPU acceleration.
200
+ * [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.
201
+ * [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.
202
+ * [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.
203
+ * [candle](https://github.com/huggingface/candle), A Rust-based ML framework focusing on performance, including GPU support, and designed for ease of use.
204
+ * [ctransformers](https://github.com/marella/ctransformers), A Python library featuring GPU acceleration, LangChain support, and an OpenAI-compatible AI server.
205
+ * [localGPT](https://github.com/PromtEngineer/localGPT) An open-source initiative enabling private conversations with documents.
206
+ <!-- README_GGUF.md-about-gguf end -->
207
+
208
+ <!-- compatibility_gguf start -->
209
+ ## Explanation of quantisation methods
210
+ <details>
211
+ <summary>Click to see details</summary>
212
+ The new methods available are:
213
+
214
+ * 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)
215
+ * 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.
216
+ * 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.
217
+ * GGML_TYPE_Q5_K - "type-1" 5-bit quantization. Same super-block structure as GGML_TYPE_Q4_K resulting in 5.5 bpw
218
+ * 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.
219
+ </details>
220
+ <!-- compatibility_gguf end -->
221
+
222
+ <!-- README_GGUF.md-how-to-download start -->
223
+ ## How to download GGUF files
224
+
225
+ **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.
226
+
227
+ The following clients/libraries will automatically download models for you, providing a list of available models to choose from:
228
+
229
+ * LM Studio
230
+ * LoLLMS Web UI
231
+ * Faraday.dev
232
+
233
+ ### In `text-generation-webui`
234
+
235
+ Under Download Model, you can enter the model repo: LiteLLMs/Meta-Llama-Guard-2-8B-GGUF and below it, a specific filename to download, such as: Q4_0/Q4_0-00001-of-00009.gguf.
236
+
237
+ Then click Download.
238
+
239
+ ### On the command line, including multiple files at once
240
+
241
+ I recommend using the `huggingface-hub` Python library:
242
+
243
+ ```shell
244
+ pip3 install huggingface-hub
245
+ ```
246
+
247
+ Then you can download any individual model file to the current directory, at high speed, with a command like this:
248
+
249
+ ```shell
250
+ huggingface-cli download LiteLLMs/Meta-Llama-Guard-2-8B-GGUF Q4_0/Q4_0-00001-of-00009.gguf --local-dir . --local-dir-use-symlinks False
251
+ ```
252
+
253
+ <details>
254
+ <summary>More advanced huggingface-cli download usage (click to read)</summary>
255
+
256
+ You can also download multiple files at once with a pattern:
257
+
258
+ ```shell
259
+ huggingface-cli download LiteLLMs/Meta-Llama-Guard-2-8B-GGUF --local-dir . --local-dir-use-symlinks False --include='*Q4_K*gguf'
260
+ ```
261
+
262
+ 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).
263
+
264
+ To accelerate downloads on fast connections (1Gbit/s or higher), install `hf_transfer`:
265
+
266
+ ```shell
267
+ pip3 install huggingface_hub[hf_transfer]
268
+ ```
269
+
270
+ And set environment variable `HF_HUB_ENABLE_HF_TRANSFER` to `1`:
271
+
272
+ ```shell
273
+ HF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download LiteLLMs/Meta-Llama-Guard-2-8B-GGUF Q4_0/Q4_0-00001-of-00009.gguf --local-dir . --local-dir-use-symlinks False
274
+ ```
275
+
276
+ Windows Command Line users: You can set the environment variable by running `set HF_HUB_ENABLE_HF_TRANSFER=1` before the download command.
277
+ </details>
278
+ <!-- README_GGUF.md-how-to-download end -->
279
+ <!-- README_GGUF.md-how-to-run start -->
280
+ ## Example `llama.cpp` command
281
+
282
+ Make sure you are using `llama.cpp` from commit [d0cee0d](https://github.com/ggerganov/llama.cpp/commit/d0cee0d36d5be95a0d9088b674dbb27354107221) or later.
283
+
284
+ ```shell
285
+ ./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>"
286
+ ```
287
+
288
+ Change `-ngl 32` to the number of layers to offload to GPU. Remove it if you don't have GPU acceleration.
289
+
290
+ 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.
291
+
292
+ If you want to have a chat-style conversation, replace the `-p <PROMPT>` argument with `-i -ins`
293
+
294
+ 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)
295
+
296
+ ## How to run in `text-generation-webui`
297
+
298
+ 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).
299
+
300
+ ## How to run from Python code
301
+
302
+ 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.
303
+
304
+ ### How to load this model in Python code, using llama-cpp-python
305
+
306
+ For full documentation, please see: [llama-cpp-python docs](https://abetlen.github.io/llama-cpp-python/).
307
+
308
+ #### First install the package
309
+
310
+ Run one of the following commands, according to your system:
311
+
312
+ ```shell
313
+ # Base ctransformers with no GPU acceleration
314
+ pip install llama-cpp-python
315
+ # With NVidia CUDA acceleration
316
+ CMAKE_ARGS="-DLLAMA_CUBLAS=on" pip install llama-cpp-python
317
+ # Or with OpenBLAS acceleration
318
+ CMAKE_ARGS="-DLLAMA_BLAS=ON -DLLAMA_BLAS_VENDOR=OpenBLAS" pip install llama-cpp-python
319
+ # Or with CLBLast acceleration
320
+ CMAKE_ARGS="-DLLAMA_CLBLAST=on" pip install llama-cpp-python
321
+ # Or with AMD ROCm GPU acceleration (Linux only)
322
+ CMAKE_ARGS="-DLLAMA_HIPBLAS=on" pip install llama-cpp-python
323
+ # Or with Metal GPU acceleration for macOS systems only
324
+ CMAKE_ARGS="-DLLAMA_METAL=on" pip install llama-cpp-python
325
+ # In windows, to set the variables CMAKE_ARGS in PowerShell, follow this format; eg for NVidia CUDA:
326
+ $env:CMAKE_ARGS = "-DLLAMA_OPENBLAS=on"
327
+ pip install llama-cpp-python
328
+ ```
329
+
330
+ #### Simple llama-cpp-python example code
331
+
332
+ ```python
333
+ from llama_cpp import Llama
334
+ # Set gpu_layers to the number of layers to offload to GPU. Set to 0 if no GPU acceleration is available on your system.
335
+ llm = Llama(
336
+ model_path="./Q4_0/Q4_0-00001-of-00009.gguf", # Download the model file first
337
+ n_ctx=32768, # The max sequence length to use - note that longer sequence lengths require much more resources
338
+ n_threads=8, # The number of CPU threads to use, tailor to your system and the resulting performance
339
+ n_gpu_layers=35 # The number of layers to offload to GPU, if you have GPU acceleration available
340
+ )
341
+ # Simple inference example
342
+ output = llm(
343
+ "<PROMPT>", # Prompt
344
+ max_tokens=512, # Generate up to 512 tokens
345
+ stop=["</s>"], # Example stop token - not necessarily correct for this specific model! Please check before using.
346
+ echo=True # Whether to echo the prompt
347
+ )
348
+ # Chat Completion API
349
+ 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
350
+ llm.create_chat_completion(
351
+ messages = [
352
+ {"role": "system", "content": "You are a story writing assistant."},
353
+ {
354
+ "role": "user",
355
+ "content": "Write a story about llamas."
356
+ }
357
+ ]
358
+ )
359
+ ```
360
+
361
+ ## How to use with LangChain
362
+
363
+ Here are guides on using llama-cpp-python and ctransformers with LangChain:
364
+
365
+ * [LangChain + llama-cpp-python](https://python.langchain.com/docs/integrations/llms/llamacpp)
366
+ * [LangChain + ctransformers](https://python.langchain.com/docs/integrations/providers/ctransformers)
367
+
368
+ <!-- README_GGUF.md-how-to-run end -->
369
+
370
+ <!-- footer end -->
371
+
372
+ <!-- original-model-card start -->
373
+ # Original model card: Meta-Llama-Guard-2-8B
374
+
375
+
376
+ # Model Details
377
+
378
+ Meta Llama Guard 2 is an 8B parameter Llama 3-based [1] LLM safeguard model. Similar to [Llama Guard](https://ai.meta.com/research/publications/llama-guard-llm-based-input-output-safeguard-for-human-ai-conversations/), it can be used for classifying content in both LLM inputs (prompt classification) and in LLM responses (response classification). It acts as an LLM – it generates text in its output that indicates whether a given prompt or response is safe or unsafe, and if unsafe, it also lists the content categories violated.
379
+ Below is a response classification example input and output for Llama Guard 2.
380
+
381
+ <p align="center">
382
+ <img src="https://github.com/facebookresearch/PurpleLlama/raw/main/Llama-Guard2/llamaguard_example.png" width="800"/>
383
+ </p>
384
+
385
+ In order to produce classifier scores, we look at the probability for the first token, and use that as the “unsafe” class probability. We can then apply score thresholding to make binary decisions.
386
+
387
+ # Harm Taxonomy and Policy
388
+
389
+ The model is trained to predict safety labels on the 11 categories shown below, based on the [MLCommons taxonomy](https://mlcommons.org/2024/04/mlc-aisafety-v0-5-poc/) of hazards.
390
+ <table align="center">
391
+ <thead>
392
+ <tr>
393
+ <th colspan="2">Harm categories</th>
394
+ </tr>
395
+ </thead>
396
+ <tbody>
397
+ <tr>
398
+ <td>S1: Violent Crimes</td>
399
+ <td>S2: Non-Violent Crimes</td>
400
+ </tr>
401
+ <tr>
402
+ <td>S3: Sex-Related Crimes</td>
403
+ <td>S4: Child Sexual Exploitation</td>
404
+ </tr>
405
+ <tr>
406
+ <td>S5: Specialized Advice</td>
407
+ <td>S6: Privacy</td>
408
+ </tr>
409
+ <tr>
410
+ <td>S7: Intellectual Property</td>
411
+ <td>S8: Indiscriminate Weapons </td>
412
+ </tr>
413
+ <tr>
414
+ <td>S9: Hate</td>
415
+ <td>S10: Suicide &amp; Self-Harm</td>
416
+ </tr>
417
+ <tr>
418
+ <td>S11: Sexual Content</td>
419
+ <td></td>
420
+ </tr>
421
+ </tbody>
422
+ </table>
423
+
424
+ **S1: Violent Crimes**
425
+
426
+ Responses that enable, encourage, or endorse the commission of violent crimes, including: (1) unlawful violence toward people (ex: terrorism, genocide, murder, hate-motivated violent crimes, child abuse, assault, battery, kidnapping) and (2) unlawful violence toward animals (ex: animal abuse)
427
+
428
+ **S2: Non-Violent Crimes**
429
+
430
+ Responses that enable, encourage, or endorse the commission of non-violent crimes, including: (1) personal crimes (ex: labor trafficking, threats, intimidation, hate-motivated non-violent crimes), (2) financial crimes (ex: fraud, scams, money laundering), (3) property crimes (ex: theft, arson, vandalism), (4) drug crimes (ex: creating or using regulated substances), (5) weapons crimes (ex: producing unlicensed firearms), and (6) cyber crimes (ex: hacking)
431
+
432
+ **S3: Sex-Related Crimes**
433
+
434
+ Responses that enable, encourage, or endorse the commission of sex-related crimes, including: (1) sex trafficking, (2) sexual assault (ex: rape), (3) sexual harassment (physical, verbal, or visual), and (4) prostitution
435
+
436
+ **S4: Child Sexual Exploitation**
437
+
438
+ Responses that contain, describe, enable, encourage, or endorse the sexual abuse of children
439
+
440
+ **S5: Specialized Advice**
441
+
442
+ Responses that contain specialized financial, medical, or legal advice, or that indicate dangerous activities or objects are safe
443
+
444
+ **S6: Privacy**
445
+
446
+ Responses that contain sensitive, nonpublic personal information that could undermine someone's physical, digital, or financial security
447
+
448
+ **S7: Intellectual Property**
449
+
450
+ Responses that may violate the intellectual property rights of any third party
451
+
452
+ **S8: Indiscriminate Weapons**
453
+
454
+ Responses that enable, encourage, or endorse the creation of indiscriminate weapons, including: (1) chemical weapons (ex: nerve gas), (2) biological weapons (ex: anthrax), (3) radiological weapons (ex: cobalt bombs), (4) nuclear weapons (ex: fission bombs), and (5) high-yield explosive weapons (ex: cluster munitions)
455
+
456
+ **S9: Hate**
457
+
458
+ Responses that demean or dehumanize people on the basis of their sensitive, personal characteristics (i.e., race, color, ethnicity, national origin, disability, religious affiliation, caste, sexual orientation, sex, gender identity, and/or serious disease)
459
+
460
+ **S10: Suicide & Self-Harm**
461
+
462
+ Responses that enable, encourage, or endorse acts of intentional self-harm, including: (1) suicide, (2) self-injury (ex: cutting), and (3) disordered eating
463
+
464
+ **S11: Sexual Content**
465
+
466
+ Responses that contain erotica
467
+
468
+
469
+ ## How to Use in `transformers`
470
+
471
+ ```py
472
+ from transformers import AutoTokenizer, AutoModelForCausalLM
473
+ import torch
474
+
475
+ model_id = "meta-llama/Meta-Llama-Guard-2-8B"
476
+ device = "cuda"
477
+ dtype = torch.bfloat16
478
+
479
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
480
+ model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=dtype, device_map=device)
481
+
482
+ def moderate(chat):
483
+ input_ids = tokenizer.apply_chat_template(chat, return_tensors="pt").to(device)
484
+ output = model.generate(input_ids=input_ids, max_new_tokens=100, pad_token_id=0)
485
+ prompt_len = input_ids.shape[-1]
486
+ return tokenizer.decode(output[0][prompt_len:], skip_special_tokens=True)
487
+
488
+ moderate([
489
+ {"role": "user", "content": "I forgot how to kill a process in Linux, can you help?"},
490
+ {"role": "assistant", "content": "Sure! To kill a process in Linux, you can use the kill command followed by the process ID (PID) of the process you want to terminate."},
491
+ ])
492
+ # `safe`
493
+ ```
494
+
495
+
496
+ # Training and Evaluation Data
497
+
498
+ We start with the training set of Llama Guard (see [model card](https://github.com/meta-llama/PurpleLlama/blob/main/Llama-Guard/MODEL_CARD.md#training-data)), and obtain labels on the Harm Taxonomy described above. To improve adaptability of the model to different prompts, we train on hard samples, which are obtained by taking an existing sample and prompting Llama2 70B to produce an alternate policy description that will flip the label of the given sample.
499
+
500
+ We report metrics for various models and APIs on our validation set, which is obtained from combining the validation set of Llama Guard v1 and held-out samples from the additional Llama 3 safety data.
501
+
502
+ We compare performance on our internal test set, as well as on open datasets like [XSTest](https://github.com/paul-rottger/exaggerated-safety?tab=readme-ov-file#license), [OpenAI moderation](https://github.com/openai/moderation-api-release), and [BeaverTails](https://github.com/PKU-Alignment/beavertails).
503
+
504
+ We find that there is overlap between our training set and the BeaverTails-30k test split. Since both our internal test set and BeaverTails use prompts from the Anthropic's [hh-rlhf dataset](https://github.com/anthropics/hh-rlhf) as a starting point for curating data, it is possible that different splits of Anthropic were used while creating the two datasets. Therefore to prevent leakage of signal between our train set and the BeaverTails-30k test set, we create our own BeaverTails-30k splits based on the Anthropic train-test splits used for creating our internal sets.
505
+
506
+ *Note on evaluations*: As discussed in the Llama Guard [paper](https://arxiv.org/abs/2312.06674), comparing model performance is not straightforward as each model is built on its own policy and is expected to perform better on an evaluation dataset with a policy aligned to the model. This highlights the need for industry standards. By aligning Llama Guard 2 with the Proof of Concept MLCommons taxonomy, we hope to drive adoption of industry standards like this and facilitate collaboration and transparency in the LLM safety and content evaluation space.
507
+
508
+ # Model Performance
509
+
510
+ We evaluate the performance of Llama Guard 2 and compare it with Llama Guard and popular content moderation APIs such as Azure, OpenAI Moderation, and Perspective. We use the token probability of the first output token (i.e. safe/unsafe) as the score for classification. For obtaining a binary classification decision from the score, we use a threshold of 0.5.
511
+
512
+ Llama Guard 2 improves over Llama Guard, and outperforms other approaches on our internal test set. Note that we manage to achieve great performance while keeping a low false positive rate as we know that over-moderation can impact user experience when building LLM-applications.
513
+ <div align="center">
514
+
515
+ | **Model** | **F1 ↑** | **AUPRC ↑** | **False Positive<br>Rate ↓** |
516
+ | | :--: | :--: | :--: |
517
+ | Llama Guard\* | 0.665 | <ins>0.854</ins> | 0.027 |
518
+ | Llama Guard 2 | **0.915** | **0.974** | 0.040 |
519
+ | GPT4 | <ins>0.796</ins> | N/A | 0.151 |
520
+ | OpenAI Moderation API | 0.347 | 0.669 | 0.030 |
521
+ | Azure Content Safety API | 0.519 | N/A | 0.245 |
522
+ | Perspective API | 0.265 | 0.586 | 0.046 |
523
+
524
+
525
+ <small> Table 1: Comparison of performance of various approaches measured on our internal test set.
526
+ <br><small><small>
527
+ *The performance of Llama Guard is lower on our new test set due to expansion of the number of harm categories from 6 to 11, which is not aligned to what Llama Guard was trained on.
528
+ </small></small></small>
529
+ </div>
530
+
531
+ <br>
532
+
533
+ <div align="center">
534
+
535
+ | **Category** | **False Negative Rate\* ↓** | **False Positive Rate ↓** |
536
+ | --: |
537
+ | Violent Crimes | 0.042 | 0.002 |
538
+ | Privacy | 0.057 | 0.004 |
539
+ | Non-Violent Crimes | 0.082 | 0.009 |
540
+ | Intellectual Property | 0.099 | 0.004 |
541
+ | Hate | 0.190 | 0.005 |
542
+ | Specialized Advice | 0.192 | 0.009 |
543
+ | Sexual Content | 0.229 | 0.004 |
544
+ | Indiscriminate Weapons | 0.263 | 0.001 |
545
+ | Child Exploitation | 0.267 | 0.000 |
546
+ | Sex Crimes | 0.275 | 0.002 |
547
+ | Self-Harm | 0.277 | 0.002 |
548
+
549
+
550
+
551
+ <small> Table 2: Category-wise breakdown of false negative rate and false positive rate for Llama Guard 2 on our internal benchmark for response classification with safety labels from the ML Commons taxonomy.<br><small><small>*The binary safe/unsafe label is used to compute categorical FNR by using the true categories. We do not penalize the model while computing FNR for cases where the model predicts the correct overall label but an incorrect categorical label.</small></small></small>
552
+
553
+ </div>
554
+
555
+ We also report performance on OSS safety datasets, though we note that the policy used for assigning safety labels is not aligned with the policy used while training Llama Guard 2. Still, Llama Guard 2 provides a superior tradeoff between f1 score and False Positive Rate on the XSTest and OpenAI Moderation datasets, demonstrating good adaptability to other policies.
556
+
557
+ The BeaverTails dataset has a lower bar for a sample to be considered unsafe compared to Llama Guard 2's policy. The policy and training data of MDJudge [4] is more aligned with this dataset and we see that it performs better on them as expected (at the cost of a higher FPR). GPT-4 achieves high recall on all of the sets but at the cost of very high FPR (9-25%), which could hurt its ability to be used as a safeguard for practical applications.
558
+
559
+ <table align="center">
560
+ <thead>
561
+ <tr>
562
+ <th></th>
563
+ <th colspan="3">(F1 ↑ / False Positive Rate ↓)</th>
564
+ </tr>
565
+ </thead>
566
+ <tbody>
567
+ <tr>
568
+ <td></td>
569
+ <td><center>False Refusals<br>(XSTest)</center></td>
570
+ <td><center>OpenAI policy<br>(OpenAI Mod)</center></td>
571
+ <td><center>BeaverTails policy<br>(BeaverTails-30k)</center></td>
572
+ </tr>
573
+ <tr>
574
+ <td>Llama Guard</td>
575
+ <td>0.737 / 0.079</td>
576
+ <td>0.737 / 0.079</td>
577
+ <td>0.599 / 0.035</td>
578
+ </tr>
579
+ <tr>
580
+ <td>Llama Guard 2</td>
581
+ <td>0.884 / 0.084</td>
582
+ <td>0.807 / 0.060</td>
583
+ <td>0.736 / 0.059</td>
584
+ </tr>
585
+ <tr>
586
+ <td>MDJudge</td>
587
+ <td>0.856 / 0.172</td>
588
+ <td>0.768 / 0.212</td>
589
+ <td>0.849 / 0.098</td>
590
+ </tr>
591
+ <tr>
592
+ <td>GPT4</td>
593
+ <td>0.895 / 0.128</td>
594
+ <td>0.842 / 0.092</td>
595
+ <td>0.802 / 0.256</td>
596
+ </tr>
597
+ <tr>
598
+ <td>OpenAI Mod API</td>
599
+ <td>0.576 / 0.040</td>
600
+ <td>0.788 / 0.156</td>
601
+ <td>0.284 / 0.056</td>
602
+ </tr>
603
+ </tbody>
604
+ </table>
605
+
606
+ <div align="center">
607
+ <small>Table 3: Comparison of performance of various approaches measured on our internal test set for response classification. <br>NOTE: The policy used for training Llama Guard does not align with those used for labeling these datasets. Still, Llama Guard 2 provides a superior tradeoff between F1 score and False Positive Rate across these datasets, demonstrating strong adaptability to other policies.</small>
608
+ </div>
609
+ <br>
610
+ We hope to provide developers with a high-performing moderation solution for most use cases by aligning Llama Guard 2 taxonomy with MLCommons standard. But as outlined in our Responsible Use Guide, each use case requires specific safety considerations and we encourage developers to tune Llama Guard 2 for their own use case to achieve better moderation for their custom policies. As an example of how Llama Guard 2's performance may change, we train on the BeaverTails training dataset and compare against MDJudge (which was trained on BeaverTails among others).
611
+
612
+
613
+ <div align="center">
614
+ <br>
615
+
616
+ | **Model** | **F1 ↑** | **False Positive Rate ↓** |
617
+ | :-: | :--: | :-----: |
618
+ | Llama Guard 2 | 0.736 | 0.059 |
619
+ | MDJudge | <ins>0.849</ins> | 0.098 |
620
+ | Llama Guard 2 + BeaverTails | **0.852** | 0.101 |
621
+
622
+
623
+ <small>Table 4: Comparison of performance on BeaverTails-30k.</small>
624
+ </div>
625
+
626
+ # Limitations
627
+
628
+ There are some limitations associated with Llama Guard 2. First, Llama Guard 2 itself is an LLM fine-tuned on Llama 3. Thus, its performance (e.g., judgments that need common sense knowledge, multilingual capability, and policy coverage) might be limited by its (pre-)training data.
629
+
630
+ Second, Llama Guard 2 is finetuned for safety classification only (i.e. to generate "safe" or "unsafe"), and is not designed for chat use cases. However, since it is an LLM, it can still be prompted with any text to obtain a completion.
631
+
632
+ Lastly, as an LLM, Llama Guard 2 may be susceptible to adversarial attacks or prompt injection attacks that could bypass or alter its intended use. However, with the help of external components (e.g., KNN, perplexity filter), recent work (e.g., [3]) demonstrates that Llama Guard is able to detect harmful content reliably.
633
+
634
+ **Note on Llama Guard 2's policy**
635
+
636
+ Llama Guard 2 supports 11 out of the 13 categories included in the [MLCommons AI Safety](https://mlcommons.org/working-groups/ai-safety/ai-safety/) taxonomy. The Election and Defamation categories are not addressed by Llama Guard 2 as moderating these harm categories requires access to up-to-date, factual information sources and the ability to determine the veracity of a particular output. To support the additional categories, we recommend using other solutions (e.g. Retrieval Augmented Generation) in tandem with Llama Guard 2 to evaluate information correctness.
637
+
638
+ # Citation
639
+
640
+ ```
641
+ @misc{metallamaguard2,
642
+ author = {Llama Team},
643
+ title = {Meta Llama Guard 2},
644
+ howpublished = {\url{https://github.com/meta-llama/PurpleLlama/blob/main/Llama-Guard2/MODEL_CARD.md}},
645
+ year = {2024}
646
+ }
647
+ ```
648
+
649
+ # References
650
+
651
+ [1] [Llama 3 Model Card](https://github.com/meta-llama/llama3/blob)
652
+
653
+ [2] [Llama Guard Model Card](https://github.com/meta-llama/PurpleLlama/blob/main/Llama-Guard/MODEL_CARD.md)
654
+
655
+ [3] [RigorLLM: Resilient Guardrails for Large Language Models against Undesired Content](https://arxiv.org/pdf/2403.13031.pdf)
656
+
657
+ [4] [MDJudge for Salad-Bench](https://huggingface.co/OpenSafetyLab/MD-Judge-v0.1)
658
+
659
+ <!-- original-model-card end -->