├── llm_ai_eo_header.jpg
├── .conda-ops
├── .gitignore
├── config.ini
├── .condarc
└── lockfile.json
├── environment.yml
├── .gitignore
├── LICENSE
├── README.md
└── llm_ai_eo.ipynb
/llm_ai_eo_header.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lmcinnes/llm_ai_eo/main/llm_ai_eo_header.jpg
--------------------------------------------------------------------------------
/.conda-ops/.gitignore:
--------------------------------------------------------------------------------
1 | *.explicit
2 | *.nohash
3 | *.pypi
4 | .ops.*
5 | envs
6 | *lockfile-local-url.ini*
--------------------------------------------------------------------------------
/environment.yml:
--------------------------------------------------------------------------------
1 | name: llm_ai_eo
2 | channels:
3 | - defaults
4 | - conda-forge
5 | dependencies:
6 | - pip:
7 | - llm
8 | - conda-forge::git-lfs
9 | - jupyter
10 | - pip
11 | - python
12 |
--------------------------------------------------------------------------------
/.conda-ops/config.ini:
--------------------------------------------------------------------------------
1 | [OPS_SETTINGS]
2 | env_name = llm_ai_eo
3 | prefix =
4 |
5 | [OPS_PATHS]
6 | condarc = ${ops_dir}/.condarc
7 | gitignore = ${ops_dir}/.gitignore
8 | requirements = ${project_dir}/environment.yml
9 | ops_dir = ${catalog_path}
10 | project_dir = ${ops_dir}/..
11 | explicit_lockfile = ${ops_dir}/lockfile.explicit
12 | lockfile = ${ops_dir}/lockfile.json
13 | lockfile_url_lookup = ${ops_dir}/lockfile-local-url.ini
14 | nohash_explicit_lockfile = ${ops_dir}/lockfile.nohash
15 | pip_explicit_lockfile = ${ops_dir}/lockfile.pypi
16 | env_dir = ${ops_dir}/envs
17 |
18 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | MANIFEST
2 | build
3 | dist
4 | _build
5 | docs/man/*.gz
6 | docs/source/api/generated
7 | docs/source/config.rst
8 | docs/gh-pages
9 | notebook/i18n/*/LC_MESSAGES/*.mo
10 | notebook/i18n/*/LC_MESSAGES/nbjs.json
11 | notebook/static/components
12 | notebook/static/style/*.min.css*
13 | notebook/static/*/js/built/
14 | notebook/static/*/built/
15 | notebook/static/built/
16 | notebook/static/*/js/main.min.js*
17 | notebook/static/lab/*bundle.js
18 | node_modules
19 | *.py[co]
20 | __pycache__
21 | *.egg-info
22 | *~
23 | *.bak
24 | .ipynb_checkpoints
25 | .tox
26 | .DS_Store
27 | \#*#
28 | .#*
29 | .coverage
30 | src
31 |
32 | *.swp
33 | *.map
34 | .idea/
35 | Read the Docs
36 | config.rst
37 |
38 | /.project
39 | /.pydevproject
40 |
41 | package-lock.json
42 |
43 | .vscode*
44 | .env
45 |
46 | data/
--------------------------------------------------------------------------------
/.conda-ops/.condarc:
--------------------------------------------------------------------------------
1 | add_anaconda_token: true
2 | allow_non_channel_urls: false
3 | allowlist_channels: []
4 | channel_alias: https://conda.anaconda.org
5 | channels:
6 | - defaults
7 | custom_channels:
8 | pkgs/main: https://repo.anaconda.com
9 | pkgs/r: https://repo.anaconda.com
10 | pkgs/pro: https://repo.anaconda.com
11 | custom_multichannels:
12 | defaults:
13 | - https://repo.anaconda.com/pkgs/main
14 | - https://repo.anaconda.com/pkgs/r
15 | local: []
16 | default_channels:
17 | - https://repo.anaconda.com/pkgs/main
18 | - https://repo.anaconda.com/pkgs/r
19 | experimental: []
20 | fetch_threads: '5'
21 | migrated_channel_aliases: []
22 | migrated_custom_channels: {}
23 | override_channels_enabled: true
24 | repodata_fns:
25 | - current_repodata.json
26 | - repodata.json
27 | repodata_threads: 0
28 | restore_free_channel: false
29 | use_only_tar_bz2: false
30 | aggressive_update_packages:
31 | - ca-certificates
32 | - certifi
33 | - openssl
34 | auto_update_conda: true
35 | channel_priority: flexible
36 | create_default_packages: []
37 | disallowed_packages: []
38 | force_reinstall: false
39 | pinned_packages: []
40 | pip_interop_enabled: true
41 | solver: classic
42 | track_features: []
43 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | BSD 3-Clause License
2 |
3 | Copyright (c) 2023, Matt Hodges
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions are met:
7 |
8 | 1. Redistributions of source code must retain the above copyright notice, this
9 | list of conditions and the following disclaimer.
10 |
11 | 2. Redistributions in binary form must reproduce the above copyright notice,
12 | this list of conditions and the following disclaimer in the documentation
13 | and/or other materials provided with the distribution.
14 |
15 | 3. Neither the name of the copyright holder nor the names of its
16 | contributors may be used to endorse or promote products derived from
17 | this software without specific prior written permission.
18 |
19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Language Models on the AI Executive Order
2 |
3 | 
4 |
5 | On October 30th, 2023, President Biden signed the [Executive Order on the Safe, Secure, and Trustworthy Development and Use of Artificial Intelligence](https://www.whitehouse.gov/briefing-room/presidential-actions/2023/10/30/executive-order-on-the-safe-secure-and-trustworthy-development-and-use-of-artificial-intelligence/). The order itself is quite sweeping and touches many government departments and agencies, with a focus on harnessing AI's potential and defending against harms and risks.
6 |
7 | In this Notebook, we'll deploy language models to rapidly discover information from the Order. For the easiest setup, I recommend trying this out in a Google Colab notebook.
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | Many of the strategies presented here are extensions from Simon Willison's work in his blog post, [Embedding paragraphs from my blog with E5-large-v2](https://til.simonwillison.net/llms/embed-paragraphs). Simon also maintains a handly command line utility for working with various LLM models, aptly named [LLM](https://llm.datasette.io/en/stable/). While Simon's writing largely focuses on the CLI capabilities of the tool (and the usefully opinionated integrations with SQLite), I prefer working with Pandas Dataframes. Here I show how to use the LLM library in that fashion.
16 |
17 | ### Example
18 |
19 | ```
20 | Query:
21 | what does it say about AI with regards to copyright?
22 |
23 | Response:
24 | The policy states that within 270 days of the date of the order, the Under Secretary of Commerce for Intellectual Property and Director of the United States Patent and Trademark Office (USPTO Director) shall consult with the Director of the United States Copyright Office and issue recommendations to the President on potential executive actions relating to copyright and AI. The recommendations shall address any copyright and related issues discussed in the United States Copyright Office's study, including the scope of protection for works produced using AI and the treatment of copyrighted works in AI training.
25 |
26 | Specifically, the policy mentions the following with regards to copyright and AI:
27 |
28 | * The USPTO Director shall issue guidance to USPTO patent examiners and applicants addressing inventorship and the use of AI, including generative AI, in the inventive process.
29 |
30 | * The USPTO Director shall issue additional guidance to USPTO patent examiners and applicants to address other considerations at the intersection of AI and IP, which could include updated guidance on patent eligibility to address innovation in AI and critical and emerging technologies.
31 |
32 | * The USPTO Director shall consult with the Director of the United States Copyright Office and issue recommendations to the President on potential executive actions relating to copyright and AI.
33 | ```
34 |
35 | ## License
36 |
37 | All code is provided under the [BSD 3-Clause license](https://github.com/hodgesmr/llm_ai_eo/blob/main/LICENSE).
38 |
39 | ## A Matt Hodges project
40 |
41 | This project is maintained by [@MattHodges](https://mastodon.social/@MattHodges).
42 |
43 | _Please use it for good, not evil._
44 |
--------------------------------------------------------------------------------
/.conda-ops/lockfile.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "channel": "pkgs/main",
4 | "hash": {
5 | "md5": "3696837a6acc77e3468bb6013ffc3e18"
6 | },
7 | "manager": "conda",
8 | "name": "aiofiles",
9 | "platform": "osx-arm64",
10 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/aiofiles-22.1.0-py311hca03da5_0.conda",
11 | "version": "22.1.0"
12 | },
13 | {
14 | "channel": "pypi",
15 | "editable": false,
16 | "hash": {
17 | "sha256": "41bdc2ba359032e36c0e9de5a3bd00d6fb7ea558a6ce6b70acedf0da86458321"
18 | },
19 | "manager": "pip",
20 | "name": "aiohttp",
21 | "pip_name": "aiohttp",
22 | "platform": "osx-arm64",
23 | "requested": false,
24 | "url": "https://files.pythonhosted.org/packages/8e/60/5d2a665713ce5f46d9fef626fee5dd4487cbcc3ee6f773706add1f872d92/aiohttp-3.8.6-cp311-cp311-macosx_11_0_arm64.whl",
25 | "version": "3.8.6"
26 | },
27 | {
28 | "channel": "pypi",
29 | "editable": false,
30 | "hash": {
31 | "sha256": "f8376fb07dd1e86a584e4fcdec80b36b7f81aac666ebc724e2c090300dd83b17"
32 | },
33 | "manager": "pip",
34 | "name": "aiosignal",
35 | "pip_name": "aiosignal",
36 | "platform": "osx-arm64",
37 | "requested": false,
38 | "url": "https://files.pythonhosted.org/packages/76/ac/a7305707cb852b7e16ff80eaf5692309bde30e2b1100a1fcacdc8f731d97/aiosignal-1.3.1-py3-none-any.whl",
39 | "version": "1.3.1"
40 | },
41 | {
42 | "channel": "pkgs/main",
43 | "hash": {
44 | "md5": "7b1a6b695ecd9dbb014909117a70c29d"
45 | },
46 | "manager": "conda",
47 | "name": "aiosqlite",
48 | "platform": "osx-arm64",
49 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/aiosqlite-0.18.0-py311hca03da5_0.conda",
50 | "version": "0.18.0"
51 | },
52 | {
53 | "channel": "pypi",
54 | "editable": false,
55 | "hash": {
56 | "sha256": "0641064de18ba7a25dee8f96403ebc39113d0cb953a01429249d5c7564666a43"
57 | },
58 | "manager": "pip",
59 | "name": "annotated-types",
60 | "pip_name": "annotated-types",
61 | "platform": "osx-arm64",
62 | "requested": false,
63 | "url": "https://files.pythonhosted.org/packages/28/78/d31230046e58c207284c6b2c4e8d96e6d3cb4e52354721b944d3e1ee4aa5/annotated_types-0.6.0-py3-none-any.whl",
64 | "version": "0.6.0"
65 | },
66 | {
67 | "channel": "pkgs/main",
68 | "hash": {
69 | "md5": "31d3f54455ecd11db47f3a65a2c0b3bb"
70 | },
71 | "manager": "conda",
72 | "name": "anyio",
73 | "platform": "osx-arm64",
74 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/anyio-3.5.0-py311hca03da5_0.conda",
75 | "version": "3.5.0"
76 | },
77 | {
78 | "channel": "pkgs/main",
79 | "hash": {
80 | "md5": "ea09da59fbb431f651f7c9e79dc145b8"
81 | },
82 | "manager": "conda",
83 | "name": "appnope",
84 | "platform": "osx-arm64",
85 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/appnope-0.1.2-py311hca03da5_1001.conda",
86 | "version": "0.1.2"
87 | },
88 | {
89 | "channel": "pkgs/main",
90 | "hash": {
91 | "md5": "f00b851bc61b4c313903d31c7daecb09"
92 | },
93 | "manager": "conda",
94 | "name": "argon2-cffi",
95 | "platform": "osx-arm64",
96 | "url": "https://repo.anaconda.com/pkgs/main/noarch/argon2-cffi-21.3.0-pyhd3eb1b0_0.conda",
97 | "version": "21.3.0"
98 | },
99 | {
100 | "channel": "pkgs/main",
101 | "hash": {
102 | "md5": "7279cc9c9f065aeb000ab40764926369"
103 | },
104 | "manager": "conda",
105 | "name": "argon2-cffi-bindings",
106 | "platform": "osx-arm64",
107 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/argon2-cffi-bindings-21.2.0-py311h80987f9_0.conda",
108 | "version": "21.2.0"
109 | },
110 | {
111 | "channel": "pkgs/main",
112 | "hash": {
113 | "md5": "140486e2ce4f3931b44aa5f7ff8d88da"
114 | },
115 | "manager": "conda",
116 | "name": "asttokens",
117 | "platform": "osx-arm64",
118 | "url": "https://repo.anaconda.com/pkgs/main/noarch/asttokens-2.0.5-pyhd3eb1b0_0.conda",
119 | "version": "2.0.5"
120 | },
121 | {
122 | "channel": "pypi",
123 | "editable": false,
124 | "hash": {
125 | "sha256": "7405140ff1230c310e51dc27b3145b9092d659ce68ff733fb0cefe3ee42be028"
126 | },
127 | "manager": "pip",
128 | "name": "async-timeout",
129 | "pip_name": "async-timeout",
130 | "platform": "osx-arm64",
131 | "requested": false,
132 | "url": "https://files.pythonhosted.org/packages/a7/fa/e01228c2938de91d47b307831c62ab9e4001e747789d0b05baf779a6488c/async_timeout-4.0.3-py3-none-any.whl",
133 | "version": "4.0.3"
134 | },
135 | {
136 | "channel": "pkgs/main",
137 | "hash": {
138 | "md5": "5626ccac4b4245a8d3c25472bc4be20f"
139 | },
140 | "manager": "conda",
141 | "name": "attrs",
142 | "platform": "osx-arm64",
143 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/attrs-23.1.0-py311hca03da5_0.conda",
144 | "version": "23.1.0"
145 | },
146 | {
147 | "channel": "pkgs/main",
148 | "hash": {
149 | "md5": "efbd03d301aed5cc4a1da148fd4533f8"
150 | },
151 | "manager": "conda",
152 | "name": "babel",
153 | "platform": "osx-arm64",
154 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/babel-2.11.0-py311hca03da5_0.conda",
155 | "version": "2.11.0"
156 | },
157 | {
158 | "channel": "pkgs/main",
159 | "hash": {
160 | "md5": "b2aa5503875aba2f1d88cae9df9a96d5"
161 | },
162 | "manager": "conda",
163 | "name": "backcall",
164 | "platform": "osx-arm64",
165 | "url": "https://repo.anaconda.com/pkgs/main/noarch/backcall-0.2.0-pyhd3eb1b0_0.tar.bz2",
166 | "version": "0.2.0"
167 | },
168 | {
169 | "channel": "pkgs/main",
170 | "hash": {
171 | "md5": "834f24f00fcf0cedfad1fb86d96a334d"
172 | },
173 | "manager": "conda",
174 | "name": "beautifulsoup4",
175 | "platform": "osx-arm64",
176 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/beautifulsoup4-4.12.2-py311hca03da5_0.conda",
177 | "version": "4.12.2"
178 | },
179 | {
180 | "channel": "pkgs/main",
181 | "hash": {
182 | "md5": "256eb7e384e35f993ef8ccd6c4f45e58"
183 | },
184 | "manager": "conda",
185 | "name": "bleach",
186 | "platform": "osx-arm64",
187 | "url": "https://repo.anaconda.com/pkgs/main/noarch/bleach-4.1.0-pyhd3eb1b0_0.conda",
188 | "version": "4.1.0"
189 | },
190 | {
191 | "channel": "pkgs/main",
192 | "hash": {
193 | "md5": "a28391b34643b08c419797118ac0a53b"
194 | },
195 | "manager": "conda",
196 | "name": "brotli-python",
197 | "platform": "osx-arm64",
198 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/brotli-python-1.0.9-py311h313beb8_7.conda",
199 | "version": "1.0.9"
200 | },
201 | {
202 | "channel": "pkgs/main",
203 | "hash": {
204 | "md5": "e5b4ef8ae5b3b5f0e3c9ca4bcf1a3b2f"
205 | },
206 | "manager": "conda",
207 | "name": "bzip2",
208 | "platform": "osx-arm64",
209 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/bzip2-1.0.8-h620ffc9_4.conda",
210 | "version": "1.0.8"
211 | },
212 | {
213 | "channel": "conda-forge",
214 | "hash": {
215 | "md5": "e1b99ac4dbcee71a71682996f67f7965"
216 | },
217 | "manager": "conda",
218 | "name": "ca-certificates",
219 | "platform": "osx-arm64",
220 | "url": "https://conda.anaconda.org/conda-forge/osx-arm64/ca-certificates-2023.7.22-hf0a4a13_0.conda",
221 | "version": "2023.7.22"
222 | },
223 | {
224 | "channel": "conda-forge",
225 | "hash": {
226 | "md5": "7f3dbc9179b4dde7da98dfb151d0ad22"
227 | },
228 | "manager": "conda",
229 | "name": "certifi",
230 | "platform": "osx-arm64",
231 | "url": "https://conda.anaconda.org/conda-forge/noarch/certifi-2023.7.22-pyhd8ed1ab_0.conda",
232 | "version": "2023.7.22"
233 | },
234 | {
235 | "channel": "pkgs/main",
236 | "hash": {
237 | "md5": "d3e4f96b79b26ad09e05c9bd59bbd1e1"
238 | },
239 | "manager": "conda",
240 | "name": "cffi",
241 | "platform": "osx-arm64",
242 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/cffi-1.15.1-py311h80987f9_3.conda",
243 | "version": "1.15.1"
244 | },
245 | {
246 | "channel": "pkgs/main",
247 | "hash": {
248 | "md5": "e7a441d94234b2b5fafee06e25dbf076"
249 | },
250 | "manager": "conda",
251 | "name": "charset-normalizer",
252 | "platform": "osx-arm64",
253 | "url": "https://repo.anaconda.com/pkgs/main/noarch/charset-normalizer-2.0.4-pyhd3eb1b0_0.conda",
254 | "version": "2.0.4"
255 | },
256 | {
257 | "channel": "pypi",
258 | "editable": false,
259 | "hash": {
260 | "sha256": "ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28"
261 | },
262 | "manager": "pip",
263 | "name": "click",
264 | "pip_name": "click",
265 | "platform": "osx-arm64",
266 | "requested": false,
267 | "url": "https://files.pythonhosted.org/packages/00/2e/d53fa4befbf2cfa713304affc7ca780ce4fc1fd8710527771b58311a3229/click-8.1.7-py3-none-any.whl",
268 | "version": "8.1.7"
269 | },
270 | {
271 | "channel": "pypi",
272 | "editable": false,
273 | "hash": {
274 | "sha256": "9b60486923720e7fc61731bdb32b617039aba820e22e1c88766b1125592eaa5f"
275 | },
276 | "manager": "pip",
277 | "name": "click-default-group",
278 | "pip_name": "click-default-group",
279 | "platform": "osx-arm64",
280 | "requested": false,
281 | "url": "https://files.pythonhosted.org/packages/2c/1a/aff8bb287a4b1400f69e09a53bd65de96aa5cee5691925b38731c67fc695/click_default_group-1.2.4-py2.py3-none-any.whl",
282 | "version": "1.2.4"
283 | },
284 | {
285 | "channel": "pkgs/main",
286 | "hash": {
287 | "md5": "18fea6c499812860bab8cd3ec0d8ee93"
288 | },
289 | "manager": "conda",
290 | "name": "comm",
291 | "platform": "osx-arm64",
292 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/comm-0.1.2-py311hca03da5_0.conda",
293 | "version": "0.1.2"
294 | },
295 | {
296 | "channel": "pkgs/main",
297 | "hash": {
298 | "md5": "0ae6049990cc936ce2ac215faf945fad"
299 | },
300 | "manager": "conda",
301 | "name": "cryptography",
302 | "platform": "osx-arm64",
303 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/cryptography-41.0.3-py311hd4332d6_0.conda",
304 | "version": "41.0.3"
305 | },
306 | {
307 | "channel": "pkgs/main",
308 | "hash": {
309 | "md5": "04f18edbb1f8d347b12ecd0eb86f23eb"
310 | },
311 | "manager": "conda",
312 | "name": "cyrus-sasl",
313 | "platform": "osx-arm64",
314 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/cyrus-sasl-2.1.28-h9131b1a_1.conda",
315 | "version": "2.1.28"
316 | },
317 | {
318 | "channel": "pkgs/main",
319 | "hash": {
320 | "md5": "a9b911167d7b8eba5d18d4672696078c"
321 | },
322 | "manager": "conda",
323 | "name": "debugpy",
324 | "platform": "osx-arm64",
325 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/debugpy-1.6.7-py311h313beb8_0.conda",
326 | "version": "1.6.7"
327 | },
328 | {
329 | "channel": "pkgs/main",
330 | "hash": {
331 | "md5": "4d969aac32a0faf84af90c797bfc7fec"
332 | },
333 | "manager": "conda",
334 | "name": "decorator",
335 | "platform": "osx-arm64",
336 | "url": "https://repo.anaconda.com/pkgs/main/noarch/decorator-5.1.1-pyhd3eb1b0_0.conda",
337 | "version": "5.1.1"
338 | },
339 | {
340 | "channel": "pkgs/main",
341 | "hash": {
342 | "md5": "d912068b0729930972adcaac338882c0"
343 | },
344 | "manager": "conda",
345 | "name": "defusedxml",
346 | "platform": "osx-arm64",
347 | "url": "https://repo.anaconda.com/pkgs/main/noarch/defusedxml-0.7.1-pyhd3eb1b0_0.conda",
348 | "version": "0.7.1"
349 | },
350 | {
351 | "channel": "pkgs/main",
352 | "hash": {
353 | "md5": "d55319f30bf1f8b04c865beb099464d8"
354 | },
355 | "manager": "conda",
356 | "name": "entrypoints",
357 | "platform": "osx-arm64",
358 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/entrypoints-0.4-py311hca03da5_0.conda",
359 | "version": "0.4"
360 | },
361 | {
362 | "channel": "pkgs/main",
363 | "hash": {
364 | "md5": "7be61d1c3c555fb37682b28d7a53d622"
365 | },
366 | "manager": "conda",
367 | "name": "executing",
368 | "platform": "osx-arm64",
369 | "url": "https://repo.anaconda.com/pkgs/main/noarch/executing-0.8.3-pyhd3eb1b0_0.conda",
370 | "version": "0.8.3"
371 | },
372 | {
373 | "channel": "pypi",
374 | "editable": false,
375 | "hash": {
376 | "sha256": "bd7bd3b3830247580de99c99ea2a01416dfc3c34471ca1298bccabf86d0ff4dc"
377 | },
378 | "manager": "pip",
379 | "name": "frozenlist",
380 | "pip_name": "frozenlist",
381 | "platform": "osx-arm64",
382 | "requested": false,
383 | "url": "https://files.pythonhosted.org/packages/9d/8b/8ab8143541b2c5fff4189fad7853e61d30e4ec4749ebf91e1d598c4e7c57/frozenlist-1.4.0-cp311-cp311-macosx_11_0_arm64.whl",
384 | "version": "1.4.0"
385 | },
386 | {
387 | "channel": "pkgs/main",
388 | "hash": {
389 | "md5": "9f5d1dd881910edf9b94ba3263fde3e7"
390 | },
391 | "manager": "conda",
392 | "name": "gettext",
393 | "platform": "osx-arm64",
394 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/gettext-0.21.0-h13f89a0_1.conda",
395 | "version": "0.21.0"
396 | },
397 | {
398 | "channel": "conda-forge",
399 | "hash": {
400 | "md5": "c96c89fe47e4a4cb14929a04ba78488f"
401 | },
402 | "manager": "conda",
403 | "name": "git-lfs",
404 | "platform": "osx-arm64",
405 | "url": "https://conda.anaconda.org/conda-forge/osx-arm64/git-lfs-3.4.0-hce30654_0.conda",
406 | "version": "3.4.0"
407 | },
408 | {
409 | "channel": "pkgs/main",
410 | "hash": {
411 | "md5": "8ef113539b685922978998c472a95bd9"
412 | },
413 | "manager": "conda",
414 | "name": "glib",
415 | "platform": "osx-arm64",
416 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/glib-2.69.1-h514c7bf_2.conda",
417 | "version": "2.69.1"
418 | },
419 | {
420 | "channel": "pkgs/main",
421 | "hash": {
422 | "md5": "9005707e68cd4228821d47f64df26113"
423 | },
424 | "manager": "conda",
425 | "name": "gst-plugins-base",
426 | "platform": "osx-arm64",
427 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/gst-plugins-base-1.14.1-h313beb8_1.conda",
428 | "version": "1.14.1"
429 | },
430 | {
431 | "channel": "pkgs/main",
432 | "hash": {
433 | "md5": "c0a0abb6e3b2df65093c2b9cf8daccaa"
434 | },
435 | "manager": "conda",
436 | "name": "gstreamer",
437 | "platform": "osx-arm64",
438 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/gstreamer-1.14.1-h80987f9_1.conda",
439 | "version": "1.14.1"
440 | },
441 | {
442 | "channel": "pkgs/main",
443 | "hash": {
444 | "md5": "0549586b2838067c209114998ed312ed"
445 | },
446 | "manager": "conda",
447 | "name": "icu",
448 | "platform": "osx-arm64",
449 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/icu-73.1-h313beb8_0.conda",
450 | "version": "73.1"
451 | },
452 | {
453 | "channel": "pkgs/main",
454 | "hash": {
455 | "md5": "a6011ce11309e4daa98c8e515734d6e4"
456 | },
457 | "manager": "conda",
458 | "name": "idna",
459 | "platform": "osx-arm64",
460 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/idna-3.4-py311hca03da5_0.conda",
461 | "version": "3.4"
462 | },
463 | {
464 | "channel": "pkgs/main",
465 | "hash": {
466 | "md5": "d84685d4f5c506cd41dafa212cc387d2"
467 | },
468 | "manager": "conda",
469 | "name": "ipykernel",
470 | "platform": "osx-arm64",
471 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/ipykernel-6.25.0-py311hb6e6a13_0.conda",
472 | "version": "6.25.0"
473 | },
474 | {
475 | "channel": "pkgs/main",
476 | "hash": {
477 | "md5": "9aa66b4a35687094b331ce95080bb497"
478 | },
479 | "manager": "conda",
480 | "name": "ipython",
481 | "platform": "osx-arm64",
482 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/ipython-8.15.0-py311hca03da5_0.conda",
483 | "version": "8.15.0"
484 | },
485 | {
486 | "channel": "pkgs/main",
487 | "hash": {
488 | "md5": "553832c0b872a28088a0001fa2ba3822"
489 | },
490 | "manager": "conda",
491 | "name": "ipython_genutils",
492 | "platform": "osx-arm64",
493 | "url": "https://repo.anaconda.com/pkgs/main/noarch/ipython_genutils-0.2.0-pyhd3eb1b0_1.conda",
494 | "version": "0.2.0"
495 | },
496 | {
497 | "channel": "pkgs/main",
498 | "hash": {
499 | "md5": "e0b64ae2331ffe693e1b578b3c44e2b5"
500 | },
501 | "manager": "conda",
502 | "name": "ipywidgets",
503 | "platform": "osx-arm64",
504 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/ipywidgets-8.0.4-py311hca03da5_0.conda",
505 | "version": "8.0.4"
506 | },
507 | {
508 | "channel": "pkgs/main",
509 | "hash": {
510 | "md5": "26b04eacaec65955f93d6a5050c97e70"
511 | },
512 | "manager": "conda",
513 | "name": "jedi",
514 | "platform": "osx-arm64",
515 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/jedi-0.18.1-py311hca03da5_1.conda",
516 | "version": "0.18.1"
517 | },
518 | {
519 | "channel": "pkgs/main",
520 | "hash": {
521 | "md5": "8c3694cc95fce4b39953ae604b6cd691"
522 | },
523 | "manager": "conda",
524 | "name": "jinja2",
525 | "platform": "osx-arm64",
526 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/jinja2-3.1.2-py311hca03da5_0.conda",
527 | "version": "3.1.2"
528 | },
529 | {
530 | "channel": "pkgs/main",
531 | "hash": {
532 | "md5": "4dc30523b220156352725fc78d2dc4e3"
533 | },
534 | "manager": "conda",
535 | "name": "jpeg",
536 | "platform": "osx-arm64",
537 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/jpeg-9e-h80987f9_1.conda",
538 | "version": "9e"
539 | },
540 | {
541 | "channel": "pkgs/main",
542 | "hash": {
543 | "md5": "4e721ee2dbfa20069719d2ee19185031"
544 | },
545 | "manager": "conda",
546 | "name": "json5",
547 | "platform": "osx-arm64",
548 | "url": "https://repo.anaconda.com/pkgs/main/noarch/json5-0.9.6-pyhd3eb1b0_0.conda",
549 | "version": "0.9.6"
550 | },
551 | {
552 | "channel": "pkgs/main",
553 | "hash": {
554 | "md5": "bacec3ef694da348047082b6d1808f84"
555 | },
556 | "manager": "conda",
557 | "name": "jsonschema",
558 | "platform": "osx-arm64",
559 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/jsonschema-4.19.2-py311hca03da5_0.conda",
560 | "version": "4.19.2"
561 | },
562 | {
563 | "channel": "pkgs/main",
564 | "hash": {
565 | "md5": "bd7d3379db2b45edf260462d8a0cc208"
566 | },
567 | "manager": "conda",
568 | "name": "jsonschema-specifications",
569 | "platform": "osx-arm64",
570 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/jsonschema-specifications-2023.7.1-py311hca03da5_0.conda",
571 | "version": "2023.7.1"
572 | },
573 | {
574 | "channel": "pkgs/main",
575 | "hash": {
576 | "md5": "3de5ed0bbc0e6581f305a734400edbab"
577 | },
578 | "manager": "conda",
579 | "name": "jupyter",
580 | "platform": "osx-arm64",
581 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/jupyter-1.0.0-py311hca03da5_8.conda",
582 | "version": "1.0.0"
583 | },
584 | {
585 | "channel": "pkgs/main",
586 | "hash": {
587 | "md5": "612c5b716ddcb23e7c21476e0ecbe0fc"
588 | },
589 | "manager": "conda",
590 | "name": "jupyter_client",
591 | "platform": "osx-arm64",
592 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/jupyter_client-7.4.9-py311hca03da5_0.conda",
593 | "version": "7.4.9"
594 | },
595 | {
596 | "channel": "pkgs/main",
597 | "hash": {
598 | "md5": "61da8d4bcaff7eed74f01e592c27402f"
599 | },
600 | "manager": "conda",
601 | "name": "jupyter_console",
602 | "platform": "osx-arm64",
603 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/jupyter_console-6.6.3-py311hca03da5_0.conda",
604 | "version": "6.6.3"
605 | },
606 | {
607 | "channel": "pkgs/main",
608 | "hash": {
609 | "md5": "109226c20a73aa44714ca68c472b46e0"
610 | },
611 | "manager": "conda",
612 | "name": "jupyter_core",
613 | "platform": "osx-arm64",
614 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/jupyter_core-5.5.0-py311hca03da5_0.conda",
615 | "version": "5.5.0"
616 | },
617 | {
618 | "channel": "pkgs/main",
619 | "hash": {
620 | "md5": "b1c56162a5c2d795b0172a7e542ee114"
621 | },
622 | "manager": "conda",
623 | "name": "jupyter_events",
624 | "platform": "osx-arm64",
625 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/jupyter_events-0.8.0-py311hca03da5_0.conda",
626 | "version": "0.8.0"
627 | },
628 | {
629 | "channel": "pkgs/main",
630 | "hash": {
631 | "md5": "273a2529d71e28aeef1be4df20ab33e4"
632 | },
633 | "manager": "conda",
634 | "name": "jupyter_server",
635 | "platform": "osx-arm64",
636 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/jupyter_server-1.23.4-py311hca03da5_0.conda",
637 | "version": "1.23.4"
638 | },
639 | {
640 | "channel": "pkgs/main",
641 | "hash": {
642 | "md5": "6d37b72deae903760a742d3dfa8ffef0"
643 | },
644 | "manager": "conda",
645 | "name": "jupyter_server_fileid",
646 | "platform": "osx-arm64",
647 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/jupyter_server_fileid-0.9.0-py311hca03da5_0.conda",
648 | "version": "0.9.0"
649 | },
650 | {
651 | "channel": "pkgs/main",
652 | "hash": {
653 | "md5": "0df500f2a7cc9000fe5b128f2891929d"
654 | },
655 | "manager": "conda",
656 | "name": "jupyter_server_ydoc",
657 | "platform": "osx-arm64",
658 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/jupyter_server_ydoc-0.8.0-py311hca03da5_1.conda",
659 | "version": "0.8.0"
660 | },
661 | {
662 | "channel": "pkgs/main",
663 | "hash": {
664 | "md5": "2e26f9fc88374d32c1c6a0c6d018fdda"
665 | },
666 | "manager": "conda",
667 | "name": "jupyter_ydoc",
668 | "platform": "osx-arm64",
669 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/jupyter_ydoc-0.2.4-py311hca03da5_0.conda",
670 | "version": "0.2.4"
671 | },
672 | {
673 | "channel": "pkgs/main",
674 | "hash": {
675 | "md5": "c6335e974455b17bb647de5a8916e978"
676 | },
677 | "manager": "conda",
678 | "name": "jupyterlab",
679 | "platform": "osx-arm64",
680 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/jupyterlab-3.6.3-py311hca03da5_0.conda",
681 | "version": "3.6.3"
682 | },
683 | {
684 | "channel": "pkgs/main",
685 | "hash": {
686 | "md5": "af46aff4922ca45df6ba19b313df6070"
687 | },
688 | "manager": "conda",
689 | "name": "jupyterlab_pygments",
690 | "platform": "osx-arm64",
691 | "url": "https://repo.anaconda.com/pkgs/main/noarch/jupyterlab_pygments-0.1.2-py_0.conda",
692 | "version": "0.1.2"
693 | },
694 | {
695 | "channel": "pkgs/main",
696 | "hash": {
697 | "md5": "2c9e7cbbe9e8c8d73a84f0fc81dcb4aa"
698 | },
699 | "manager": "conda",
700 | "name": "jupyterlab_server",
701 | "platform": "osx-arm64",
702 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/jupyterlab_server-2.22.0-py311hca03da5_0.conda",
703 | "version": "2.22.0"
704 | },
705 | {
706 | "channel": "pkgs/main",
707 | "hash": {
708 | "md5": "b83273d70d8fffb7c3a869cf1c98d514"
709 | },
710 | "manager": "conda",
711 | "name": "jupyterlab_widgets",
712 | "platform": "osx-arm64",
713 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/jupyterlab_widgets-3.0.5-py311hca03da5_0.conda",
714 | "version": "3.0.5"
715 | },
716 | {
717 | "channel": "pkgs/main",
718 | "hash": {
719 | "md5": "4bcf072bd6fc82c9f40a4eb3c3c262a4"
720 | },
721 | "manager": "conda",
722 | "name": "krb5",
723 | "platform": "osx-arm64",
724 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/krb5-1.20.1-hf3e1bf2_1.conda",
725 | "version": "1.20.1"
726 | },
727 | {
728 | "channel": "pkgs/main",
729 | "hash": {
730 | "md5": "a9de4935b3a51312f05d97cbb553480a"
731 | },
732 | "manager": "conda",
733 | "name": "libclang",
734 | "platform": "osx-arm64",
735 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/libclang-14.0.6-default_h1b80db6_1.conda",
736 | "version": "14.0.6"
737 | },
738 | {
739 | "channel": "pkgs/main",
740 | "hash": {
741 | "md5": "854a3eea0b284de748919be581028a0b"
742 | },
743 | "manager": "conda",
744 | "name": "libclang13",
745 | "platform": "osx-arm64",
746 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/libclang13-14.0.6-default_h24352ff_1.conda",
747 | "version": "14.0.6"
748 | },
749 | {
750 | "channel": "pkgs/main",
751 | "hash": {
752 | "md5": "7e7407793c757ee8f5b8d7c2e3b9e9ab"
753 | },
754 | "manager": "conda",
755 | "name": "libcxx",
756 | "platform": "osx-arm64",
757 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/libcxx-14.0.6-h848a8c0_0.conda",
758 | "version": "14.0.6"
759 | },
760 | {
761 | "channel": "pkgs/main",
762 | "hash": {
763 | "md5": "5af41ecedeb62857249ba75166a7b6b1"
764 | },
765 | "manager": "conda",
766 | "name": "libedit",
767 | "platform": "osx-arm64",
768 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/libedit-3.1.20221030-h80987f9_0.conda",
769 | "version": "3.1.20221030"
770 | },
771 | {
772 | "channel": "pkgs/main",
773 | "hash": {
774 | "md5": "0279cc7c6cb46a948c6312e490f2c04e"
775 | },
776 | "manager": "conda",
777 | "name": "libffi",
778 | "platform": "osx-arm64",
779 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/libffi-3.4.4-hca03da5_0.conda",
780 | "version": "3.4.4"
781 | },
782 | {
783 | "channel": "pkgs/main",
784 | "hash": {
785 | "md5": "0cb77f51b777a6bf8271aea913ba1bdc"
786 | },
787 | "manager": "conda",
788 | "name": "libiconv",
789 | "platform": "osx-arm64",
790 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/libiconv-1.16-h1a28f6b_2.conda",
791 | "version": "1.16"
792 | },
793 | {
794 | "channel": "pkgs/main",
795 | "hash": {
796 | "md5": "b34f3de20415528b55733de1d0d1ccf9"
797 | },
798 | "manager": "conda",
799 | "name": "libllvm14",
800 | "platform": "osx-arm64",
801 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/libllvm14-14.0.6-h7ec7a93_3.conda",
802 | "version": "14.0.6"
803 | },
804 | {
805 | "channel": "pkgs/main",
806 | "hash": {
807 | "md5": "35219bc0756d7dacad232c483d1518e7"
808 | },
809 | "manager": "conda",
810 | "name": "libpng",
811 | "platform": "osx-arm64",
812 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/libpng-1.6.39-h80987f9_0.conda",
813 | "version": "1.6.39"
814 | },
815 | {
816 | "channel": "pkgs/main",
817 | "hash": {
818 | "md5": "4644f32bf964fcb2321c3b1e0a21da48"
819 | },
820 | "manager": "conda",
821 | "name": "libpq",
822 | "platform": "osx-arm64",
823 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/libpq-12.15-h02f6b3c_1.conda",
824 | "version": "12.15"
825 | },
826 | {
827 | "channel": "pkgs/main",
828 | "hash": {
829 | "md5": "c3872d57624b5db1397b5381fa26743b"
830 | },
831 | "manager": "conda",
832 | "name": "libsodium",
833 | "platform": "osx-arm64",
834 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/libsodium-1.0.18-h1a28f6b_0.conda",
835 | "version": "1.0.18"
836 | },
837 | {
838 | "channel": "pkgs/main",
839 | "hash": {
840 | "md5": "6b3a851a9d2976e3c7c6ad2847d5090e"
841 | },
842 | "manager": "conda",
843 | "name": "libxml2",
844 | "platform": "osx-arm64",
845 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/libxml2-2.10.4-h0dcf63f_1.conda",
846 | "version": "2.10.4"
847 | },
848 | {
849 | "channel": "pypi",
850 | "editable": false,
851 | "hash": {
852 | "sha256": "8873ae105ce73030fb3e0e01379eee57cc456b58373bf17a5d7cf1b0977f5041"
853 | },
854 | "manager": "pip",
855 | "name": "llm",
856 | "pip_name": "llm",
857 | "platform": "osx-arm64",
858 | "requested": true,
859 | "url": "https://files.pythonhosted.org/packages/8e/a6/c75cc3cd35c72abd1f71f21bf232d78c17e0fa12c3872ff2ca356e5c7496/llm-0.12-py3-none-any.whl",
860 | "version": "0.12"
861 | },
862 | {
863 | "channel": "pkgs/main",
864 | "hash": {
865 | "md5": "a2b4668f6d54435752cbef2a27ed10d1"
866 | },
867 | "manager": "conda",
868 | "name": "llvm-openmp",
869 | "platform": "osx-arm64",
870 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/llvm-openmp-14.0.6-hc6e5704_0.conda",
871 | "version": "14.0.6"
872 | },
873 | {
874 | "channel": "pkgs/main",
875 | "hash": {
876 | "md5": "12d867cba3e895c0b2a18f86970c6663"
877 | },
878 | "manager": "conda",
879 | "name": "lz4-c",
880 | "platform": "osx-arm64",
881 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/lz4-c-1.9.4-h313beb8_0.conda",
882 | "version": "1.9.4"
883 | },
884 | {
885 | "channel": "pkgs/main",
886 | "hash": {
887 | "md5": "56bf51186bde57bb7616ff2fbc622484"
888 | },
889 | "manager": "conda",
890 | "name": "markupsafe",
891 | "platform": "osx-arm64",
892 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/markupsafe-2.1.1-py311h80987f9_0.conda",
893 | "version": "2.1.1"
894 | },
895 | {
896 | "channel": "pkgs/main",
897 | "hash": {
898 | "md5": "5c08fdce8b34417bd408586e2fc4fdc1"
899 | },
900 | "manager": "conda",
901 | "name": "matplotlib-inline",
902 | "platform": "osx-arm64",
903 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/matplotlib-inline-0.1.6-py311hca03da5_0.conda",
904 | "version": "0.1.6"
905 | },
906 | {
907 | "channel": "pkgs/main",
908 | "hash": {
909 | "md5": "3ad0c6472932e2f86a54b79470a6f05d"
910 | },
911 | "manager": "conda",
912 | "name": "mistune",
913 | "platform": "osx-arm64",
914 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/mistune-2.0.4-py311hca03da5_0.conda",
915 | "version": "2.0.4"
916 | },
917 | {
918 | "channel": "pypi",
919 | "editable": false,
920 | "hash": {
921 | "sha256": "ff959bee35038c4624250473988b24f846cbeb2c6639de3602c073f10410ceba"
922 | },
923 | "manager": "pip",
924 | "name": "multidict",
925 | "pip_name": "multidict",
926 | "platform": "osx-arm64",
927 | "requested": false,
928 | "url": "https://files.pythonhosted.org/packages/59/28/e50cc24c56609d11f7232606f73981620e94e3445791d9501e21c4c73a61/multidict-6.0.4-cp311-cp311-macosx_11_0_arm64.whl",
929 | "version": "6.0.4"
930 | },
931 | {
932 | "channel": "pkgs/main",
933 | "hash": {
934 | "md5": "cb6f7d449736afb130f9c7f404759032"
935 | },
936 | "manager": "conda",
937 | "name": "mysql",
938 | "platform": "osx-arm64",
939 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/mysql-5.7.24-ha71a6ea_2.conda",
940 | "version": "5.7.24"
941 | },
942 | {
943 | "channel": "pkgs/main",
944 | "hash": {
945 | "md5": "142dc8d56ab216eeae32163d59f43d0a"
946 | },
947 | "manager": "conda",
948 | "name": "nbclassic",
949 | "platform": "osx-arm64",
950 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/nbclassic-0.5.5-py311hca03da5_0.conda",
951 | "version": "0.5.5"
952 | },
953 | {
954 | "channel": "pkgs/main",
955 | "hash": {
956 | "md5": "267463442bbe4d4790cd3c2e0e46b765"
957 | },
958 | "manager": "conda",
959 | "name": "nbclient",
960 | "platform": "osx-arm64",
961 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/nbclient-0.8.0-py311hca03da5_0.conda",
962 | "version": "0.8.0"
963 | },
964 | {
965 | "channel": "pkgs/main",
966 | "hash": {
967 | "md5": "5d99b1cfe4d8808de0ebaa8b3935c7b7"
968 | },
969 | "manager": "conda",
970 | "name": "nbconvert",
971 | "platform": "osx-arm64",
972 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/nbconvert-7.10.0-py311hca03da5_0.conda",
973 | "version": "7.10.0"
974 | },
975 | {
976 | "channel": "pkgs/main",
977 | "hash": {
978 | "md5": "af751a20dce835eae358876d71c7b779"
979 | },
980 | "manager": "conda",
981 | "name": "nbformat",
982 | "platform": "osx-arm64",
983 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/nbformat-5.9.2-py311hca03da5_0.conda",
984 | "version": "5.9.2"
985 | },
986 | {
987 | "channel": "pkgs/main",
988 | "hash": {
989 | "md5": "08038fd388dbbda4ed8e0206fc8706a7"
990 | },
991 | "manager": "conda",
992 | "name": "ncurses",
993 | "platform": "osx-arm64",
994 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/ncurses-6.4-h313beb8_0.conda",
995 | "version": "6.4"
996 | },
997 | {
998 | "channel": "pkgs/main",
999 | "hash": {
1000 | "md5": "4b591e87aa5418b688f6a42c492996ff"
1001 | },
1002 | "manager": "conda",
1003 | "name": "nest-asyncio",
1004 | "platform": "osx-arm64",
1005 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/nest-asyncio-1.5.6-py311hca03da5_0.conda",
1006 | "version": "1.5.6"
1007 | },
1008 | {
1009 | "channel": "pkgs/main",
1010 | "hash": {
1011 | "md5": "92718a84ffadcfe401cdb8f511ef7b7c"
1012 | },
1013 | "manager": "conda",
1014 | "name": "notebook",
1015 | "platform": "osx-arm64",
1016 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/notebook-6.5.4-py311hca03da5_1.conda",
1017 | "version": "6.5.4"
1018 | },
1019 | {
1020 | "channel": "pkgs/main",
1021 | "hash": {
1022 | "md5": "e6485062879bad5d29c26016f0af097b"
1023 | },
1024 | "manager": "conda",
1025 | "name": "notebook-shim",
1026 | "platform": "osx-arm64",
1027 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/notebook-shim-0.2.2-py311hca03da5_0.conda",
1028 | "version": "0.2.2"
1029 | },
1030 | {
1031 | "channel": "pypi",
1032 | "editable": false,
1033 | "hash": {
1034 | "sha256": "d18690f9e3d31eedb66b57b88c2165d760b24ea0a01f150dd3f068155088ce68"
1035 | },
1036 | "manager": "pip",
1037 | "name": "openai",
1038 | "pip_name": "openai",
1039 | "platform": "osx-arm64",
1040 | "requested": false,
1041 | "url": "https://files.pythonhosted.org/packages/1e/9f/385c25502f437686e4aa715969e5eaf5c2cb5e5ffa7c5cdd52f3c6ae967a/openai-0.28.1-py3-none-any.whl",
1042 | "version": "0.28.1"
1043 | },
1044 | {
1045 | "channel": "conda-forge",
1046 | "hash": {
1047 | "md5": "5a89552fececf4cd99628318ccbb67a3"
1048 | },
1049 | "manager": "conda",
1050 | "name": "openssl",
1051 | "platform": "osx-arm64",
1052 | "url": "https://conda.anaconda.org/conda-forge/osx-arm64/openssl-3.1.4-h0d3ecfb_0.conda",
1053 | "version": "3.1.4"
1054 | },
1055 | {
1056 | "channel": "pkgs/main",
1057 | "hash": {
1058 | "md5": "231ceedb5d93120a37c05654442fc8bd"
1059 | },
1060 | "manager": "conda",
1061 | "name": "packaging",
1062 | "platform": "osx-arm64",
1063 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/packaging-23.1-py311hca03da5_0.conda",
1064 | "version": "23.1"
1065 | },
1066 | {
1067 | "channel": "pkgs/main",
1068 | "hash": {
1069 | "md5": "5547ced9e3bb4c513405998957b52c7b"
1070 | },
1071 | "manager": "conda",
1072 | "name": "pandocfilters",
1073 | "platform": "osx-arm64",
1074 | "url": "https://repo.anaconda.com/pkgs/main/noarch/pandocfilters-1.5.0-pyhd3eb1b0_0.conda",
1075 | "version": "1.5.0"
1076 | },
1077 | {
1078 | "channel": "pkgs/main",
1079 | "hash": {
1080 | "md5": "c6f0f6219bf5ce2b510ef4b75cbc3e01"
1081 | },
1082 | "manager": "conda",
1083 | "name": "parso",
1084 | "platform": "osx-arm64",
1085 | "url": "https://repo.anaconda.com/pkgs/main/noarch/parso-0.8.3-pyhd3eb1b0_0.conda",
1086 | "version": "0.8.3"
1087 | },
1088 | {
1089 | "channel": "pkgs/main",
1090 | "hash": {
1091 | "md5": "31668a162a176c27ed2b89a9fac761d7"
1092 | },
1093 | "manager": "conda",
1094 | "name": "pcre",
1095 | "platform": "osx-arm64",
1096 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/pcre-8.45-hc377ac9_0.conda",
1097 | "version": "8.45"
1098 | },
1099 | {
1100 | "channel": "pkgs/main",
1101 | "hash": {
1102 | "md5": "765b2562d6cdd14bb6d44fc170a04331"
1103 | },
1104 | "manager": "conda",
1105 | "name": "pexpect",
1106 | "platform": "osx-arm64",
1107 | "url": "https://repo.anaconda.com/pkgs/main/noarch/pexpect-4.8.0-pyhd3eb1b0_3.conda",
1108 | "version": "4.8.0"
1109 | },
1110 | {
1111 | "channel": "pkgs/main",
1112 | "hash": {
1113 | "md5": "4a6363fd8dda664b95f99f7c5aa95abc"
1114 | },
1115 | "manager": "conda",
1116 | "name": "pickleshare",
1117 | "platform": "osx-arm64",
1118 | "url": "https://repo.anaconda.com/pkgs/main/noarch/pickleshare-0.7.5-pyhd3eb1b0_1003.conda",
1119 | "version": "0.7.5"
1120 | },
1121 | {
1122 | "channel": "pkgs/main",
1123 | "hash": {
1124 | "md5": "c508ec75244f5230ed0055599c809a46"
1125 | },
1126 | "manager": "conda",
1127 | "name": "pip",
1128 | "platform": "osx-arm64",
1129 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/pip-23.3-py311hca03da5_0.conda",
1130 | "version": "23.3"
1131 | },
1132 | {
1133 | "channel": "pkgs/main",
1134 | "hash": {
1135 | "md5": "55af5b55f3b6cd992f62082df381e8fa"
1136 | },
1137 | "manager": "conda",
1138 | "name": "platformdirs",
1139 | "platform": "osx-arm64",
1140 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/platformdirs-3.10.0-py311hca03da5_0.conda",
1141 | "version": "3.10.0"
1142 | },
1143 | {
1144 | "channel": "pypi",
1145 | "editable": false,
1146 | "hash": {
1147 | "sha256": "d89c696a773f8bd377d18e5ecda92b7a3793cbe66c87060a6fb58c7b6e1061f7"
1148 | },
1149 | "manager": "pip",
1150 | "name": "pluggy",
1151 | "pip_name": "pluggy",
1152 | "platform": "osx-arm64",
1153 | "requested": false,
1154 | "url": "https://files.pythonhosted.org/packages/05/b8/42ed91898d4784546c5f06c60506400548db3f7a4b3fb441cba4e5c17952/pluggy-1.3.0-py3-none-any.whl",
1155 | "version": "1.3.0"
1156 | },
1157 | {
1158 | "channel": "pkgs/main",
1159 | "hash": {
1160 | "md5": "be4f2a70f4be19671f53eb38477451b6"
1161 | },
1162 | "manager": "conda",
1163 | "name": "ply",
1164 | "platform": "osx-arm64",
1165 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/ply-3.11-py311hca03da5_0.conda",
1166 | "version": "3.11"
1167 | },
1168 | {
1169 | "channel": "pkgs/main",
1170 | "hash": {
1171 | "md5": "39baf6bd1ba5e3a7e9d36a1159f0ae94"
1172 | },
1173 | "manager": "conda",
1174 | "name": "prometheus_client",
1175 | "platform": "osx-arm64",
1176 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/prometheus_client-0.14.1-py311hca03da5_0.conda",
1177 | "version": "0.14.1"
1178 | },
1179 | {
1180 | "channel": "pkgs/main",
1181 | "hash": {
1182 | "md5": "74dd3aa73ff3b6a99c8ab24e92b8d1f1"
1183 | },
1184 | "manager": "conda",
1185 | "name": "prompt-toolkit",
1186 | "platform": "osx-arm64",
1187 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/prompt-toolkit-3.0.36-py311hca03da5_0.conda",
1188 | "version": "3.0.36"
1189 | },
1190 | {
1191 | "channel": "pkgs/main",
1192 | "hash": {
1193 | "md5": "c850976b29e0171af80d2b3725af1c36"
1194 | },
1195 | "manager": "conda",
1196 | "name": "prompt_toolkit",
1197 | "platform": "osx-arm64",
1198 | "url": "https://repo.anaconda.com/pkgs/main/noarch/prompt_toolkit-3.0.36-hd3eb1b0_0.conda",
1199 | "version": "3.0.36"
1200 | },
1201 | {
1202 | "channel": "pkgs/main",
1203 | "hash": {
1204 | "md5": "4bcb23e0d7f2ba1d814363742a1ae624"
1205 | },
1206 | "manager": "conda",
1207 | "name": "psutil",
1208 | "platform": "osx-arm64",
1209 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/psutil-5.9.0-py311h80987f9_0.conda",
1210 | "version": "5.9.0"
1211 | },
1212 | {
1213 | "channel": "pkgs/main",
1214 | "hash": {
1215 | "md5": "7441d2827d4bfbcc1fa308875a146246"
1216 | },
1217 | "manager": "conda",
1218 | "name": "ptyprocess",
1219 | "platform": "osx-arm64",
1220 | "url": "https://repo.anaconda.com/pkgs/main/noarch/ptyprocess-0.7.0-pyhd3eb1b0_2.conda",
1221 | "version": "0.7.0"
1222 | },
1223 | {
1224 | "channel": "pkgs/main",
1225 | "hash": {
1226 | "md5": "a87d6d9827e5dff68d34d69971f8a9b1"
1227 | },
1228 | "manager": "conda",
1229 | "name": "pure_eval",
1230 | "platform": "osx-arm64",
1231 | "url": "https://repo.anaconda.com/pkgs/main/noarch/pure_eval-0.2.2-pyhd3eb1b0_0.conda",
1232 | "version": "0.2.2"
1233 | },
1234 | {
1235 | "channel": "pkgs/main",
1236 | "hash": {
1237 | "md5": "135a72ff2a31150a3a3ff0b1edd41ca9"
1238 | },
1239 | "manager": "conda",
1240 | "name": "pycparser",
1241 | "platform": "osx-arm64",
1242 | "url": "https://repo.anaconda.com/pkgs/main/noarch/pycparser-2.21-pyhd3eb1b0_0.conda",
1243 | "version": "2.21"
1244 | },
1245 | {
1246 | "channel": "pypi",
1247 | "editable": false,
1248 | "hash": {
1249 | "sha256": "bc3ddf669d234f4220e6e1c4d96b061abe0998185a8d7855c0126782b7abc8c1"
1250 | },
1251 | "manager": "pip",
1252 | "name": "pydantic",
1253 | "pip_name": "pydantic",
1254 | "platform": "osx-arm64",
1255 | "requested": false,
1256 | "url": "https://files.pythonhosted.org/packages/73/66/0a72c9fcde42e5650c8d8d5c5c1873b9a3893018020c77ca8eb62708b923/pydantic-2.4.2-py3-none-any.whl",
1257 | "version": "2.4.2"
1258 | },
1259 | {
1260 | "channel": "pypi",
1261 | "editable": false,
1262 | "hash": {
1263 | "sha256": "600d04a7b342363058b9190d4e929a8e2e715c5682a70cc37d5ded1e0dd370b4"
1264 | },
1265 | "manager": "pip",
1266 | "name": "pydantic-core",
1267 | "pip_name": "pydantic_core",
1268 | "platform": "osx-arm64",
1269 | "requested": false,
1270 | "url": "https://files.pythonhosted.org/packages/8d/ab/baf66342f1d18228ed3e54a05308b967c3de3692517f3237c570447e6256/pydantic_core-2.10.1-cp311-cp311-macosx_11_0_arm64.whl",
1271 | "version": "2.10.1"
1272 | },
1273 | {
1274 | "channel": "pkgs/main",
1275 | "hash": {
1276 | "md5": "fa6ee029a0f33955984a42d00db53ef2"
1277 | },
1278 | "manager": "conda",
1279 | "name": "pygments",
1280 | "platform": "osx-arm64",
1281 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/pygments-2.15.1-py311hca03da5_1.conda",
1282 | "version": "2.15.1"
1283 | },
1284 | {
1285 | "channel": "pkgs/main",
1286 | "hash": {
1287 | "md5": "3704922fef73c7cfce4b31a137bd536c"
1288 | },
1289 | "manager": "conda",
1290 | "name": "pyopenssl",
1291 | "platform": "osx-arm64",
1292 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/pyopenssl-23.2.0-py311hca03da5_0.conda",
1293 | "version": "23.2.0"
1294 | },
1295 | {
1296 | "channel": "pkgs/main",
1297 | "hash": {
1298 | "md5": "b8e435f733b095407a492c6e9680d3d8"
1299 | },
1300 | "manager": "conda",
1301 | "name": "pyqt",
1302 | "platform": "osx-arm64",
1303 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/pyqt-5.15.10-py311h313beb8_0.conda",
1304 | "version": "5.15.10"
1305 | },
1306 | {
1307 | "channel": "pkgs/main",
1308 | "hash": {
1309 | "md5": "955c19bb564ce1ebc179543da02fac3c"
1310 | },
1311 | "manager": "conda",
1312 | "name": "pyqt5-sip",
1313 | "platform": "osx-arm64",
1314 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/pyqt5-sip-12.13.0-py311h80987f9_0.conda",
1315 | "version": "12.13.0"
1316 | },
1317 | {
1318 | "channel": "pkgs/main",
1319 | "hash": {
1320 | "md5": "dd1105b41c76f0aec712db271d00a601"
1321 | },
1322 | "manager": "conda",
1323 | "name": "pysocks",
1324 | "platform": "osx-arm64",
1325 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/pysocks-1.7.1-py311hca03da5_0.conda",
1326 | "version": "1.7.1"
1327 | },
1328 | {
1329 | "channel": "pkgs/main",
1330 | "hash": {
1331 | "md5": "6f528bdf159139704ab578df329dee70"
1332 | },
1333 | "manager": "conda",
1334 | "name": "python",
1335 | "platform": "osx-arm64",
1336 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/python-3.11.5-hb885b13_0.conda",
1337 | "version": "3.11.5"
1338 | },
1339 | {
1340 | "channel": "pkgs/main",
1341 | "hash": {
1342 | "md5": "211ee00320b08a1ac9fea6677649f6c9"
1343 | },
1344 | "manager": "conda",
1345 | "name": "python-dateutil",
1346 | "platform": "osx-arm64",
1347 | "url": "https://repo.anaconda.com/pkgs/main/noarch/python-dateutil-2.8.2-pyhd3eb1b0_0.conda",
1348 | "version": "2.8.2"
1349 | },
1350 | {
1351 | "channel": "pkgs/main",
1352 | "hash": {
1353 | "md5": "4bb9c8c67c1aa51935f777c1b695802f"
1354 | },
1355 | "manager": "conda",
1356 | "name": "python-fastjsonschema",
1357 | "platform": "osx-arm64",
1358 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/python-fastjsonschema-2.16.2-py311hca03da5_0.conda",
1359 | "version": "2.16.2"
1360 | },
1361 | {
1362 | "channel": "pkgs/main",
1363 | "hash": {
1364 | "md5": "000bb62329a95f1ea426e73ca0969a4d"
1365 | },
1366 | "manager": "conda",
1367 | "name": "python-json-logger",
1368 | "platform": "osx-arm64",
1369 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/python-json-logger-2.0.7-py311hca03da5_0.conda",
1370 | "version": "2.0.7"
1371 | },
1372 | {
1373 | "channel": "pypi",
1374 | "editable": false,
1375 | "hash": {
1376 | "sha256": "ec2e69292c0b7c338a07df5e15b05270be6823675c103383e74d1d531945eab5"
1377 | },
1378 | "manager": "pip",
1379 | "name": "python-ulid",
1380 | "pip_name": "python-ulid",
1381 | "platform": "osx-arm64",
1382 | "requested": false,
1383 | "url": "https://files.pythonhosted.org/packages/25/ae/f820dd4c18d7698f4ea411b1ff066ff135ca87a203d5301bd4d54f8355fb/python_ulid-2.2.0-py3-none-any.whl",
1384 | "version": "2.2.0"
1385 | },
1386 | {
1387 | "channel": "pkgs/main",
1388 | "hash": {
1389 | "md5": "d46f8058a82d5e501af20161a7084c41"
1390 | },
1391 | "manager": "conda",
1392 | "name": "pytz",
1393 | "platform": "osx-arm64",
1394 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/pytz-2023.3.post1-py311hca03da5_0.conda",
1395 | "version": "2023.3.post1"
1396 | },
1397 | {
1398 | "channel": "pkgs/main",
1399 | "hash": {
1400 | "md5": "28672e5788ea68751bf264f8589e055e"
1401 | },
1402 | "manager": "conda",
1403 | "name": "pyyaml",
1404 | "platform": "osx-arm64",
1405 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/pyyaml-6.0.1-py311h80987f9_0.conda",
1406 | "version": "6.0.1"
1407 | },
1408 | {
1409 | "channel": "pkgs/main",
1410 | "hash": {
1411 | "md5": "42b3fd6afcf1a3b8b6c3c6ab0897d62a"
1412 | },
1413 | "manager": "conda",
1414 | "name": "pyzmq",
1415 | "platform": "osx-arm64",
1416 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/pyzmq-23.2.0-py311h313beb8_0.conda",
1417 | "version": "23.2.0"
1418 | },
1419 | {
1420 | "channel": "pkgs/main",
1421 | "hash": {
1422 | "md5": "563acbf6b27a1225ce10f5e775d1196f"
1423 | },
1424 | "manager": "conda",
1425 | "name": "qt-main",
1426 | "platform": "osx-arm64",
1427 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/qt-main-5.15.2-h0917680_10.conda",
1428 | "version": "5.15.2"
1429 | },
1430 | {
1431 | "channel": "pkgs/main",
1432 | "hash": {
1433 | "md5": "eba9dbeb9d05c1b504002001e5754fe5"
1434 | },
1435 | "manager": "conda",
1436 | "name": "qtconsole",
1437 | "platform": "osx-arm64",
1438 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/qtconsole-5.4.2-py311hca03da5_0.conda",
1439 | "version": "5.4.2"
1440 | },
1441 | {
1442 | "channel": "pkgs/main",
1443 | "hash": {
1444 | "md5": "b242f91ad7787c79c4b0065ec6b716d0"
1445 | },
1446 | "manager": "conda",
1447 | "name": "qtpy",
1448 | "platform": "osx-arm64",
1449 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/qtpy-2.2.0-py311hca03da5_0.conda",
1450 | "version": "2.2.0"
1451 | },
1452 | {
1453 | "channel": "pkgs/main",
1454 | "hash": {
1455 | "md5": "8e3d8eb62e32065d41fad9a83a901254"
1456 | },
1457 | "manager": "conda",
1458 | "name": "readline",
1459 | "platform": "osx-arm64",
1460 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/readline-8.2-h1a28f6b_0.conda",
1461 | "version": "8.2"
1462 | },
1463 | {
1464 | "channel": "pkgs/main",
1465 | "hash": {
1466 | "md5": "51139728201fb7c2f45618cf4bff869e"
1467 | },
1468 | "manager": "conda",
1469 | "name": "referencing",
1470 | "platform": "osx-arm64",
1471 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/referencing-0.30.2-py311hca03da5_0.conda",
1472 | "version": "0.30.2"
1473 | },
1474 | {
1475 | "channel": "pkgs/main",
1476 | "hash": {
1477 | "md5": "09147c44b0139f136835248dbdbc363e"
1478 | },
1479 | "manager": "conda",
1480 | "name": "requests",
1481 | "platform": "osx-arm64",
1482 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/requests-2.31.0-py311hca03da5_0.conda",
1483 | "version": "2.31.0"
1484 | },
1485 | {
1486 | "channel": "pkgs/main",
1487 | "hash": {
1488 | "md5": "c84f3adbb427425d75085bf5a62621fe"
1489 | },
1490 | "manager": "conda",
1491 | "name": "rfc3339-validator",
1492 | "platform": "osx-arm64",
1493 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/rfc3339-validator-0.1.4-py311hca03da5_0.conda",
1494 | "version": "0.1.4"
1495 | },
1496 | {
1497 | "channel": "pkgs/main",
1498 | "hash": {
1499 | "md5": "4b04d61de7683cd194bc46603283b96c"
1500 | },
1501 | "manager": "conda",
1502 | "name": "rfc3986-validator",
1503 | "platform": "osx-arm64",
1504 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/rfc3986-validator-0.1.1-py311hca03da5_0.conda",
1505 | "version": "0.1.1"
1506 | },
1507 | {
1508 | "channel": "pkgs/main",
1509 | "hash": {
1510 | "md5": "2d1661cb753628be871953750309b80a"
1511 | },
1512 | "manager": "conda",
1513 | "name": "rpds-py",
1514 | "platform": "osx-arm64",
1515 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/rpds-py-0.10.6-py311hf0e4da2_0.conda",
1516 | "version": "0.10.6"
1517 | },
1518 | {
1519 | "channel": "pkgs/main",
1520 | "hash": {
1521 | "md5": "bfa3c5c61a5a91e528a1d2d1e3cae6c9"
1522 | },
1523 | "manager": "conda",
1524 | "name": "send2trash",
1525 | "platform": "osx-arm64",
1526 | "url": "https://repo.anaconda.com/pkgs/main/noarch/send2trash-1.8.0-pyhd3eb1b0_1.conda",
1527 | "version": "1.8.0"
1528 | },
1529 | {
1530 | "channel": "pkgs/main",
1531 | "hash": {
1532 | "md5": "9af82418d19df4adc64eda629707a096"
1533 | },
1534 | "manager": "conda",
1535 | "name": "setuptools",
1536 | "platform": "osx-arm64",
1537 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/setuptools-68.0.0-py311hca03da5_0.conda",
1538 | "version": "68.0.0"
1539 | },
1540 | {
1541 | "channel": "pkgs/main",
1542 | "hash": {
1543 | "md5": "921f4b54eeddca91efeab3114ef4fab0"
1544 | },
1545 | "manager": "conda",
1546 | "name": "sip",
1547 | "platform": "osx-arm64",
1548 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/sip-6.7.12-py311h313beb8_0.conda",
1549 | "version": "6.7.12"
1550 | },
1551 | {
1552 | "channel": "pkgs/main",
1553 | "hash": {
1554 | "md5": "34586824d411d36af2fa40e799c172d0"
1555 | },
1556 | "manager": "conda",
1557 | "name": "six",
1558 | "platform": "osx-arm64",
1559 | "url": "https://repo.anaconda.com/pkgs/main/noarch/six-1.16.0-pyhd3eb1b0_1.conda",
1560 | "version": "1.16.0"
1561 | },
1562 | {
1563 | "channel": "pkgs/main",
1564 | "hash": {
1565 | "md5": "34aa8f42911151382c497353f1c70798"
1566 | },
1567 | "manager": "conda",
1568 | "name": "sniffio",
1569 | "platform": "osx-arm64",
1570 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/sniffio-1.2.0-py311hca03da5_1.conda",
1571 | "version": "1.2.0"
1572 | },
1573 | {
1574 | "channel": "pkgs/main",
1575 | "hash": {
1576 | "md5": "409e4a769827754f5cf7fac261752e80"
1577 | },
1578 | "manager": "conda",
1579 | "name": "soupsieve",
1580 | "platform": "osx-arm64",
1581 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/soupsieve-2.5-py311hca03da5_0.conda",
1582 | "version": "2.5"
1583 | },
1584 | {
1585 | "channel": "pkgs/main",
1586 | "hash": {
1587 | "md5": "31674bcba2e09766717f0d7d1ecee30a"
1588 | },
1589 | "manager": "conda",
1590 | "name": "sqlite",
1591 | "platform": "osx-arm64",
1592 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/sqlite-3.41.2-h80987f9_0.conda",
1593 | "version": "3.41.2"
1594 | },
1595 | {
1596 | "channel": "pypi",
1597 | "editable": false,
1598 | "hash": {
1599 | "sha256": "0359edd8dea6fd73c848989e1e2b1f31a50fe5f9d7272299ff0e8dbaa62d035f"
1600 | },
1601 | "manager": "pip",
1602 | "name": "sqlite-fts4",
1603 | "pip_name": "sqlite-fts4",
1604 | "platform": "osx-arm64",
1605 | "requested": false,
1606 | "url": "https://files.pythonhosted.org/packages/51/29/0096e8b1811aaa78cfb296996f621f41120c21c2f5cd448ae1d54979d9fc/sqlite_fts4-1.0.3-py3-none-any.whl",
1607 | "version": "1.0.3"
1608 | },
1609 | {
1610 | "channel": "pypi",
1611 | "editable": false,
1612 | "hash": {
1613 | "sha256": "a4125e35e1de3dc56b6b6ec60e9833ce0ce20192b929ddcb2d4246c5098859c6"
1614 | },
1615 | "manager": "pip",
1616 | "name": "sqlite-migrate",
1617 | "pip_name": "sqlite-migrate",
1618 | "platform": "osx-arm64",
1619 | "requested": false,
1620 | "url": "https://files.pythonhosted.org/packages/df/92/994545b912e6d6feb40323047f02ca039321e690aa2c27afcd5c4105e37b/sqlite_migrate-0.1b0-py3-none-any.whl",
1621 | "version": "0.1b0"
1622 | },
1623 | {
1624 | "channel": "pypi",
1625 | "editable": false,
1626 | "hash": {
1627 | "sha256": "afd7df2d248adb9a107695ad73a9abf39b1a4913a80e6915f696ca7420d42a16"
1628 | },
1629 | "manager": "pip",
1630 | "name": "sqlite-utils",
1631 | "pip_name": "sqlite-utils",
1632 | "platform": "osx-arm64",
1633 | "requested": false,
1634 | "url": "https://files.pythonhosted.org/packages/8f/dd/c7d310fe9373c6d8209e457427d92513f5a2d64b51dd70b7cbfd1713fad6/sqlite_utils-3.35.2-py3-none-any.whl",
1635 | "version": "3.35.2"
1636 | },
1637 | {
1638 | "channel": "pkgs/main",
1639 | "hash": {
1640 | "md5": "6212968e73726f6da42e5ffcd2bea92d"
1641 | },
1642 | "manager": "conda",
1643 | "name": "stack_data",
1644 | "platform": "osx-arm64",
1645 | "url": "https://repo.anaconda.com/pkgs/main/noarch/stack_data-0.2.0-pyhd3eb1b0_0.conda",
1646 | "version": "0.2.0"
1647 | },
1648 | {
1649 | "channel": "pypi",
1650 | "editable": false,
1651 | "hash": {
1652 | "sha256": "024ca478df22e9340661486f85298cff5f6dcdba14f3813e8830015b9ed1948f"
1653 | },
1654 | "manager": "pip",
1655 | "name": "tabulate",
1656 | "pip_name": "tabulate",
1657 | "platform": "osx-arm64",
1658 | "requested": false,
1659 | "url": "https://files.pythonhosted.org/packages/40/44/4a5f08c96eb108af5cb50b41f76142f0afa346dfa99d5296fe7202a11854/tabulate-0.9.0-py3-none-any.whl",
1660 | "version": "0.9.0"
1661 | },
1662 | {
1663 | "channel": "pkgs/main",
1664 | "hash": {
1665 | "md5": "e3260f4d9eda90ef848d2f5c73329a1f"
1666 | },
1667 | "manager": "conda",
1668 | "name": "terminado",
1669 | "platform": "osx-arm64",
1670 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/terminado-0.17.1-py311hca03da5_0.conda",
1671 | "version": "0.17.1"
1672 | },
1673 | {
1674 | "channel": "pkgs/main",
1675 | "hash": {
1676 | "md5": "f8b9cc1a9205bdc40818a441ae6c46cd"
1677 | },
1678 | "manager": "conda",
1679 | "name": "tinycss2",
1680 | "platform": "osx-arm64",
1681 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/tinycss2-1.2.1-py311hca03da5_0.conda",
1682 | "version": "1.2.1"
1683 | },
1684 | {
1685 | "channel": "pkgs/main",
1686 | "hash": {
1687 | "md5": "012a1790e696759768ea3dd5ed84fdfb"
1688 | },
1689 | "manager": "conda",
1690 | "name": "tk",
1691 | "platform": "osx-arm64",
1692 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/tk-8.6.12-hb8d0fd4_0.conda",
1693 | "version": "8.6.12"
1694 | },
1695 | {
1696 | "channel": "pkgs/main",
1697 | "hash": {
1698 | "md5": "8f158324cb595df52b3de10f6057af5c"
1699 | },
1700 | "manager": "conda",
1701 | "name": "tornado",
1702 | "platform": "osx-arm64",
1703 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/tornado-6.3.3-py311h80987f9_0.conda",
1704 | "version": "6.3.3"
1705 | },
1706 | {
1707 | "channel": "pypi",
1708 | "editable": false,
1709 | "hash": {
1710 | "sha256": "d302b3c5b53d47bce91fea46679d9c3c6508cf6332229aa1e7d8653723793386"
1711 | },
1712 | "manager": "pip",
1713 | "name": "tqdm",
1714 | "pip_name": "tqdm",
1715 | "platform": "osx-arm64",
1716 | "requested": false,
1717 | "url": "https://files.pythonhosted.org/packages/00/e5/f12a80907d0884e6dff9c16d0c0114d81b8cd07dc3ae54c5e962cc83037e/tqdm-4.66.1-py3-none-any.whl",
1718 | "version": "4.66.1"
1719 | },
1720 | {
1721 | "channel": "pkgs/main",
1722 | "hash": {
1723 | "md5": "b979764eb8509d7fc07723fe6341da69"
1724 | },
1725 | "manager": "conda",
1726 | "name": "traitlets",
1727 | "platform": "osx-arm64",
1728 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/traitlets-5.7.1-py311hca03da5_0.conda",
1729 | "version": "5.7.1"
1730 | },
1731 | {
1732 | "channel": "pkgs/main",
1733 | "hash": {
1734 | "md5": "7f98c280129431cd201f535441340c3d"
1735 | },
1736 | "manager": "conda",
1737 | "name": "typing-extensions",
1738 | "platform": "osx-arm64",
1739 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/typing-extensions-4.7.1-py311hca03da5_0.conda",
1740 | "version": "4.7.1"
1741 | },
1742 | {
1743 | "channel": "pkgs/main",
1744 | "hash": {
1745 | "md5": "8eb919cf91a9bb57150a30c44b9e7e60"
1746 | },
1747 | "manager": "conda",
1748 | "name": "typing_extensions",
1749 | "platform": "osx-arm64",
1750 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/typing_extensions-4.7.1-py311hca03da5_0.conda",
1751 | "version": "4.7.1"
1752 | },
1753 | {
1754 | "channel": "pkgs/main",
1755 | "hash": {
1756 | "md5": "29db02adf8808f7c64642cead3e28acd"
1757 | },
1758 | "manager": "conda",
1759 | "name": "tzdata",
1760 | "platform": "osx-arm64",
1761 | "url": "https://repo.anaconda.com/pkgs/main/noarch/tzdata-2023c-h04d1e81_0.conda",
1762 | "version": "2023c"
1763 | },
1764 | {
1765 | "channel": "pkgs/main",
1766 | "hash": {
1767 | "md5": "e948a21099d30ac4364e5f01f4d91f05"
1768 | },
1769 | "manager": "conda",
1770 | "name": "urllib3",
1771 | "platform": "osx-arm64",
1772 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/urllib3-1.26.18-py311hca03da5_0.conda",
1773 | "version": "1.26.18"
1774 | },
1775 | {
1776 | "channel": "pkgs/main",
1777 | "hash": {
1778 | "md5": "ffa649340272c3f6466ba01da254c3b0"
1779 | },
1780 | "manager": "conda",
1781 | "name": "wcwidth",
1782 | "platform": "osx-arm64",
1783 | "url": "https://repo.anaconda.com/pkgs/main/noarch/wcwidth-0.2.5-pyhd3eb1b0_0.conda",
1784 | "version": "0.2.5"
1785 | },
1786 | {
1787 | "channel": "pkgs/main",
1788 | "hash": {
1789 | "md5": "2376058d4306dfc4158f2f1ad411d202"
1790 | },
1791 | "manager": "conda",
1792 | "name": "webencodings",
1793 | "platform": "osx-arm64",
1794 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/webencodings-0.5.1-py311hca03da5_1.conda",
1795 | "version": "0.5.1"
1796 | },
1797 | {
1798 | "channel": "pkgs/main",
1799 | "hash": {
1800 | "md5": "491159d1f134d202d45e063449044d89"
1801 | },
1802 | "manager": "conda",
1803 | "name": "websocket-client",
1804 | "platform": "osx-arm64",
1805 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/websocket-client-0.58.0-py311hca03da5_4.conda",
1806 | "version": "0.58.0"
1807 | },
1808 | {
1809 | "channel": "pkgs/main",
1810 | "hash": {
1811 | "md5": "546bf47c4c259b31163b3bc3a4b4f287"
1812 | },
1813 | "manager": "conda",
1814 | "name": "wheel",
1815 | "platform": "osx-arm64",
1816 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/wheel-0.41.2-py311hca03da5_0.conda",
1817 | "version": "0.41.2"
1818 | },
1819 | {
1820 | "channel": "pkgs/main",
1821 | "hash": {
1822 | "md5": "6fa4be86ed2d1e65b7d52926e652f91d"
1823 | },
1824 | "manager": "conda",
1825 | "name": "widgetsnbextension",
1826 | "platform": "osx-arm64",
1827 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/widgetsnbextension-4.0.5-py311hca03da5_0.conda",
1828 | "version": "4.0.5"
1829 | },
1830 | {
1831 | "channel": "pkgs/main",
1832 | "hash": {
1833 | "md5": "4f0a282d2f583900877fdfc832c0070a"
1834 | },
1835 | "manager": "conda",
1836 | "name": "xz",
1837 | "platform": "osx-arm64",
1838 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/xz-5.4.2-h80987f9_0.conda",
1839 | "version": "5.4.2"
1840 | },
1841 | {
1842 | "channel": "pkgs/main",
1843 | "hash": {
1844 | "md5": "b38b5654e625a4221226dbd5993e1c33"
1845 | },
1846 | "manager": "conda",
1847 | "name": "y-py",
1848 | "platform": "osx-arm64",
1849 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/y-py-0.5.9-py311ha6e5c4f_0.conda",
1850 | "version": "0.5.9"
1851 | },
1852 | {
1853 | "channel": "pkgs/main",
1854 | "hash": {
1855 | "md5": "23a9bda10db68f27fac5c379466c98b7"
1856 | },
1857 | "manager": "conda",
1858 | "name": "yaml",
1859 | "platform": "osx-arm64",
1860 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/yaml-0.2.5-h1a28f6b_0.conda",
1861 | "version": "0.2.5"
1862 | },
1863 | {
1864 | "channel": "pypi",
1865 | "editable": false,
1866 | "hash": {
1867 | "sha256": "a83503934c6273806aed765035716216cc9ab4e0364f7f066227e1aaea90b8d0"
1868 | },
1869 | "manager": "pip",
1870 | "name": "yarl",
1871 | "pip_name": "yarl",
1872 | "platform": "osx-arm64",
1873 | "requested": false,
1874 | "url": "https://files.pythonhosted.org/packages/b3/81/fb394392ec748d8fce66212b29dc2fd9b2fd8e30d56d818a6a866708e534/yarl-1.9.2-cp311-cp311-macosx_11_0_arm64.whl",
1875 | "version": "1.9.2"
1876 | },
1877 | {
1878 | "channel": "pkgs/main",
1879 | "hash": {
1880 | "md5": "0078b7c0f20b19f881a0c9d55e2517dd"
1881 | },
1882 | "manager": "conda",
1883 | "name": "ypy-websocket",
1884 | "platform": "osx-arm64",
1885 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/ypy-websocket-0.8.2-py311hca03da5_0.conda",
1886 | "version": "0.8.2"
1887 | },
1888 | {
1889 | "channel": "pkgs/main",
1890 | "hash": {
1891 | "md5": "a7639e00305a8b8bb62ee68bca9512de"
1892 | },
1893 | "manager": "conda",
1894 | "name": "zeromq",
1895 | "platform": "osx-arm64",
1896 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/zeromq-4.3.4-hc377ac9_0.conda",
1897 | "version": "4.3.4"
1898 | },
1899 | {
1900 | "channel": "pkgs/main",
1901 | "hash": {
1902 | "md5": "f37216c0dea34741707510529ef366bf"
1903 | },
1904 | "manager": "conda",
1905 | "name": "zlib",
1906 | "platform": "osx-arm64",
1907 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/zlib-1.2.13-h5a0b063_0.conda",
1908 | "version": "1.2.13"
1909 | },
1910 | {
1911 | "channel": "pkgs/main",
1912 | "hash": {
1913 | "md5": "59f3fb046afe70ddf9ddbeabe8c83f03"
1914 | },
1915 | "manager": "conda",
1916 | "name": "zstd",
1917 | "platform": "osx-arm64",
1918 | "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/zstd-1.5.5-hd90d995_0.conda",
1919 | "version": "1.5.5"
1920 | }
1921 | ]
--------------------------------------------------------------------------------
/llm_ai_eo.ipynb:
--------------------------------------------------------------------------------
1 | {
2 | "cells": [
3 | {
4 | "cell_type": "markdown",
5 | "metadata": {
6 | "id": "JNybamzxkYle"
7 | },
8 | "source": [
9 | "# Language Models on the AI Executive Order\n",
10 | "\n",
11 | "_2023-11-01_\n",
12 | "\n",
13 | "**By Matt Hodges**\n",
14 | "\n",
15 | "\n",
16 | "\n",
17 | "On October 30th, 2023, President Biden signed the [Executive Order on the Safe, Secure, and Trustworthy Development and Use of Artificial Intelligence](https://www.whitehouse.gov/briefing-room/presidential-actions/2023/10/30/executive-order-on-the-safe-secure-and-trustworthy-development-and-use-of-artificial-intelligence/). The order itself is quite sweeping and touches many government departments and agencies, with a focus on harnessing AI's potential and defending against harms and risks.\n",
18 | "\n",
19 | "In this Notebook, we'll deploy language models to rapidly discover information from the Order. For the easiest setup, I recommend trying this out in a Google Colab notebook.\n",
20 | "\n",
21 | "\n",
22 | "
\n",
23 | " \n",
24 | "
\n",
25 | "\n",
26 | "\n",
27 | "\n",
28 | "Many of the strategies presented here are extensions from Simon Willison's work in his blog post, [Embedding paragraphs from my blog with E5-large-v2](https://til.simonwillison.net/llms/embed-paragraphs). Simon also maintains a handy command line utility for working with various LLM models, aptly named [LLM](https://llm.datasette.io/en/stable/). While Simon's writing largely focuses on the CLI capabilities of the tool (and the usefully opinionated integrations with SQLite), I prefer working with Pandas Dataframes. Here I show how to use the LLM library in that fashion.\n",
29 | "\n",
30 | "Embeddings are kindof a magic black box to end users, but the basic idea is that language models can create vectors or numerical values that represent not only words or sentences, but also the symantic _meaning_ of those words. Early research on this subject comes from [word2vec](https://code.google.com/archive/p/word2vec/). To illustrate: `vector('king') - vector('man') + vector('woman')` is mathematically close to `vector('queen')`. I find that _fascinating_! We'll use this concept to extract and match information against the Executive Order text.\n",
31 | "\n",
32 | "We'll deploy a technique known as [Retrieval-Augmented Generation](https://research.ibm.com/blog/retrieval-augmented-generation-RAG). From a high level, this allows us to inject context into a LLM without training or tuning it. We use another system to locate language that likely contains the answer to our query, and then ask the model to pull it out for us.\n",
33 | "\n",
34 | "Our high livel strategy:\n",
35 | "\n",
36 | "1. Calculate embeddings on the Executive Order text\n",
37 | "2. Calculate embeddings on a query\n",
38 | "3. Calculate the cosine similarity between every text embedding and the query\n",
39 | "4. Select the top three passages that are symantically similar to the query\n",
40 | "5. Pass the passages and the query to the LLM for rapid summarization"
41 | ]
42 | },
43 | {
44 | "cell_type": "markdown",
45 | "metadata": {
46 | "id": "J1LUmd2b389L"
47 | },
48 | "source": [
49 | "## Environment\n",
50 | "\n",
51 | "First install the dependencies, which include the [MLC LLaMA 2 model](https://mlc.ai) for summarization, the [LLM](https://llm.datasette.io/en/stable/) library, and the [E5-large-v2](https://huggingface.co/intfloat/e5-large-v2) language model for text embedding.\n",
52 | "\n",
53 | "Note, these models are constantly changing, and getting them up and running on your system might take some independent investigation. If running in Google Colab, check [this tutorial for MLC](https://colab.research.google.com/github/mlc-ai/notebooks/blob/main/mlc-llm/tutorial_chat_module_getting_started.ipynb). If running LLaMA with the LLM library on macOS, check the [repository's instructions](https://github.com/simonw/llm-mlc)."
54 | ]
55 | },
56 | {
57 | "cell_type": "code",
58 | "execution_count": 1,
59 | "metadata": {
60 | "id": "sIzBYwQ8pwMn"
61 | },
62 | "outputs": [],
63 | "source": [
64 | "%%capture\n",
65 | "!pip install --pre -U -f https://mlc.ai/wheels mlc-chat-nightly-cu118 mlc-ai-nightly-cu118\n",
66 | "!git lfs install\n",
67 | "!pip install llm\n",
68 | "!llm install llm-sentence-transformers\n",
69 | "!llm sentence-transformers register intfloat/e5-large-v2 -a lv2\n",
70 | "!llm install llm-mlc\n",
71 | "!llm mlc setup\n",
72 | "!llm mlc download-model Llama-2-7b-chat --alias llama2"
73 | ]
74 | },
75 | {
76 | "cell_type": "markdown",
77 | "metadata": {
78 | "id": "8QTWciCG5yu-"
79 | },
80 | "source": [
81 | "## Load Data\n",
82 | "\n",
83 | "Before getting started, we need the Executive Order text to work against. This is probably the least interesting part of this Notebook. I simply opened the Order in Firefox reader view, copy+pasted it into VSCode, did some manual find/replace to clean up the white space, and then concatenated paragraphs to get chunks as close to 400 words as I could. I picked 400 because the embedding model truncates at 512 _tokens_ and a token is either a word or a symantically important subset of a word, so I allowed for some buffer. _This took less than half an hour._ Rather than share code to do this work, I simply provide the cleaned text here.\n",
84 | "\n",
85 | "Load it into a Pandas Dataframe with a single column:\n",
86 | "\n"
87 | ]
88 | },
89 | {
90 | "cell_type": "code",
91 | "execution_count": 2,
92 | "metadata": {
93 | "colab": {
94 | "base_uri": "https://localhost:8080/",
95 | "height": 206
96 | },
97 | "id": "sGtlIXT9rlYd",
98 | "outputId": "92403b5b-d45a-4485-e6bd-bc26b23d6f38"
99 | },
100 | "outputs": [
101 | {
102 | "data": {
103 | "text/html": [
104 | "\n",
105 | "
\n",
106 | "
\n",
107 | "\n",
120 | "
\n",
121 | " \n",
122 | " \n",
123 | " | \n",
124 | " passage | \n",
125 | "
\n",
126 | " \n",
127 | " \n",
128 | " \n",
129 | " | 0 | \n",
130 | " By the authority vested in me as President by ... | \n",
131 | "
\n",
132 | " \n",
133 | " | 1 | \n",
134 | " (a) Artificial Intelligence must be safe and s... | \n",
135 | "
\n",
136 | " \n",
137 | " | 2 | \n",
138 | " (c) The responsible development and use of AI ... | \n",
139 | "
\n",
140 | " \n",
141 | " | 3 | \n",
142 | " (e) The interests of Americans who increasingl... | \n",
143 | "
\n",
144 | " \n",
145 | " | 4 | \n",
146 | " (g) It is important to manage the risks from t... | \n",
147 | "
\n",
148 | " \n",
149 | "
\n",
150 | "
\n",
151 | "
\n",
358 | "
\n"
359 | ],
360 | "text/plain": [
361 | " passage\n",
362 | "0 By the authority vested in me as President by ...\n",
363 | "1 (a) Artificial Intelligence must be safe and s...\n",
364 | "2 (c) The responsible development and use of AI ...\n",
365 | "3 (e) The interests of Americans who increasingl...\n",
366 | "4 (g) It is important to manage the risks from t..."
367 | ]
368 | },
369 | "execution_count": 2,
370 | "metadata": {},
371 | "output_type": "execute_result"
372 | }
373 | ],
374 | "source": [
375 | "import pandas as pd\n",
376 | "\n",
377 | "df = pd.read_csv(\n",
378 | " \"https://raw.githubusercontent.com/hodgesmr/llm_ai_eo/main/eo.txt\",\n",
379 | " sep=\"_\", # trick to let us read the lines into a Dataframe; '_' not present\n",
380 | " header=None,\n",
381 | ")\n",
382 | "df.columns = [\"passage\"]\n",
383 | "\n",
384 | "df.head()"
385 | ]
386 | },
387 | {
388 | "cell_type": "markdown",
389 | "metadata": {
390 | "id": "fXNcfiwh6qvM"
391 | },
392 | "source": [
393 | "## Calculate Embeddings\n",
394 | "\n",
395 | "Now that we have a Dataframe of chunks of the Executive Order, we can calculate embeddings of each chunk. To do this we'll use the [E5-large-v2](https://huggingface.co/intfloat/e5-large-v2) language model, which was trained to handle text prefixed with either `passage: ` or `query: `. Every chunk is considered a passage. We'll add this as another column on our Dataframe."
396 | ]
397 | },
398 | {
399 | "cell_type": "code",
400 | "execution_count": 3,
401 | "metadata": {
402 | "colab": {
403 | "base_uri": "https://localhost:8080/",
404 | "height": 206
405 | },
406 | "id": "ThUfh3Nsr432",
407 | "outputId": "6873d0fd-ff28-45c2-9b7c-d2474e1f1a9d"
408 | },
409 | "outputs": [
410 | {
411 | "data": {
412 | "text/html": [
413 | "\n",
414 | " \n",
415 | "
\n",
416 | "\n",
429 | "
\n",
430 | " \n",
431 | " \n",
432 | " | \n",
433 | " passage | \n",
434 | " embedding | \n",
435 | "
\n",
436 | " \n",
437 | " \n",
438 | " \n",
439 | " | 0 | \n",
440 | " By the authority vested in me as President by ... | \n",
441 | " [0.032344698905944824, -0.04333016648888588, 0... | \n",
442 | "
\n",
443 | " \n",
444 | " | 1 | \n",
445 | " (a) Artificial Intelligence must be safe and s... | \n",
446 | " [0.01886950619518757, -0.057347141206264496, 0... | \n",
447 | "
\n",
448 | " \n",
449 | " | 2 | \n",
450 | " (c) The responsible development and use of AI ... | \n",
451 | " [0.0486459881067276, -0.0712570995092392, 0.02... | \n",
452 | "
\n",
453 | " \n",
454 | " | 3 | \n",
455 | " (e) The interests of Americans who increasingl... | \n",
456 | " [0.03564070537686348, -0.04887280985713005, 0.... | \n",
457 | "
\n",
458 | " \n",
459 | " | 4 | \n",
460 | " (g) It is important to manage the risks from t... | \n",
461 | " [0.04095401614904404, -0.042341429740190506, 0... | \n",
462 | "
\n",
463 | " \n",
464 | "
\n",
465 | "
\n",
466 | "
\n",
673 | "
\n"
674 | ],
675 | "text/plain": [
676 | " passage \\\n",
677 | "0 By the authority vested in me as President by ... \n",
678 | "1 (a) Artificial Intelligence must be safe and s... \n",
679 | "2 (c) The responsible development and use of AI ... \n",
680 | "3 (e) The interests of Americans who increasingl... \n",
681 | "4 (g) It is important to manage the risks from t... \n",
682 | "\n",
683 | " embedding \n",
684 | "0 [0.032344698905944824, -0.04333016648888588, 0... \n",
685 | "1 [0.01886950619518757, -0.057347141206264496, 0... \n",
686 | "2 [0.0486459881067276, -0.0712570995092392, 0.02... \n",
687 | "3 [0.03564070537686348, -0.04887280985713005, 0.... \n",
688 | "4 [0.04095401614904404, -0.042341429740190506, 0... "
689 | ]
690 | },
691 | "execution_count": 3,
692 | "metadata": {},
693 | "output_type": "execute_result"
694 | }
695 | ],
696 | "source": [
697 | "import llm\n",
698 | "\n",
699 | "embedding_model = llm.get_embedding_model(\"lv2\")\n",
700 | "text_to_embed = df.passage.to_list()\n",
701 | "\n",
702 | "# Our embedding model expects `passage: ` prefixes\n",
703 | "text_to_embed = [f'passage: {t}' for t in text_to_embed]\n",
704 | "\n",
705 | "df['embedding'] = list(embedding_model.embed_multi(text_to_embed))\n",
706 | "\n",
707 | "df.head()"
708 | ]
709 | },
710 | {
711 | "cell_type": "markdown",
712 | "metadata": {
713 | "id": "oMC1mg8d7Zwh"
714 | },
715 | "source": [
716 | "For our symantic searching, we'll also need an embedding of our query. And the model would like that prefixed with `query: `. Let's ask what the Order says regarding AI and healthcare:"
717 | ]
718 | },
719 | {
720 | "cell_type": "code",
721 | "execution_count": 4,
722 | "metadata": {
723 | "colab": {
724 | "base_uri": "https://localhost:8080/"
725 | },
726 | "id": "bMV_ztd5y77t",
727 | "outputId": "834e16ab-688f-427f-848e-abf97deaeaa9"
728 | },
729 | "outputs": [
730 | {
731 | "name": "stdout",
732 | "output_type": "stream",
733 | "text": [
734 | "[0.011035123839974403, -0.06264020502567291, 0.036343760788440704, -0.022550513967871666, -0.004930663388222456, 0.027655886486172676, -0.04244294762611389, -0.026744479313492775, -0.022813718765974045, 0.013104002922773361, 0.027848346158862114, -0.041959188878536224, 0.02923852950334549, 0.03592933714389801, 0.02084210328757763, 0.028341282159090042, -0.02188134379684925, 0.009380431845784187, 0.010694948956370354, -0.046167585998773575, 0.04979575797915459, -0.04051537066698074, -0.04705166816711426, 0.054594166576862335, -0.021378282457590103, -0.006090054754167795, -0.027005767449736595, -0.0056915683671832085, -0.02485739439725876, 0.025049963966012, 0.0013038198230788112, 0.020098360255360603, 0.03132014721632004, -0.10214236378669739, 0.03457639366388321, -0.005869136657565832, -0.041733402758836746, -0.0533079169690609, 0.043018240481615067, 0.02142527513206005, -0.013251637108623981, 0.021434243768453598, -0.01846863329410553, 0.06185981631278992, -0.006901243235915899, -0.007515963166952133, -0.026446444913744926, -0.022192247211933136, 0.008555920794606209, -0.00683502247557044, 0.04217502102255821, -0.05847731605172157, 0.05262995511293411, 0.010208839550614357, -0.026769086718559265, -0.0054522184655070305, 0.020620698109269142, 0.04013380780816078, -0.016234276816248894, -0.013201197609305382, 0.033620886504650116, 0.00933841709047556, 0.057325609028339386, -0.039771128445863724, 0.024898990988731384, -0.04952569678425789, 0.01868751272559166, -0.009222128428518772, 0.028759649023413658, 0.04622277244925499, -0.04479452595114708, -0.007873269729316235, 0.003972833044826984, 0.08234458416700363, 0.047766849398612976, -0.04056665301322937, -0.03526405245065689, 0.028415270149707794, 0.03255781903862953, 0.03818396478891373, -0.04255992919206619, -0.0518893301486969, -0.036653585731983185, 0.020367737859487534, -0.0004731871304102242, 0.030738964676856995, -0.0012389217736199498, 0.0024446682073175907, 0.05554775893688202, 0.013511369936168194, 0.06238795816898346, 0.0018740486120805144, 0.008448319509625435, 0.03504892811179161, -0.04160211980342865, -0.00638029258698225, -0.050224918872117996, -0.005032839719206095, 0.013626458123326302, 0.008170071057975292, -0.04054887965321541, -0.027991971001029015, -0.034977927803993225, 0.014853181317448616, -0.024243168532848358, -0.02605707384645939, -0.05607284978032112, -0.00930757261812687, -0.03581421077251434, -0.0025592155288904905, -0.02390565536916256, -0.0380810908973217, -0.033349402248859406, -0.011960298754274845, -0.04205334186553955, 0.055994290858507156, 0.006477762944996357, 0.00991995818912983, 0.030702101066708565, 0.024755865335464478, 0.07455798983573914, 0.04026920348405838, -0.032499562948942184, -0.0020086164586246014, -0.035176586359739304, 0.0520380362868309, -0.04051459580659866, -0.04515765979886055, 0.04827379435300827, 0.0681162029504776, 0.01639464683830738, -0.012349777854979038, -0.024919848889112473, 0.0261624027043581, -0.0003906007332261652, 0.08279916644096375, -0.04583611711859703, -0.05605150759220123, 0.03352531045675278, 0.05521564930677414, -0.0490930899977684, -0.027380632236599922, 0.02854541875422001, 0.012674689292907715, -0.002931063063442707, -0.053501006215810776, -0.0288915503770113, -0.031300533562898636, -0.03822864219546318, -0.03784075006842613, -0.017202073708176613, -0.005835125222802162, -0.02155722677707672, -0.00019966973923146725, 0.038443099707365036, -0.055773064494132996, 0.0020749655086547136, -0.023329386487603188, -0.006293139886111021, 0.019844476133584976, 0.044987935572862625, 0.03083648905158043, -0.01008790172636509, 0.02570483647286892, 0.002781765768304467, 0.007234315853565931, 0.03924374282360077, -0.014665482565760612, -0.026686524972319603, 0.040999021381139755, 0.0032443120144307613, 0.0015701769152656198, 0.053893182426691055, 0.045284025371074677, 0.023676631972193718, 0.007213208358734846, 0.05706159397959709, -0.06629643589258194, 0.010098790749907494, -0.03431336581707001, 0.0032631983049213886, 0.021331751719117165, -0.05340828001499176, -0.022274604067206383, -0.0436270497739315, 0.019490502774715424, 0.04619332030415535, -0.03779701516032219, -0.004007418639957905, -0.03109969012439251, -0.028927365317940712, -0.01648799516260624, -0.04384511336684227, 0.02099577710032463, -0.02223723568022251, -0.03204162418842316, -0.022197725251317024, -0.011281806975603104, -0.015587741509079933, 0.041081756353378296, 0.044835954904556274, 0.005444942973554134, 0.004057107958942652, 0.0030030268244445324, 0.008095227181911469, 0.010580062866210938, 0.002692743204534054, 0.027165278792381287, -0.04451528936624527, 0.018396437168121338, -0.012467225082218647, 0.01907152123749256, 0.024384012445807457, -0.03359571844339371, 0.002541579073294997, 0.03602273389697075, 0.007620786316692829, 0.0045867254957556725, -0.004530118312686682, 0.039663612842559814, -0.07118961960077286, 0.027506954967975616, 0.010756077244877815, -0.0027250293642282486, 0.020495502278208733, 0.025394247844815254, -0.037594713270664215, 0.017433777451515198, -0.008695165626704693, -0.02986626699566841, 0.012270666658878326, 0.016099197790026665, -0.03702491894364357, -0.03618799149990082, -0.012862246483564377, -0.05321879684925079, 0.03497174754738808, -0.012480347417294979, 0.012074748054146767, 0.021339774131774902, 0.025768857449293137, 0.027273213490843773, 0.006413111928850412, -0.01951907016336918, -0.020737817510962486, 0.03631201386451721, 0.005693630315363407, 0.014690431766211987, 0.0400673933327198, 0.040662623941898346, 0.005502395331859589, 0.0173542071133852, -0.04771675169467926, 0.02629489079117775, -0.003811753587797284, -0.007251544389873743, 0.04416917636990547, -0.061770226806402206, -0.016220202669501305, 0.03719717636704445, -0.01617533341050148, -0.03763722628355026, -0.04766486957669258, -0.025192739441990852, -0.019239462912082672, -0.008094199001789093, -0.005068974103778601, -0.004565471783280373, 0.07414168119430542, -0.041430603712797165, 0.013045714236795902, 0.018361356109380722, 0.03342536836862564, -0.041664931923151016, -0.05250570923089981, -0.02396155521273613, -0.01865033246576786, -0.03515772148966789, 0.016364071518182755, -0.009918905794620514, 0.05359259247779846, -0.0008409120491705835, -0.003592758672311902, 0.030167188495397568, -0.008410172536969185, -0.002642557490617037, -0.026539165526628494, 0.003059686627238989, 0.029047558084130287, 0.01878088153898716, -0.04435497149825096, 0.004310435149818659, 0.05454620346426964, -0.009366977959871292, -0.009419695474207401, 0.031485412269830704, -0.016963956877589226, 0.007122103590518236, 0.009967380203306675, 0.024634771049022675, 0.022842811420559883, -0.0031100360210984945, -0.0643397867679596, -0.02673438936471939, -0.035047076642513275, -0.00703747384250164, 0.049209486693143845, -0.050232626497745514, 0.04699047654867172, 0.026202980428934097, -0.016680346801877022, -0.02222183719277382, -0.041290491819381714, -0.03719739243388176, -0.0399385504424572, 0.016396909952163696, -0.02527480199933052, 0.018787767738103867, 0.0006646675174124539, -0.01867998018860817, 0.03068104200065136, -0.0020506661385297775, -0.044911354780197144, -0.012430372647941113, -0.024320200085639954, 0.017804201692342758, -0.032045990228652954, -0.007124380674213171, 0.01598973572254181, 0.012343218550086021, -0.011404650285840034, -0.01943874917924404, 0.04149242863059044, -0.005655502434819937, -0.016777103766798973, -0.011175236664712429, -0.04135586693882942, -0.03618283197283745, 0.02853410318493843, 0.044518813490867615, 0.06200827658176422, 0.038675494492053986, -0.036812301725149155, -0.02377907745540142, 0.025207694619894028, 0.040055833756923676, 0.04191999137401581, 0.009881209582090378, 0.02629314549267292, 0.024176236242055893, 0.020148472860455513, 0.008412880823016167, -0.004142292309552431, -0.004587574861943722, -0.03939927741885185, -0.01107271108776331, 0.026553431525826454, -0.04704265668988228, 0.0134046645835042, 0.03654501587152481, 0.017579609528183937, -0.00949288159608841, 0.06082817539572716, -0.006728034000843763, 0.008356080390512943, -0.051711030304431915, 0.03844171389937401, -0.01830201968550682, 0.00854733120650053, 0.034922968596220016, 0.004259245935827494, 0.020917760208249092, 0.010708301328122616, -0.02309831604361534, -0.04656030982732773, -0.04652083292603493, 0.05957057699561119, 0.02332383207976818, 0.027773132547736168, -0.02072453871369362, 0.01621401123702526, 0.01397494412958622, -0.018857672810554504, -0.027436040341854095, -0.002191656269133091, -0.004994520451873541, -0.004126602318137884, -0.017894916236400604, -0.01036886591464281, -0.04088125005364418, -0.001628147903829813, -0.038663312792778015, 0.018833275884389877, -0.030392177402973175, 0.008629074320197105, -0.028720470145344734, 0.02279716171324253, -0.01806335523724556, 0.008062546141445637, 0.010905652306973934, 0.03126005455851555, 0.04747697710990906, 0.04772476851940155, 0.0025600406806916, -0.027565544471144676, -0.02668774127960205, 0.04895208775997162, 0.035160355269908905, -0.003617622423917055, -0.024726560339331627, 0.0027959730941802263, 0.032439906150102615, -0.02167009562253952, 0.018054930493235588, -0.01872582919895649, 0.0019295919919386506, -0.02558404952287674, 0.006836448796093464, -0.0369705893099308, -0.02392488345503807, -0.0006662389496341348, -0.03071492351591587, -0.035662174224853516, -0.027658283710479736, 0.03889033943414688, -0.0037014412228018045, 0.026146110147237778, -0.012518925592303276, -0.020388586446642876, -0.05085292086005211, 0.04047977924346924, -0.04683171212673187, -0.025453921407461166, -0.022075410932302475, 0.04574955627322197, -0.04705757275223732, 0.014057472348213196, -0.0019396235002204776, 0.02185961976647377, -0.0364665687084198, 0.029328808188438416, 0.03975827246904373, -0.025506163015961647, -0.048030223697423935, 0.020831944420933723, -0.010402142070233822, -0.045267313718795776, -0.009884222410619259, -0.03742368519306183, 0.040443453937768936, 0.03946416452527046, -0.01560758426785469, 0.05435897037386894, -0.01847420074045658, -0.022371601313352585, -0.02834167331457138, -0.024244116619229317, 0.016461217775940895, -0.015590337105095387, -0.00129281438421458, -0.04336583614349365, 0.031417686492204666, 0.031635694205760956, -0.04004405438899994, -0.030732493847608566, -0.006123801227658987, 0.04235366731882095, 0.01829519309103489, -0.04180118814110756, 0.022241240367293358, 0.007255924865603447, -0.011486359871923923, 0.03379999101161957, -0.0004169400199316442, -0.0184877160936594, 0.028425395488739014, 0.028919873759150505, 0.02586987614631653, 0.024930693209171295, 0.014547272585332394, -0.026854408904910088, -0.024916205555200577, 0.021643545478582382, 0.020358487963676453, -0.06973747164011002, 0.03774351254105568, -0.057213641703128815, 0.019329674541950226, 0.058849673718214035, -0.01767851412296295, -0.04142051935195923, 0.029757970944046974, 0.03226760774850845, 0.013497359119355679, 0.04983055964112282, -0.06860023736953735, -0.009090565145015717, 0.01876700483262539, -0.045754898339509964, -0.018559377640485764, 0.03907673433423042, -0.04343864694237709, 0.01983906328678131, 0.05090088024735451, -0.026130903512239456, 0.0198112390935421, -0.01724187843501568, 0.027581052854657173, -0.015150460414588451, 0.044671617448329926, -0.021948102861642838, -0.039155758917331696, -0.011670168489217758, 0.057173795998096466, 0.05130016431212425, 0.015086568892002106, 0.029861880466341972, 0.00045294041046872735, 0.012837855145335197, -0.013540389016270638, -0.0035288180224597454, -0.006696672644466162, 0.005161927081644535, -0.007997330278158188, -0.06018849462270737, 0.0040719653479754925, 0.04676881060004234, 0.05494493618607521, -0.02383231744170189, -0.02409941330552101, -0.02361765317618847, 0.05019611492753029, -0.02561134286224842, -0.011039866134524345, -0.0035623686853796244, -0.007303849793970585, -0.05598662421107292, -0.014519513584673405, -0.016709184274077415, 0.023226818069815636, 0.0020540591794997454, 0.018423371016979218, 0.07162746787071228, -0.030987678095698357, -0.011564436368644238, -0.05398257449269295, -0.03393613547086716, 0.029724063351750374, 0.014501385390758514, 0.01975683681666851, 0.025587748736143112, -0.0031189853325486183, -0.028188880532979965, -0.028325166553258896, -0.058148093521595, 0.06817413866519928, -0.05185883492231369, 0.010479864664375782, 0.013737188652157784, -0.025603286921977997, 0.004288510885089636, 0.03330473229289055, 0.03081020526587963, 0.00929239485412836, 0.013587307184934616, 0.04477598890662193, -0.010759776458144188, -0.013349821791052818, -0.03450658544898033, 0.04914005845785141, -0.008455680683255196, -0.02566939778625965, 0.06540139764547348, -0.014167072251439095, -0.04206572845578194, 0.040725916624069214, -0.027056824415922165, -0.027743373066186905, 0.01723734475672245, -0.026086552068591118, 0.011066379956901073, -0.028094105422496796, 0.021090257912874222, -0.006315530743449926, -0.0038536370266228914, 0.002642259933054447, -0.027106409892439842, -0.04236611723899841, 0.034201622009277344, 0.02585034817457199, 0.029318731278181076, 0.04393518716096878, -0.021400194615125656, -0.01966845989227295, 0.037550002336502075, -0.01055433414876461, 0.013854894787073135, -0.02539399452507496, -0.029923539608716965, 0.011284036561846733, 0.03166112303733826, -0.05249398201704025, 0.023592980578541756, -0.032214708626270294, 0.048454105854034424, -0.03129222244024277, 0.019876103848218918, 0.027158288285136223, -0.010018077678978443, -0.015372109599411488, -0.03651623800396919, 0.030494078993797302, 0.030631577596068382, 0.013395410031080246, -0.04203599691390991, 0.017429262399673462, -0.0336260125041008, -0.00458034360781312, 0.04320629686117172, 0.04873400554060936, -0.036522023379802704, -0.007033052854239941, 0.04841015860438347, 0.04686618968844414, -0.0226470734924078, -0.0156414732336998, 0.03650740534067154, -0.02229906991124153, 0.04247375950217247, 0.02045833133161068, 0.0011794024612754583, -0.02260892651975155, -0.034504398703575134, 0.044768236577510834, -0.031263917684555054, -0.045521024614572525, 0.005588601343333721, -0.056517187505960464, 0.03272703289985657, 0.03745061159133911, 0.048094216734170914, 0.04812173917889595, -0.051041409373283386, 0.017124954611063004, -0.028181584551930428, 0.0380525179207325, -0.0037846474442631006, -0.03125273063778877, 0.01894977129995823, -0.040786415338516235, -0.04169308394193649, 0.05256915092468262, -0.03413494676351547, 0.02746882289648056, 0.033805206418037415, 0.007925352081656456, 0.02444133721292019, 0.018344828858971596, -0.009217273443937302, 0.0021543705370277166, 0.03575904294848442, 0.020160242915153503, 0.02286422997713089, -0.020686518400907516, 0.026341790333390236, 0.12740176916122437, -0.00893761869519949, 0.020138844847679138, -0.02238314412534237, 0.018193142488598824, 0.03919895738363266, -0.022538235411047935, 0.025507012382149696, -0.023426273837685585, 0.027672510594129562, 0.04479461535811424, 0.051694680005311966, 0.024090928956866264, 0.05755620077252388, -0.014703532680869102, 0.017124010249972343, -0.01627686806023121, -0.0018241779180243611, -0.02017812617123127, -0.013297722674906254, 0.02810887061059475, -0.03654468432068825, -0.040724869817495346, -0.02429257705807686, 0.02536279335618019, -0.004012022167444229, -0.0012858447153121233, -0.04617433249950409, 0.017472991719841957, 0.05619405210018158, 0.003411441808566451, 0.02130633033812046, -0.03523368015885353, -0.017101695761084557, -0.020463088527321815, -0.025893187150359154, -0.04365244880318642, 0.03732496127486229, 0.003834214061498642, -0.02485889010131359, 0.023965951055288315, 0.04507003724575043, -0.039340391755104065, -0.01395449135452509, 0.043282754719257355, -0.0028774579986929893, 0.05358149856328964, -0.02236671932041645, 0.005119263660162687, 0.04382428526878357, 0.013711007311940193, -0.01928921416401863, -0.04386340454220772, 0.013973870314657688, -0.01751251146197319, -0.021039115265011787, 0.018643466755747795, 0.021641723811626434, -0.019717521965503693, -0.04447349160909653, -0.045124512165784836, 0.001166265457868576, 0.027790851891040802, 0.0349087193608284, -0.05426891893148422, -0.020197005942463875, 0.013967194594442844, 0.020221564918756485, 0.02676599659025669, -0.05146752670407295, 0.028382916003465652, -0.03574734181165695, -0.0307468231767416, 0.0271960087120533, -0.060862455517053604, -0.019536489620804787, 0.029809515923261642, 0.005997729953378439, -0.003236045129597187, -0.02296912670135498, -0.012584153562784195, 0.020569052547216415, -0.0398726686835289, 0.012893066741526127, 0.05747450888156891, -0.04004427418112755, -0.0016912904102355242, 0.03588302433490753, -0.040752533823251724, -0.021931834518909454, -0.03274866193532944, 0.02146611548960209, -0.01936306245625019, 0.017079008743166924, -0.007505142129957676, 0.06527362018823624, -0.020604269579052925, 0.01886555179953575, -0.00841802079230547, 0.03616372495889664, 0.020610619336366653, 0.04090982303023338, -0.00286914873868227, 0.01186350453644991, -0.015292976051568985, -0.03638255596160889, 0.028694557026028633, 0.002353183226659894, 0.017770130187273026, 0.01283283717930317, 0.012778712436556816, 0.02851232700049877, 0.008139816112816334, 0.03719107434153557, -0.03728439658880234, 0.012673329561948776, 0.03146594390273094, -0.019588639959692955, 0.006983111146837473, 0.03652822971343994, 0.01976114511489868, 0.043489858508110046, 0.04203694313764572, -0.0072769043035805225, -0.031777746975421906, 0.025811728090047836, -0.02263280190527439, -0.024895695969462395, -0.024923745542764664, -0.021317312493920326, 0.025197185575962067, -0.031068982556462288, -0.03568267449736595, -0.014184455387294292, -0.018119284883141518, 0.04019543156027794, 0.027073360979557037, 0.019060516729950905, -0.032629843801259995, 0.01988561637699604, -0.046449366956949234, -0.026410577818751335, -0.03311290591955185, -0.04030410945415497, 0.0073549640364944935, 0.03774447366595268, -0.02418743632733822, 0.03917284309864044, 0.037112291902303696, 0.04895860329270363, -0.03377828747034073, -0.021235689520835876, -0.008727184496819973, 0.012683587148785591, 0.025314902886748314, 0.02410356141626835, 0.06801478564739227, -0.02123037353157997, -0.0036285393871366978, 0.043283384293317795, 0.025348279625177383, 0.03189971670508385, -0.04675361514091492, -0.008785491809248924, -0.01910555362701416, -0.03074111044406891, -0.032706547528505325, -0.02195163257420063, -0.025955626741051674, -0.013656404800713062, -0.0017331260023638606, 0.04122364893555641, -0.003353940322995186, 0.003944667987525463, 0.02557617612183094, 0.033677756786346436, -0.0069642821326851845, -0.037354182451963425, -0.003706785151734948, 0.018041592091321945, 0.023099323734641075, 0.005993315484374762, -0.023070724681019783, -0.003592608030885458, 0.01580343022942543, -0.021968074142932892, -0.055538859218358994, 0.022645818069577217, 0.008289964869618416, 0.007825851440429688, 0.029414691030979156, 0.00884107407182455, -0.029503418132662773, -0.00685040233656764, -0.04297958314418793, -0.0067012435756623745, 0.0408974252641201, 0.03618587553501129, 0.008660215884447098, 0.005283386912196875, 0.02173357643187046, 0.016801103949546814, 0.014148939400911331, 0.04589837044477463, -0.07519549131393433, 0.0008492959314025939, -0.03911217674612999, 0.01957186684012413, 0.04065250977873802, -0.017508283257484436, -0.022696377709507942, -0.023634128272533417, 0.023389438167214394, 0.005290127359330654, 0.030684763565659523, 0.027884958311915398, 0.0007517277263104916, -0.01770036853849888, 0.011700128205120564, -0.010737712495028973, 0.04028428718447685, 0.023366102948784828, -0.03046400658786297, -0.023285800591111183, -0.047068167477846146, -0.019877061247825623, 0.005805285647511482, 0.026605457067489624, 0.014891230501234531, -0.04306803271174431, 0.06144380196928978, 0.02467053383588791, 0.009495215490460396, 0.02271324396133423, 0.022022845223546028, -0.0344187393784523, 0.034510448575019836, 0.035804156213998795, -0.02319440431892872, -0.012169327586889267, 0.027845632284879684, -0.03938868269324303, 0.014688534662127495, -0.0326634906232357, 0.035405971109867096, 0.09329289197921753, -0.021386025473475456, -0.005334523506462574, -0.013434350490570068, 0.03625260666012764, -0.035231638699769974, 0.01714746095240116, -0.010116915218532085, -0.015791669487953186, 0.03326767310500145, 0.06997721642255783, 0.02518271654844284, -0.025026991963386536, -0.033969491720199585, 0.006438582669943571, -0.010330992750823498, 0.022015077993273735, 0.035159625113010406, 0.03975333645939827, -0.09261862188577652, -0.030692344531416893, -0.007167263887822628, 0.030045578256249428, 0.04790728539228439, 0.037478335201740265, 0.008102349936962128, 0.023854972794651985, -0.02429278939962387, -0.007957016117870808, -0.029902758076786995, -0.03795326128602028, 0.02096726931631565, -0.009724924340844154, 0.05335197597742081, -0.031247764825820923, -0.029010239988565445, 0.03935291990637779, 0.0004320724692661315, -0.015092982910573483, -0.005163619294762611, 0.0006704957922920585, 0.019765393808484077, -0.0023283318150788546, 0.008752129971981049, 0.011935974471271038, 0.041026521474123, -0.02911226823925972, -0.00707174651324749, -0.05678257718682289, 0.018372097983956337, -0.007054861634969711, -0.03395901620388031, 0.029341937974095345, 0.011115530505776405, 0.04074866324663162, -0.015816841274499893, 0.05173950269818306, -0.015220806002616882, -0.04581461101770401, -0.03737398982048035, -0.0463782399892807, -0.04844944179058075, 0.011588484980165958, 0.007512776181101799, 0.012602098286151886, 0.008942355401813984, -0.019375091418623924, -0.00784570537507534, -0.016177771613001823, 0.020358964800834656, 0.030678516253829002, 0.058078765869140625, -0.05181894451379776, -0.007111021783202887, 0.004367280285805464, 0.04949195310473442, 0.024104589596390724, 0.013972863554954529, -0.022043360397219658, 0.02481302246451378, -0.02353677898645401, -0.019958026707172394, -0.03086337447166443, -0.0342184379696846, -0.042619749903678894, -0.013002551160752773, 0.031215941533446312, -0.029242197051644325, -0.039825692772865295, -0.04158396273851395, 0.019694391638040543, 0.02995566837489605, 0.028752531856298447, -0.02492348663508892, -0.006047347094863653, 0.04264743626117706, -0.006050477270036936, -0.012319333851337433, -0.02809244394302368, -0.04274909943342209, -0.015643877908587456, 0.0013809194788336754, 0.022640932351350784, -0.03112141042947769, 0.029752563685178757, -0.013332386501133442, 0.022779937833547592, 0.026944121345877647, 0.0026380603667348623, -0.04207104071974754, 0.022562168538570404, -0.01429622434079647, 0.044384222477674484, 0.004642078652977943]\n"
735 | ]
736 | }
737 | ],
738 | "source": [
739 | "query = \"what does it say about healthcare?\"\n",
740 | "\n",
741 | "# Our embbeding model expects `query: ` prefix for retrieval\n",
742 | "query_to_embed = f\"query: {query}\"\n",
743 | "query_vector = embedding_model.embed(query_to_embed)\n",
744 | "\n",
745 | "print(query_vector)"
746 | ]
747 | },
748 | {
749 | "cell_type": "markdown",
750 | "metadata": {
751 | "id": "dAjMJx2G7og3"
752 | },
753 | "source": [
754 | "## Symantic Search\n",
755 | "\n",
756 | "If we were using the LLM module's preferred structures for Collection and storing data in SQLite, we could simply use [llm similar](https://llm.datasette.io/en/stable/embeddings/cli.html#llm-similar) or its [corresponding Python API](https://llm.datasette.io/en/stable/embeddings/python-api.html#retrieving-similar-items). As far as I can tell, the API doesn't yet support other data structures of embeddings (like our Dataframe), so we'll have to calculate [cosine similarities](https://en.wikipedia.org/wiki/Cosine_similarity) ourselves. Lucky for us, we can [borrow from Simon's open source library](https://github.com/simonw/llm/blob/abcb457b20367ee56e27602e3553bb4bd6a17312/llm/__init__.py#L252):"
757 | ]
758 | },
759 | {
760 | "cell_type": "code",
761 | "execution_count": 5,
762 | "metadata": {
763 | "id": "WW6QXBCQzk0O"
764 | },
765 | "outputs": [],
766 | "source": [
767 | "def cosine_similarity(a, b):\n",
768 | " dot_product = sum(x * y for x, y in zip(a, b))\n",
769 | " magnitude_a = sum(x * x for x in a) ** 0.5\n",
770 | " magnitude_b = sum(x * x for x in b) ** 0.5\n",
771 | " return dot_product / (magnitude_a * magnitude_b)"
772 | ]
773 | },
774 | {
775 | "cell_type": "markdown",
776 | "metadata": {
777 | "id": "ryHF-H0m80GN"
778 | },
779 | "source": [
780 | "Now, iterate over every embedding in our Dataframe and calculate the similarity score against our query embedding vector:"
781 | ]
782 | },
783 | {
784 | "cell_type": "code",
785 | "execution_count": 6,
786 | "metadata": {
787 | "colab": {
788 | "base_uri": "https://localhost:8080/",
789 | "height": 206
790 | },
791 | "id": "fWR0ABoRzyDp",
792 | "outputId": "6c6703a8-cf2a-4f14-b115-0a2d80d29c6b"
793 | },
794 | "outputs": [
795 | {
796 | "data": {
797 | "text/html": [
798 | "\n",
799 | " \n",
800 | "
\n",
801 | "\n",
814 | "
\n",
815 | " \n",
816 | " \n",
817 | " | \n",
818 | " passage | \n",
819 | " embedding | \n",
820 | " similarity | \n",
821 | "
\n",
822 | " \n",
823 | " \n",
824 | " \n",
825 | " | 0 | \n",
826 | " By the authority vested in me as President by ... | \n",
827 | " [0.032344698905944824, -0.04333016648888588, 0... | \n",
828 | " 0.781552 | \n",
829 | "
\n",
830 | " \n",
831 | " | 1 | \n",
832 | " (a) Artificial Intelligence must be safe and s... | \n",
833 | " [0.01886950619518757, -0.057347141206264496, 0... | \n",
834 | " 0.778486 | \n",
835 | "
\n",
836 | " \n",
837 | " | 2 | \n",
838 | " (c) The responsible development and use of AI ... | \n",
839 | " [0.0486459881067276, -0.0712570995092392, 0.02... | \n",
840 | " 0.779455 | \n",
841 | "
\n",
842 | " \n",
843 | " | 3 | \n",
844 | " (e) The interests of Americans who increasingl... | \n",
845 | " [0.03564070537686348, -0.04887280985713005, 0.... | \n",
846 | " 0.794971 | \n",
847 | "
\n",
848 | " \n",
849 | " | 4 | \n",
850 | " (g) It is important to manage the risks from t... | \n",
851 | " [0.04095401614904404, -0.042341429740190506, 0... | \n",
852 | " 0.785406 | \n",
853 | "
\n",
854 | " \n",
855 | "
\n",
856 | "
\n",
857 | "
\n",
1064 | "
\n"
1065 | ],
1066 | "text/plain": [
1067 | " passage \\\n",
1068 | "0 By the authority vested in me as President by ... \n",
1069 | "1 (a) Artificial Intelligence must be safe and s... \n",
1070 | "2 (c) The responsible development and use of AI ... \n",
1071 | "3 (e) The interests of Americans who increasingl... \n",
1072 | "4 (g) It is important to manage the risks from t... \n",
1073 | "\n",
1074 | " embedding similarity \n",
1075 | "0 [0.032344698905944824, -0.04333016648888588, 0... 0.781552 \n",
1076 | "1 [0.01886950619518757, -0.057347141206264496, 0... 0.778486 \n",
1077 | "2 [0.0486459881067276, -0.0712570995092392, 0.02... 0.779455 \n",
1078 | "3 [0.03564070537686348, -0.04887280985713005, 0.... 0.794971 \n",
1079 | "4 [0.04095401614904404, -0.042341429740190506, 0... 0.785406 "
1080 | ]
1081 | },
1082 | "execution_count": 6,
1083 | "metadata": {},
1084 | "output_type": "execute_result"
1085 | }
1086 | ],
1087 | "source": [
1088 | "comp_df = df.copy()\n",
1089 | "comp_df['similarity'] = comp_df.apply(\n",
1090 | " lambda row : cosine_similarity(\n",
1091 | " query_vector,\n",
1092 | " row.embedding,\n",
1093 | " ),\n",
1094 | " axis=1,\n",
1095 | ")\n",
1096 | "\n",
1097 | "comp_df.head()"
1098 | ]
1099 | },
1100 | {
1101 | "cell_type": "markdown",
1102 | "metadata": {
1103 | "id": "UgzUo4hT9Hab"
1104 | },
1105 | "source": [
1106 | "And select the 3 passages with the best similary scores. We'll feed this as context to the LLaMA model."
1107 | ]
1108 | },
1109 | {
1110 | "cell_type": "code",
1111 | "execution_count": 7,
1112 | "metadata": {
1113 | "id": "ypmgcfZy0Q9O"
1114 | },
1115 | "outputs": [],
1116 | "source": [
1117 | "best_3_matches = comp_df.sort_values(\"similarity\", ascending = False).head(3)\n",
1118 | "context = \"\\n\".join(best_3_matches.passage.values)"
1119 | ]
1120 | },
1121 | {
1122 | "cell_type": "markdown",
1123 | "metadata": {
1124 | "id": "H8vFAI2z92FI"
1125 | },
1126 | "source": [
1127 | "## Ask the LLM\n",
1128 | "\n",
1129 | "Now that we've selected the top 3 passages, let's feed them into LLaMA 2."
1130 | ]
1131 | },
1132 | {
1133 | "cell_type": "code",
1134 | "execution_count": 8,
1135 | "metadata": {
1136 | "id": "Y-tlNQmO9LnK"
1137 | },
1138 | "outputs": [],
1139 | "source": [
1140 | "model = llm.get_model(\"llama2\")"
1141 | ]
1142 | },
1143 | {
1144 | "cell_type": "markdown",
1145 | "metadata": {
1146 | "id": "0x5xzRl99-dl"
1147 | },
1148 | "source": [
1149 | "Even though we're providing prefixed context to the model, it's helpful to give it a system prompt to guide how it responds. This can help it stay \"focussed\" on the context and respond in the voice that we expect. The system prompt is open to creativity and experimentation."
1150 | ]
1151 | },
1152 | {
1153 | "cell_type": "code",
1154 | "execution_count": 9,
1155 | "metadata": {
1156 | "id": "hDDZ1zSBFVKo"
1157 | },
1158 | "outputs": [],
1159 | "source": [
1160 | "system = \"You are an assistant. You answer questions in a single \\\n",
1161 | "paragraph about the policy from President Biden. The provided context \\\n",
1162 | "comes directly from the policy. You MUST use the provided information \\\n",
1163 | "as context. Not all provided information will be helpful, ONLY reference \\\n",
1164 | "information if it is related to my query. You may quote the context \\\n",
1165 | "information if helpful.\""
1166 | ]
1167 | },
1168 | {
1169 | "cell_type": "markdown",
1170 | "metadata": {
1171 | "id": "Y9WrJDIP-VYA"
1172 | },
1173 | "source": [
1174 | "Now, feed the context and the query into the model."
1175 | ]
1176 | },
1177 | {
1178 | "cell_type": "code",
1179 | "execution_count": 10,
1180 | "metadata": {
1181 | "colab": {
1182 | "base_uri": "https://localhost:8080/"
1183 | },
1184 | "id": "q0E-8k9OFFD4",
1185 | "outputId": "79b71ec9-d583-428a-fb79-d69c62162f48"
1186 | },
1187 | "outputs": [
1188 | {
1189 | "name": "stdout",
1190 | "output_type": "stream",
1191 | "text": [
1192 | "Query: what does it say about healthcare?\n",
1193 | "\n",
1194 | "Response:\n",
1195 | "\n",
1196 | "The policy from President Biden related to healthcare is outlined in section 8(b)(i) of the policy, which states that:\n",
1197 | "\"Within 90 days of the date of this order, the Secretary of HHS shall, in consultation with the Secretary of Defense and the Secretary of Veterans Affairs, establish an HHS AI Task Force that shall, within 365 days of its creation, develop a strategic plan that includes policies and frameworks — possibly including regulatory action, as appropriate — on responsible deployment and use of AI and AI-enabled technologies in the health and human services sector (including research and discovery, drug and device safety, healthcare delivery and financing, and public health), and identify appropriate guidance and resources to promote that deployment, including in the following areas:\n",
1198 | "(A) development, maintenance, and use of predictive and generative AI-enabled technologies in healthcare delivery and financing — including quality measurement, performance improvement, program integrity, benefits administration, and patient experience — taking into account considerations such as appropriate human oversight of the application of AI-generated output;\n",
1199 | "(D) incorporation of safety, privacy, and security standards into the software-development lifecycle for protection of personally identifiable information, including measures to address AI-enhanced cybersecurity threats in the health and human services sector; (E) development, maintenance, and availability of documentation to help users determine appropriate and safe uses of AI in local settings in the health and human services sector; (F) work to be done with State, local, Tribal, and territorial health and human services agencies to advance positive use cases and best practices for use of AI in local settings; and (G) identification of uses of AI to promote workplace efficiency and satisfaction in the health and human services sector, including reducing administrative burdens.\"\n",
1200 | "This section outlines the responsibilities of the Secretary of HHS related to AI in the healthcare sector. Some of the key points include:\n",
1201 | "* Establishing an HHS AI Task Force to develop a strategic plan for responsible AI deployment and use in the health and human services sector.\n",
1202 | "* Identifying policies and frameworks for regulatory action, as appropriate, to ensure responsible deployment and use of AI in healthcare.\n",
1203 | "* Developing guidance and resources to promote the appropriate and safe use of AI in healthcare\n"
1204 | ]
1205 | }
1206 | ],
1207 | "source": [
1208 | "print(f\"Query: {query}\\n\")\n",
1209 | "response = model.prompt(\n",
1210 | " f'{context}\\n{query}',\n",
1211 | " system=system,\n",
1212 | ")\n",
1213 | "\n",
1214 | "print(f\"Response:\\n\")\n",
1215 | "print(response.text())"
1216 | ]
1217 | },
1218 | {
1219 | "cell_type": "markdown",
1220 | "metadata": {
1221 | "id": "UkLTShWg-dyj"
1222 | },
1223 | "source": [
1224 | "Overall, this looks like it does a good job!\n",
1225 | "\n",
1226 | "Of course, it's extremely important to keep a human in the loop when referencing government documents. The model may still hallucinate, or it could entirely miss important context. Some of these shortcoming are baked into the model itself, others are implementation details of this Notebook.\n",
1227 | "\n",
1228 | "If nothing else, this shows a fascinating interface to interact with long, wordy, documents!"
1229 | ]
1230 | }
1231 | ],
1232 | "metadata": {
1233 | "accelerator": "GPU",
1234 | "colab": {
1235 | "gpuType": "T4",
1236 | "provenance": [],
1237 | "toc_visible": true
1238 | },
1239 | "kernelspec": {
1240 | "display_name": "Python 3",
1241 | "name": "python3"
1242 | },
1243 | "language_info": {
1244 | "name": "python"
1245 | }
1246 | },
1247 | "nbformat": 4,
1248 | "nbformat_minor": 0
1249 | }
1250 |
--------------------------------------------------------------------------------