Upload folder using huggingface_hub
Browse files- .DS_Store +0 -0
- .gitattributes +1 -0
- LICENSE +114 -0
- Llama-3.1-8B-Instruct-LegalCite-q4_k.gguf +3 -0
- Modelfile +224 -0
- README.md +175 -0
.DS_Store
ADDED
Binary file (6.15 kB). View file
|
|
.gitattributes
CHANGED
@@ -33,3 +33,4 @@ 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 |
+
Llama-3.1-8B-Instruct-LegalCite-q4_k.gguf filter=lfs diff=lfs merge=lfs -text
|
LICENSE
ADDED
@@ -0,0 +1,114 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
LLAMA 3.1 COMMUNITY LICENSE AGREEMENT
|
2 |
+
Llama 3.1 Version Release Date: July 23, 2024
|
3 |
+
|
4 |
+
βAgreementβ means the terms and conditions for use, reproduction, distribution and modification of the
|
5 |
+
Llama Materials set forth herein.
|
6 |
+
|
7 |
+
βDocumentationβ means the specifications, manuals and documentation accompanying Llama 3.1
|
8 |
+
distributed by Meta at https://llama.meta.com/doc/overview.
|
9 |
+
|
10 |
+
βLicenseeβ or βyouβ means you, or your employer or any other person or entity (if you are entering into
|
11 |
+
this Agreement on such person or entityβs behalf), of the age required under applicable laws, rules or
|
12 |
+
regulations to provide legal consent and that has legal authority to bind your employer or such other
|
13 |
+
person or entity if you are entering in this Agreement on their behalf.
|
14 |
+
|
15 |
+
βLlama 3.1β means the foundational large language models and software and algorithms, including
|
16 |
+
machine-learning model code, trained model weights, inference-enabling code, training-enabling code,
|
17 |
+
fine-tuning enabling code and other elements of the foregoing distributed by Meta at
|
18 |
+
https://llama.meta.com/llama-downloads.
|
19 |
+
|
20 |
+
βLlama Materialsβ means, collectively, Metaβs proprietary Llama 3.1 and Documentation (and any
|
21 |
+
portion thereof) made available under this Agreement.
|
22 |
+
|
23 |
+
βMetaβ or βweβ means Meta Platforms Ireland Limited (if you are located in or, if you are an entity, your
|
24 |
+
principal place of business is in the EEA or Switzerland) and Meta Platforms, Inc. (if you are located
|
25 |
+
outside of the EEA or Switzerland).
|
26 |
+
|
27 |
+
By clicking βI Acceptβ below or by using or distributing any portion or element of the Llama Materials,
|
28 |
+
you agree to be bound by this Agreement.
|
29 |
+
|
30 |
+
1. License Rights and Redistribution.
|
31 |
+
|
32 |
+
a. Grant of Rights. You are granted a non-exclusive, worldwide, non-transferable and royalty-free
|
33 |
+
limited license under Metaβs intellectual property or other rights owned by Meta embodied in the Llama
|
34 |
+
Materials to use, reproduce, distribute, copy, create derivative works of, and make modifications to the
|
35 |
+
Llama Materials.
|
36 |
+
|
37 |
+
b. Redistribution and Use.
|
38 |
+
|
39 |
+
i. If you distribute or make available the Llama Materials (or any derivative works
|
40 |
+
thereof), or a product or service (including another AI model) that contains any of them, you shall (A)
|
41 |
+
provide a copy of this Agreement with any such Llama Materials; and (B) prominently display βBuilt with
|
42 |
+
Llamaβ on a related website, user interface, blogpost, about page, or product documentation. If you use
|
43 |
+
the Llama Materials or any outputs or results of the Llama Materials to create, train, fine tune, or
|
44 |
+
otherwise improve an AI model, which is distributed or made available, you shall also include βLlamaβ at
|
45 |
+
the beginning of any such AI model name.
|
46 |
+
|
47 |
+
ii. If you receive Llama Materials, or any derivative works thereof, from a Licensee as part
|
48 |
+
of an integrated end user product, then Section 2 of this Agreement will not apply to you.
|
49 |
+
|
50 |
+
iii. You must retain in all copies of the Llama Materials that you distribute the following
|
51 |
+
attribution notice within a βNoticeβ text file distributed as a part of such copies: βLlama 3.1 is
|
52 |
+
licensed under the Llama 3.1 Community License, Copyright Β© Meta Platforms, Inc. All Rights
|
53 |
+
Reserved.β
|
54 |
+
|
55 |
+
iv. Your use of the Llama Materials must comply with applicable laws and regulations
|
56 |
+
(including trade compliance laws and regulations) and adhere to the Acceptable Use Policy for the Llama
|
57 |
+
Materials (available at https://llama.meta.com/llama3_1/use-policy), which is hereby incorporated by
|
58 |
+
reference into this Agreement.
|
59 |
+
|
60 |
+
2. Additional Commercial Terms. If, on the Llama 3.1 version release date, the monthly active users
|
61 |
+
of the products or services made available by or for Licensee, or Licenseeβs affiliates, is greater than 700
|
62 |
+
million monthly active users in the preceding calendar month, you must request a license from Meta,
|
63 |
+
which Meta may grant to you in its sole discretion, and you are not authorized to exercise any of the
|
64 |
+
rights under this Agreement unless or until Meta otherwise expressly grants you such rights.
|
65 |
+
|
66 |
+
3. Disclaimer of Warranty. UNLESS REQUIRED BY APPLICABLE LAW, THE LLAMA MATERIALS AND ANY
|
67 |
+
OUTPUT AND RESULTS THEREFROM ARE PROVIDED ON AN βAS ISβ BASIS, WITHOUT WARRANTIES OF
|
68 |
+
ANY KIND, AND META DISCLAIMS ALL WARRANTIES OF ANY KIND, BOTH EXPRESS AND IMPLIED,
|
69 |
+
INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OF TITLE, NON-INFRINGEMENT,
|
70 |
+
MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. YOU ARE SOLELY RESPONSIBLE FOR
|
71 |
+
DETERMINING THE APPROPRIATENESS OF USING OR REDISTRIBUTING THE LLAMA MATERIALS AND
|
72 |
+
ASSUME ANY RISKS ASSOCIATED WITH YOUR USE OF THE LLAMA MATERIALS AND ANY OUTPUT AND
|
73 |
+
RESULTS.
|
74 |
+
|
75 |
+
4. Limitation of Liability. IN NO EVENT WILL META OR ITS AFFILIATES BE LIABLE UNDER ANY THEORY OF
|
76 |
+
LIABILITY, WHETHER IN CONTRACT, TORT, NEGLIGENCE, PRODUCTS LIABILITY, OR OTHERWISE, ARISING
|
77 |
+
OUT OF THIS AGREEMENT, FOR ANY LOST PROFITS OR ANY INDIRECT, SPECIAL, CONSEQUENTIAL,
|
78 |
+
INCIDENTAL, EXEMPLARY OR PUNITIVE DAMAGES, EVEN IF META OR ITS AFFILIATES HAVE BEEN ADVISED
|
79 |
+
OF THE POSSIBILITY OF ANY OF THE FOREGOING.
|
80 |
+
|
81 |
+
5. Intellectual Property.
|
82 |
+
|
83 |
+
a. No trademark licenses are granted under this Agreement, and in connection with the Llama
|
84 |
+
Materials, neither Meta nor Licensee may use any name or mark owned by or associated with the other
|
85 |
+
or any of its affiliates, except as required for reasonable and customary use in describing and
|
86 |
+
redistributing the Llama Materials or as set forth in this Section 5(a). Meta hereby grants you a license to
|
87 |
+
use βLlamaβ (the βMarkβ) solely as required to comply with the last sentence of Section 1.b.i. You will
|
88 |
+
comply with Metaβs brand guidelines (currently accessible at
|
89 |
+
https://about.meta.com/brand/resources/meta/company-brand/ ). All goodwill arising out of your use
|
90 |
+
of the Mark will inure to the benefit of Meta.
|
91 |
+
|
92 |
+
b. Subject to Metaβs ownership of Llama Materials and derivatives made by or for Meta, with
|
93 |
+
respect to any derivative works and modifications of the Llama Materials that are made by you, as
|
94 |
+
between you and Meta, you are and will be the owner of such derivative works and modifications.
|
95 |
+
|
96 |
+
c. If you institute litigation or other proceedings against Meta or any entity (including a
|
97 |
+
cross-claim or counterclaim in a lawsuit) alleging that the Llama Materials or Llama 3.1 outputs or
|
98 |
+
results, or any portion of any of the foregoing, constitutes infringement of intellectual property or other
|
99 |
+
rights owned or licensable by you, then any licenses granted to you under this Agreement shall
|
100 |
+
terminate as of the date such litigation or claim is filed or instituted. You will indemnify and hold
|
101 |
+
harmless Meta from and against any claim by any third party arising out of or related to your use or
|
102 |
+
distribution of the Llama Materials.
|
103 |
+
|
104 |
+
6. Term and Termination. The term of this Agreement will commence upon your acceptance of this
|
105 |
+
Agreement or access to the Llama Materials and will continue in full force and effect until terminated in
|
106 |
+
accordance with the terms and conditions herein. Meta may terminate this Agreement if you are in
|
107 |
+
breach of any term or condition of this Agreement. Upon termination of this Agreement, you shall delete
|
108 |
+
and cease use of the Llama Materials. Sections 3, 4 and 7 shall survive the termination of this
|
109 |
+
Agreement.
|
110 |
+
|
111 |
+
7. Governing Law and Jurisdiction. This Agreement will be governed and construed under the laws of
|
112 |
+
the State of California without regard to choice of law principles, and the UN Convention on Contracts
|
113 |
+
for the International Sale of Goods does not apply to this Agreement. The courts of California shall have
|
114 |
+
exclusive jurisdiction of any dispute arising out of this Agreement.
|
Llama-3.1-8B-Instruct-LegalCite-q4_k.gguf
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1a96c0724c025482cc5a6fb18246e1431ba2be1ef4fb790c8fd4e63a0ca2ab09
|
3 |
+
size 4920739200
|
Modelfile
ADDED
@@ -0,0 +1,224 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Modelfile generated by "ollama show"
|
2 |
+
# To build a new Modelfile based on this, replace FROM with:
|
3 |
+
# FROM <your model>
|
4 |
+
|
5 |
+
FROM seasparks/Llama-3.1-8B-Instruct-LegalCite-gguf
|
6 |
+
MODEL Llama-3.1-8B-Instruct-LegalCite-q4_k.gguf
|
7 |
+
TEMPLATE """{{- if or .System .Tools }}<|start_header_id|>system<|end_header_id|>
|
8 |
+
{{- if .System }}
|
9 |
+
|
10 |
+
{{ .System }}
|
11 |
+
{{- end }}
|
12 |
+
{{- if .Tools }}
|
13 |
+
|
14 |
+
Cutting Knowledge Date: December 2023
|
15 |
+
|
16 |
+
When you receive a tool call response, use the output to format an answer to the orginal user question.
|
17 |
+
|
18 |
+
You are a helpful assistant with tool calling capabilities.
|
19 |
+
{{- end }}<|eot_id|>
|
20 |
+
{{- end }}
|
21 |
+
{{- range $i, $_ := .Messages }}
|
22 |
+
{{- $last := eq (len (slice $.Messages $i)) 1 }}
|
23 |
+
{{- if eq .Role "user" }}<|start_header_id|>user<|end_header_id|>
|
24 |
+
{{- if and $.Tools $last }}
|
25 |
+
|
26 |
+
Given the following functions, please respond with a JSON for a function call with its proper arguments that best answers the given prompt.
|
27 |
+
|
28 |
+
Respond in the format {"name": function name, "parameters": dictionary of argument name and its value}. Do not use variables.
|
29 |
+
|
30 |
+
{{ range $.Tools }}
|
31 |
+
{{- . }}
|
32 |
+
{{ end }}
|
33 |
+
Question: {{ .Content }}<|eot_id|>
|
34 |
+
{{- else }}
|
35 |
+
|
36 |
+
{{ .Content }}<|eot_id|>
|
37 |
+
{{- end }}{{ if $last }}<|start_header_id|>assistant<|end_header_id|>
|
38 |
+
|
39 |
+
{{ end }}
|
40 |
+
{{- else if eq .Role "assistant" }}<|start_header_id|>assistant<|end_header_id|>
|
41 |
+
{{- if .ToolCalls }}
|
42 |
+
{{ range .ToolCalls }}
|
43 |
+
{"name": "{{ .Function.Name }}", "parameters": {{ .Function.Arguments }}}{{ end }}
|
44 |
+
{{- else }}
|
45 |
+
|
46 |
+
{{ .Content }}
|
47 |
+
{{- end }}{{ if not $last }}<|eot_id|>{{ end }}
|
48 |
+
{{- else if eq .Role "tool" }}<|start_header_id|>ipython<|end_header_id|>
|
49 |
+
|
50 |
+
{{ .Content }}<|eot_id|>{{ if $last }}<|start_header_id|>assistant<|end_header_id|>
|
51 |
+
|
52 |
+
{{ end }}
|
53 |
+
{{- end }}
|
54 |
+
{{- end }}"""
|
55 |
+
PARAMETER stop <|start_header_id|>
|
56 |
+
PARAMETER stop <|end_header_id|>
|
57 |
+
PARAMETER stop <|eot_id|>
|
58 |
+
LICENSE "LLAMA 3.1 COMMUNITY LICENSE AGREEMENT
|
59 |
+
Llama 3.1 Version Release Date: July 23, 2024
|
60 |
+
|
61 |
+
βAgreementβ means the terms and conditions for use, reproduction, distribution and modification of the
|
62 |
+
Llama Materials set forth herein.
|
63 |
+
|
64 |
+
βDocumentationβ means the specifications, manuals and documentation accompanying Llama 3.1
|
65 |
+
distributed by Meta at https://llama.meta.com/doc/overview.
|
66 |
+
|
67 |
+
βLicenseeβ or βyouβ means you, or your employer or any other person or entity (if you are entering into
|
68 |
+
this Agreement on such person or entityβs behalf), of the age required under applicable laws, rules or
|
69 |
+
regulations to provide legal consent and that has legal authority to bind your employer or such other
|
70 |
+
person or entity if you are entering in this Agreement on their behalf.
|
71 |
+
|
72 |
+
βLlama 3.1β means the foundational large language models and software and algorithms, including
|
73 |
+
machine-learning model code, trained model weights, inference-enabling code, training-enabling code,
|
74 |
+
fine-tuning enabling code and other elements of the foregoing distributed by Meta at
|
75 |
+
https://llama.meta.com/llama-downloads.
|
76 |
+
|
77 |
+
βLlama Materialsβ means, collectively, Metaβs proprietary Llama 3.1 and Documentation (and any
|
78 |
+
portion thereof) made available under this Agreement.
|
79 |
+
|
80 |
+
βMetaβ or βweβ means Meta Platforms Ireland Limited (if you are located in or, if you are an entity, your
|
81 |
+
principal place of business is in the EEA or Switzerland) and Meta Platforms, Inc. (if you are located
|
82 |
+
outside of the EEA or Switzerland).
|
83 |
+
|
84 |
+
By clicking βI Acceptβ below or by using or distributing any portion or element of the Llama Materials,
|
85 |
+
you agree to be bound by this Agreement.
|
86 |
+
|
87 |
+
1. License Rights and Redistribution.
|
88 |
+
|
89 |
+
a. Grant of Rights. You are granted a non-exclusive, worldwide, non-transferable and royalty-free
|
90 |
+
limited license under Metaβs intellectual property or other rights owned by Meta embodied in the Llama
|
91 |
+
Materials to use, reproduce, distribute, copy, create derivative works of, and make modifications to the
|
92 |
+
Llama Materials.
|
93 |
+
|
94 |
+
b. Redistribution and Use.
|
95 |
+
|
96 |
+
i. If you distribute or make available the Llama Materials (or any derivative works
|
97 |
+
thereof), or a product or service (including another AI model) that contains any of them, you shall (A)
|
98 |
+
provide a copy of this Agreement with any such Llama Materials; and (B) prominently display βBuilt with
|
99 |
+
Llamaβ on a related website, user interface, blogpost, about page, or product documentation. If you use
|
100 |
+
the Llama Materials or any outputs or results of the Llama Materials to create, train, fine tune, or
|
101 |
+
otherwise improve an AI model, which is distributed or made available, you shall also include βLlamaβ at
|
102 |
+
the beginning of any such AI model name.
|
103 |
+
|
104 |
+
ii. If you receive Llama Materials, or any derivative works thereof, from a Licensee as part
|
105 |
+
of an integrated end user product, then Section 2 of this Agreement will not apply to you.
|
106 |
+
|
107 |
+
iii. You must retain in all copies of the Llama Materials that you distribute the following
|
108 |
+
attribution notice within a βNoticeβ text file distributed as a part of such copies: βLlama 3.1 is
|
109 |
+
licensed under the Llama 3.1 Community License, Copyright Β© Meta Platforms, Inc. All Rights
|
110 |
+
Reserved.β
|
111 |
+
|
112 |
+
iv. Your use of the Llama Materials must comply with applicable laws and regulations
|
113 |
+
(including trade compliance laws and regulations) and adhere to the Acceptable Use Policy for the Llama
|
114 |
+
Materials (available at https://llama.meta.com/llama3_1/use-policy), which is hereby incorporated by
|
115 |
+
reference into this Agreement.
|
116 |
+
|
117 |
+
2. Additional Commercial Terms. If, on the Llama 3.1 version release date, the monthly active users
|
118 |
+
of the products or services made available by or for Licensee, or Licenseeβs affiliates, is greater than 700
|
119 |
+
million monthly active users in the preceding calendar month, you must request a license from Meta,
|
120 |
+
which Meta may grant to you in its sole discretion, and you are not authorized to exercise any of the
|
121 |
+
rights under this Agreement unless or until Meta otherwise expressly grants you such rights.
|
122 |
+
|
123 |
+
3. Disclaimer of Warranty. UNLESS REQUIRED BY APPLICABLE LAW, THE LLAMA MATERIALS AND ANY
|
124 |
+
OUTPUT AND RESULTS THEREFROM ARE PROVIDED ON AN βAS ISβ BASIS, WITHOUT WARRANTIES OF
|
125 |
+
ANY KIND, AND META DISCLAIMS ALL WARRANTIES OF ANY KIND, BOTH EXPRESS AND IMPLIED,
|
126 |
+
INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OF TITLE, NON-INFRINGEMENT,
|
127 |
+
MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. YOU ARE SOLELY RESPONSIBLE FOR
|
128 |
+
DETERMINING THE APPROPRIATENESS OF USING OR REDISTRIBUTING THE LLAMA MATERIALS AND
|
129 |
+
ASSUME ANY RISKS ASSOCIATED WITH YOUR USE OF THE LLAMA MATERIALS AND ANY OUTPUT AND
|
130 |
+
RESULTS.
|
131 |
+
|
132 |
+
4. Limitation of Liability. IN NO EVENT WILL META OR ITS AFFILIATES BE LIABLE UNDER ANY THEORY OF
|
133 |
+
LIABILITY, WHETHER IN CONTRACT, TORT, NEGLIGENCE, PRODUCTS LIABILITY, OR OTHERWISE, ARISING
|
134 |
+
OUT OF THIS AGREEMENT, FOR ANY LOST PROFITS OR ANY INDIRECT, SPECIAL, CONSEQUENTIAL,
|
135 |
+
INCIDENTAL, EXEMPLARY OR PUNITIVE DAMAGES, EVEN IF META OR ITS AFFILIATES HAVE BEEN ADVISED
|
136 |
+
OF THE POSSIBILITY OF ANY OF THE FOREGOING.
|
137 |
+
|
138 |
+
5. Intellectual Property.
|
139 |
+
|
140 |
+
a. No trademark licenses are granted under this Agreement, and in connection with the Llama
|
141 |
+
Materials, neither Meta nor Licensee may use any name or mark owned by or associated with the other
|
142 |
+
or any of its affiliates, except as required for reasonable and customary use in describing and
|
143 |
+
redistributing the Llama Materials or as set forth in this Section 5(a). Meta hereby grants you a license to
|
144 |
+
use βLlamaβ (the βMarkβ) solely as required to comply with the last sentence of Section 1.b.i. You will
|
145 |
+
comply with Metaβs brand guidelines (currently accessible at
|
146 |
+
https://about.meta.com/brand/resources/meta/company-brand/ ). All goodwill arising out of your use
|
147 |
+
of the Mark will inure to the benefit of Meta.
|
148 |
+
|
149 |
+
b. Subject to Metaβs ownership of Llama Materials and derivatives made by or for Meta, with
|
150 |
+
respect to any derivative works and modifications of the Llama Materials that are made by you, as
|
151 |
+
between you and Meta, you are and will be the owner of such derivative works and modifications.
|
152 |
+
|
153 |
+
c. If you institute litigation or other proceedings against Meta or any entity (including a
|
154 |
+
cross-claim or counterclaim in a lawsuit) alleging that the Llama Materials or Llama 3.1 outputs or
|
155 |
+
results, or any portion of any of the foregoing, constitutes infringement of intellectual property or other
|
156 |
+
rights owned or licensable by you, then any licenses granted to you under this Agreement shall
|
157 |
+
terminate as of the date such litigation or claim is filed or instituted. You will indemnify and hold
|
158 |
+
harmless Meta from and against any claim by any third party arising out of or related to your use or
|
159 |
+
distribution of the Llama Materials.
|
160 |
+
|
161 |
+
6. Term and Termination. The term of this Agreement will commence upon your acceptance of this
|
162 |
+
Agreement or access to the Llama Materials and will continue in full force and effect until terminated in
|
163 |
+
accordance with the terms and conditions herein. Meta may terminate this Agreement if you are in
|
164 |
+
breach of any term or condition of this Agreement. Upon termination of this Agreement, you shall delete
|
165 |
+
and cease use of the Llama Materials. Sections 3, 4 and 7 shall survive the termination of this
|
166 |
+
Agreement.
|
167 |
+
|
168 |
+
7. Governing Law and Jurisdiction. This Agreement will be governed and construed under the laws of
|
169 |
+
the State of California without regard to choice of law principles, and the UN Convention on Contracts
|
170 |
+
for the International Sale of Goods does not apply to this Agreement. The courts of California shall have
|
171 |
+
exclusive jurisdiction of any dispute arising out of this Agreement.
|
172 |
+
|
173 |
+
# Llama 3.1 Acceptable Use Policy
|
174 |
+
|
175 |
+
Meta is committed to promoting safe and fair use of its tools and features, including Llama 3.1. If you
|
176 |
+
access or use Llama 3.1, you agree to this Acceptable Use Policy (βPolicyβ). The most recent copy of
|
177 |
+
this policy can be found at [https://llama.meta.com/llama3_1/use-policy](https://llama.meta.com/llama3_1/use-policy)
|
178 |
+
|
179 |
+
## Prohibited Uses
|
180 |
+
|
181 |
+
We want everyone to use Llama 3.1 safely and responsibly. You agree you will not use, or allow
|
182 |
+
others to use, Llama 3.1 to:
|
183 |
+
|
184 |
+
1. Violate the law or othersβ rights, including to:
|
185 |
+
1. Engage in, promote, generate, contribute to, encourage, plan, incite, or further illegal or unlawful activity or content, such as:
|
186 |
+
1. Violence or terrorism
|
187 |
+
2. Exploitation or harm to children, including the solicitation, creation, acquisition, or dissemination of child exploitative content or failure to report Child Sexual Abuse Material
|
188 |
+
3. Human trafficking, exploitation, and sexual violence
|
189 |
+
4. The illegal distribution of information or materials to minors, including obscene materials, or failure to employ legally required age-gating in connection with such information or materials.
|
190 |
+
5. Sexual solicitation
|
191 |
+
6. Any other criminal activity
|
192 |
+
3. Engage in, promote, incite, or facilitate the harassment, abuse, threatening, or bullying of individuals or groups of individuals
|
193 |
+
4. Engage in, promote, incite, or facilitate discrimination or other unlawful or harmful conduct in the provision of employment, employment benefits, credit, housing, other economic benefits, or other essential goods and services
|
194 |
+
5. Engage in the unauthorized or unlicensed practice of any profession including, but not limited to, financial, legal, medical/health, or related professional practices
|
195 |
+
6. Collect, process, disclose, generate, or infer health, demographic, or other sensitive personal or private information about individuals without rights and consents required by applicable laws
|
196 |
+
7. Engage in or facilitate any action or generate any content that infringes, misappropriates, or otherwise violates any third-party rights, including the outputs or results of any products or services using the Llama Materials
|
197 |
+
8. Create, generate, or facilitate the creation of malicious code, malware, computer viruses or do anything else that could disable, overburden, interfere with or impair the proper working, integrity, operation or appearance of a website or computer system
|
198 |
+
|
199 |
+
2. Engage in, promote, incite, facilitate, or assist in the planning or development of activities that present a risk of death or bodily harm to individuals, including use of Llama 3.1 related to the following:
|
200 |
+
1. Military, warfare, nuclear industries or applications, espionage, use for materials or activities that are subject to the International Traffic Arms Regulations (ITAR) maintained by the United States Department of State
|
201 |
+
2. Guns and illegal weapons (including weapon development)
|
202 |
+
3. Illegal drugs and regulated/controlled substances
|
203 |
+
4. Operation of critical infrastructure, transportation technologies, or heavy machinery
|
204 |
+
5. Self-harm or harm to others, including suicide, cutting, and eating disorders
|
205 |
+
6. Any content intended to incite or promote violence, abuse, or any infliction of bodily harm to an individual
|
206 |
+
|
207 |
+
3. Intentionally deceive or mislead others, including use of Llama 3.1 related to the following:
|
208 |
+
1. Generating, promoting, or furthering fraud or the creation or promotion of disinformation
|
209 |
+
2. Generating, promoting, or furthering defamatory content, including the creation of defamatory statements, images, or other content
|
210 |
+
3. Generating, promoting, or further distributing spam
|
211 |
+
4. Impersonating another individual without consent, authorization, or legal right
|
212 |
+
5. Representing that the use of Llama 3.1 or outputs are human-generated
|
213 |
+
6. Generating or facilitating false online engagement, including fake reviews and other means of fake online engagement
|
214 |
+
|
215 |
+
4. Fail to appropriately disclose to end users any known dangers of your AI system
|
216 |
+
|
217 |
+
Please report any violation of this Policy, software βbug,β or other problems that could lead to a violation
|
218 |
+
of this Policy through one of the following means:
|
219 |
+
|
220 |
+
* Reporting issues with the model: [https://github.com/meta-llama/llama-models/issues](https://github.com/meta-llama/llama-models/issues)
|
221 |
+
* Reporting risky content generated by the model: developers.facebook.com/llama_output_feedback
|
222 |
+
* Reporting bugs and security concerns: facebook.com/whitehat/info
|
223 |
+
* Reporting violations of the Acceptable Use Policy or unlicensed uses of Llama 3.1: [email protected]"
|
224 |
+
|
README.md
ADDED
@@ -0,0 +1,175 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: llama3.1
|
3 |
+
base_model: meta-llama/Meta-Llama-3.1-8B-Instruct
|
4 |
+
tags:
|
5 |
+
- llama
|
6 |
+
- llama-3.1
|
7 |
+
- gguf
|
8 |
+
- q4_k
|
9 |
+
- ollama
|
10 |
+
- legal
|
11 |
+
- citation
|
12 |
+
- quantized
|
13 |
+
- fine-tuned
|
14 |
+
- text-generation
|
15 |
+
- local-llm
|
16 |
+
language:
|
17 |
+
- en
|
18 |
+
pipeline_tag: text-generation
|
19 |
+
library_name: llama-cpp-python
|
20 |
+
inference: false
|
21 |
+
quantized_by: SeaSparks
|
22 |
+
---
|
23 |
+
|
24 |
+
# Llama-3.1-8B-Instruct-LegalCite-gguf
|
25 |
+
|
26 |
+
**Built with LLaMA** - Fine-tuned for legal citation extraction from documents like EU regulations.
|
27 |
+
|
28 |
+
This model specializes in quoting schort legal sections in response to user questions β directly grounded in the input text. It was fine-tuned on legislative corpora to enable compliance-minded, transparent responses.
|
29 |
+
|
30 |
+
**Technical Notes**
|
31 |
+
|
32 |
+
Finetuning was performed using a 4-bit MLX version of the original model, enabling efficient experimentation on Apple Silicon hardware.
|
33 |
+
|
34 |
+
On the evaluation set, we observed a significant reduction in loss and perplexity:
|
35 |
+
- Test loss: ~2.4 β ~1.1
|
36 |
+
- Test perplexity: ~11.1 β ~2.9
|
37 |
+
|
38 |
+
The model was then converted and exported to the gguf format.
|
39 |
+
|
40 |
+
- This is a GGUF 4bit version
|
41 |
+
- Transformers-compatible model: https://huggingface.co/seasparks/Llama-3.1-8B-Instruct-LegalCite
|
42 |
+
|
43 |
+
---
|
44 |
+
|
45 |
+
## How to use
|
46 |
+
|
47 |
+
### With llama-cpp-python
|
48 |
+
|
49 |
+
```python
|
50 |
+
from huggingface_hub import hf_hub_download
|
51 |
+
from llama_cpp import Llama
|
52 |
+
|
53 |
+
model_path = hf_hub_download(
|
54 |
+
repo_id="seasparks/Llama-3.1-8B-Instruct-LegalCite-gguf",
|
55 |
+
filename="Llama-3.1-8B-Instruct-LegalCite-q4_k.gguf"
|
56 |
+
)
|
57 |
+
|
58 |
+
llm = Llama(model_path=model_path)
|
59 |
+
|
60 |
+
sys_message = {"role": "system", "content": "You are an expert assistant answering questions about texts only by accurately citing and providing direct quotes from the text."}
|
61 |
+
|
62 |
+
example_text = """(3)
|
63 |
+
AI systems can be easily deployed in a large variety of sectors of the economy and many parts of society, including
|
64 |
+
across borders, and can easily circulate throughout the Union. Certain Member States have already explored the
|
65 |
+
adoption of national rules to ensure that AI is trustworthy and safe and is developed and used in accordance with
|
66 |
+
fundamental rights obligations. Diverging national rules may lead to the fragmentation of the internal market and
|
67 |
+
may decrease legal certainty for operators that develop, import or use AI systems. A consistent and high level of
|
68 |
+
protection throughout the Union should therefore be ensured in order to achieve trustworthy AI, while divergences
|
69 |
+
hampering the free circulation, innovation, deployment and the uptake of AI systems and related products and
|
70 |
+
services within the internal market should be prevented by laying down uniform obligations for operators and
|
71 |
+
guaranteeing the uniform protection of overriding reasons of public interest and of rights of persons throughout the
|
72 |
+
internal market on the basis of Article 114 of the Treaty on the Functioning of the European Union (TFEU). To the
|
73 |
+
extent that this Regulation contains specific rules on the protection of individuals with regard to the processing of
|
74 |
+
personal data concerning restrictions of the use of AI systems for remote biometric identification for the purpose of
|
75 |
+
law enforcement, of the use of AI systems for risk assessments of natural persons for the purpose of law
|
76 |
+
enforcement and of the use of AI systems of biometric categorisation for the purpose of law enforcement, it is
|
77 |
+
appropriate to base this Regulation, in so far as those specific rules are concerned, on Article 16 TFEU. In light of
|
78 |
+
those specific rules and the recourse to Article 16 TFEU, it is appropriate to consult the European Data Protection
|
79 |
+
Board."""
|
80 |
+
|
81 |
+
question = "How will trustworthy AI be achieved?"
|
82 |
+
|
83 |
+
messages = [sys_message,
|
84 |
+
{"role": "user", "content": example_text + "\nQuestion: " + question}]
|
85 |
+
|
86 |
+
response = llm.create_chat_completion(
|
87 |
+
messages=messages,
|
88 |
+
max_tokens=100,
|
89 |
+
)
|
90 |
+
|
91 |
+
# Print the assistant's reply
|
92 |
+
print(response['choices'][0]['message']['content'])
|
93 |
+
|
94 |
+
# Example output (actual model behavior may vary):
|
95 |
+
#
|
96 |
+
# Q: "How will trustworthy AI be achieved?"
|
97 |
+
# A: "...A consistent and high level of protection throughout the Union should therefore be ensured in order to achieve trustworthy AI, while divergences hampering the free circulation, innovation, deployment and the uptake of AI systems and related products and services within the internal market should be prevented..."
|
98 |
+
```
|
99 |
+
|
100 |
+
### With Ollama installed locally
|
101 |
+
|
102 |
+
```bash
|
103 |
+
# Create Ollama local model with the Modelfile from the repository
|
104 |
+
ollama create Llama-3.1-8B-Instruct-LegalCite-q4_k -f Modelfile
|
105 |
+
```
|
106 |
+
|
107 |
+
```python
|
108 |
+
from langchain_ollama import ChatOllama
|
109 |
+
|
110 |
+
llm = ChatOllama(
|
111 |
+
model = "Llama-3.1-8B-Instruct-LegalCite-q4_k",
|
112 |
+
num_predict = 100,
|
113 |
+
)
|
114 |
+
|
115 |
+
sys_message = {"role": "system", "content": "You are an expert assistant answering questions about texts only by accurately citing and providing direct quotes from the text."}
|
116 |
+
|
117 |
+
example_text = """(3)
|
118 |
+
AI systems can be easily deployed in a large variety of sectors of the economy and many parts of society, including
|
119 |
+
across borders, and can easily circulate throughout the Union. Certain Member States have already explored the
|
120 |
+
adoption of national rules to ensure that AI is trustworthy and safe and is developed and used in accordance with
|
121 |
+
fundamental rights obligations. Diverging national rules may lead to the fragmentation of the internal market and
|
122 |
+
may decrease legal certainty for operators that develop, import or use AI systems. A consistent and high level of
|
123 |
+
protection throughout the Union should therefore be ensured in order to achieve trustworthy AI, while divergences
|
124 |
+
hampering the free circulation, innovation, deployment and the uptake of AI systems and related products and
|
125 |
+
services within the internal market should be prevented by laying down uniform obligations for operators and
|
126 |
+
guaranteeing the uniform protection of overriding reasons of public interest and of rights of persons throughout the
|
127 |
+
internal market on the basis of Article 114 of the Treaty on the Functioning of the European Union (TFEU). To the
|
128 |
+
extent that this Regulation contains specific rules on the protection of individuals with regard to the processing of
|
129 |
+
personal data concerning restrictions of the use of AI systems for remote biometric identification for the purpose of
|
130 |
+
law enforcement, of the use of AI systems for risk assessments of natural persons for the purpose of law
|
131 |
+
enforcement and of the use of AI systems of biometric categorisation for the purpose of law enforcement, it is
|
132 |
+
appropriate to base this Regulation, in so far as those specific rules are concerned, on Article 16 TFEU. In light of
|
133 |
+
those specific rules and the recourse to Article 16 TFEU, it is appropriate to consult the European Data Protection
|
134 |
+
Board."""
|
135 |
+
|
136 |
+
question = "How will trustworthy AI be achieved?"
|
137 |
+
|
138 |
+
messages = [sys_message,
|
139 |
+
{"role": "user", "content": example_text + "\nQuestion: " + question}]
|
140 |
+
|
141 |
+
print(llm.invoke(messages).content)
|
142 |
+
|
143 |
+
# Example output (actual model behavior may vary):
|
144 |
+
#
|
145 |
+
# Q: "How will trustworthy AI be achieved?"
|
146 |
+
# A: "...A consistent and high level of protection throughout the Union should therefore be ensured in order to achieve trustworthy AI, while divergences hampering the free circulation, innovation, deployment and the uptake of AI systems and related products and services within the internal market should be prevented..."
|
147 |
+
```
|
148 |
+
|
149 |
+
You can steer how the model answers (e.g. how long or precise the quote is) to some extent using standard generation parameters like temperature, top_p, and top_k.
|
150 |
+
|
151 |
+
---
|
152 |
+
|
153 |
+
## Intended Use
|
154 |
+
|
155 |
+
This model is intended to be used in explorations and for research. It was fine-tuned to explore how LLMs can support accurate question answering using direct quotes β potentially helpful especially when it comes to pulling precise references from complex policy texts like the GDPR or the EU AI Act.
|
156 |
+
|
157 |
+
At this stage, it's an **experimental prototype** β for testing, demoing, or just seeing how far citation-style prompting can go.
|
158 |
+
|
159 |
+
- It's **not production-ready**, and should only be used in experimental and research contexts.
|
160 |
+
- It does **not provide legal advice**, and its outputs should always be verified by a human in professional settings.
|
161 |
+
|
162 |
+
Weβre curious where this can go β and happy to hear from you with feedback and ideas for improvement.
|
163 |
+
|
164 |
+
---
|
165 |
+
|
166 |
+
## π License & Attribution
|
167 |
+
|
168 |
+
- This model is a derivative of [`meta-llama/Meta-Llama-3.1-8B-Instruct`](https://huggingface.co/meta-llama/Meta-Llama-3.1-8B-Instruct)
|
169 |
+
- Licensed under the [LLaMA 3.1 Community License](https://github.com/meta-llama/llama-models/blob/main/models/llama3_1/LICENSE)
|
170 |
+
- Redistributed with required attribution: **Built with LLaMA**
|
171 |
+
|
172 |
+
---
|
173 |
+
|
174 |
+
Interested in using this model or adapting it for your use case?
|
175 |
+
**[β Contact us](mailto:[email protected])**
|