From 72bc900bc2e93d68612ce2052ea288ece61f8fc0 Mon Sep 17 00:00:00 2001 From: Cameron Pfiffer Date: Sat, 20 Apr 2024 20:37:13 -0700 Subject: [PATCH] stuff --- cameron/Dockerfile | 12 + cameron/EMBED.PY | 209 ++++ cameron/Manifest.toml | 1242 +++++++++++++++++++++ cameron/Project.toml | 8 + cameron/__pycache__/embed.cpython-310.pyc | Bin 0 -> 5886 bytes cameron/embed.py | 305 +++++ cameron/env.jl | 3 + cameron/fireworks.py | 12 + cameron/go.jl | 145 +++ cameron/parquet-load.py | 43 + cameron/run.sh | 7 + cameron/server.py | 35 + cameron/smush.py | 79 ++ cameron/upload.jl | 50 + 14 files changed, 2150 insertions(+) create mode 100644 cameron/Dockerfile create mode 100644 cameron/EMBED.PY create mode 100644 cameron/Manifest.toml create mode 100644 cameron/Project.toml create mode 100644 cameron/__pycache__/embed.cpython-310.pyc create mode 100644 cameron/embed.py create mode 100644 cameron/env.jl create mode 100644 cameron/fireworks.py create mode 100644 cameron/go.jl create mode 100644 cameron/parquet-load.py create mode 100644 cameron/run.sh create mode 100644 cameron/server.py create mode 100644 cameron/smush.py create mode 100644 cameron/upload.jl diff --git a/cameron/Dockerfile b/cameron/Dockerfile new file mode 100644 index 0000000..badd827 --- /dev/null +++ b/cameron/Dockerfile @@ -0,0 +1,12 @@ +FROM python:3.9 + +WORKDIR /app + +COPY server.py . +COPY requirements.txt . + +RUN pip install --no-cache-dir -r requirements.txt + +EXPOSE 5000 + +CMD ["python", "server.py"] diff --git a/cameron/EMBED.PY b/cameron/EMBED.PY new file mode 100644 index 0000000..88a1f56 --- /dev/null +++ b/cameron/EMBED.PY @@ -0,0 +1,209 @@ +from pathlib import Path +from fastapi import Depends, HTTPException, status +from fastapi.responses import FileResponse +from modal import Stub, web_endpoint, Image, Secret, method, NetworkFileSystem +import os +from typing import Dict +import json + +from starlette.requests import Request + +APP_NAME = "mongo-hack" + +stub = Stub(name=APP_NAME) +RESULTS_DIR = "/results" +results_volume = NetworkFileSystem.new().persisted(f"{APP_NAME}-results-vol") + +image = ( + Image.debian_slim( + python_version="3.10" + ).pip_install( + "replicate", + "python-jose", + "requests", + "openai", + "pymongo", + "scikit-learn", + "numpy" + ) +) + +@stub.function(image=image, keep_warm=1, secrets=[Secret.from_name("mongo-hack-secret")]) +@web_endpoint(method="POST") +def handle_request( + payload: Dict, + request: Request +): + + import openai + client = openai.OpenAI( + api_key=os.getenv('FIREWORKS_API_KEY'), + base_url="https://api.fireworks.ai/inference/v1" + ) + + input_text=payload["text"] + + summary_response = client.chat.completions.create( + model="accounts/fireworks/models/llama-v2-7b-chat", + messages=[{ + "role": "user", + "content": f"create a funny title for the given text: {input_text}", + }], + ) + print(summary_response.choices[0].message.content) + + response = client.embeddings.create( + model="nomic-ai/nomic-embed-text-v1.5", + input=input_text, + dimensions=768, + ) + print(len(response.data[0].embedding)) + + # And also go make a title + + new_title = "" # T + + from pymongo import MongoClient + client = MongoClient("mongodb+srv://cameron:testing123@mongo-hackathon.4lo2sdu.mongodb.net/") + db = client["mongo-hackathon"] + print(db) + + collection = db["documents"] + + + document = { + # "_id": ObjectId("6624177242be2e1d80040517"), + "embedding": response.data[0].embedding, + "text": input_text, + "title": new_title + } + result = collection.insert_one(document) + print("Inserted document ID:", result.inserted_id) + + + # Please return all the crap that goes along with this one + # { + # "$vectorSearch": { + # "index": "", + # "path": "", + # "queryVector": [], + # "numCandidates": , + # "limit": , + # "filter": {} + # } + # } + + # pipeline = [ + # { + # "$vectorSearch": { + # "index": "vector_index", + # "vectorSearchQuery": { + # "path": "plot_embedding", + # "queryVector": response.data[0].embedding, + # "numCandidates": 1000, + # } + # } + # }, + # { + # "$limit": 10 + # } + # ] + + # # # define pipeline + # pipeline = [ + # { + # '$vectorSearch': { + # 'index': 'vector_index', + # 'path': 'plot_embedding', + # 'queryVector': response.data[0].embedding, + # 'numCandidates': 1000, + # 'limit': 10 + # } + # }, { + # '$project': { + # '_id': 1, + # 'embedding': 1, + # 'text': 1, + # 'score': { + # '$meta': 'vectorSearchScore' + # } + # } + # } + # ] + + def query_results(query_vec): + results = collection.aggregate([ + { + '$vectorSearch': { + "index": "embedding_index", + "path": "embedding", + "queryVector": query_vec, + "numCandidates": 1000, + "limit": 100, + } + } + ]) + return results + + # run pipeline + # result = collection.aggregate(pipeline) + results = query_results(response.data[0].embedding) + results_collected = [r for r in results] + print("reslts collected shape") + print(len(results_collected)) + + import numpy as np + from sklearn.decomposition import PCA + + def smush(matrix): + pca = PCA(n_components=2) + print(matrix.shape) + smushed = pca.fit_transform(matrix) + return smushed + + # Converts a matrix to a JSON with the format + # { + # "data": [ + # { + # "x": x1, + # "y": y1, + # "text": text1 + # } + # ... + # ] + # } + def bundle(texts, matrix): + smushed = smush(matrix) + return { + "data": [ + { + "x": x, + "y": y, + "text": text + } + for x, y, text in zip(smushed[:, 0], smushed[:, 1], texts) + ] + } + + # Unpack things + texts = [t["text"] for t in results_collected] + embeddings = [t["embedding"] for t in results_collected] + + print("texts length") + print(len(texts)) + + print("embeddings length") + print(len(embeddings)) + + matrix = np.array(embeddings) - response.data[0].embedding + + # smushed = smush(matrix) + # return json.dumps({ + # 'xs':smushed[:,0], + # 'ys':smushed[:,1], + # }) + + return json.dumps(bundle(texts, matrix)) + # return len(response.data[0].embedding) + + diff --git a/cameron/Manifest.toml b/cameron/Manifest.toml new file mode 100644 index 0000000..78d2887 --- /dev/null +++ b/cameron/Manifest.toml @@ -0,0 +1,1242 @@ +# This file is machine-generated - editing it directly is not advised + +julia_version = "1.10.2" +manifest_format = "2.0" +project_hash = "f60cfc56572091c487914b73474d62d43c1a2d09" + +[[deps.AbstractTrees]] +git-tree-sha1 = "2d9c9a55f9c93e8887ad391fbae72f8ef55e1177" +uuid = "1520ce14-60c1-5f80-bbc7-55ef81b5835c" +version = "0.4.5" + +[[deps.Accessors]] +deps = ["CompositionsBase", "ConstructionBase", "Dates", "InverseFunctions", "LinearAlgebra", "MacroTools", "Markdown", "Test"] +git-tree-sha1 = "c0d491ef0b135fd7d63cbc6404286bc633329425" +uuid = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697" +version = "0.1.36" + + [deps.Accessors.extensions] + AccessorsAxisKeysExt = "AxisKeys" + AccessorsIntervalSetsExt = "IntervalSets" + AccessorsStaticArraysExt = "StaticArrays" + AccessorsStructArraysExt = "StructArrays" + AccessorsUnitfulExt = "Unitful" + + [deps.Accessors.weakdeps] + AxisKeys = "94b1ba4f-4ee9-5380-92f1-94cde586c3c5" + IntervalSets = "8197267c-284f-5f27-9208-e0e47529a953" + Requires = "ae029012-a4dd-5104-9daa-d747884805df" + StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" + StructArrays = "09ab397b-f2b6-538f-b94a-2f83cf4a842a" + Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d" + +[[deps.Adapt]] +deps = ["LinearAlgebra", "Requires"] +git-tree-sha1 = "6a55b747d1812e699320963ffde36f1ebdda4099" +uuid = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" +version = "4.0.4" +weakdeps = ["StaticArrays"] + + [deps.Adapt.extensions] + AdaptStaticArraysExt = "StaticArrays" + +[[deps.AliasTables]] +deps = ["Random"] +git-tree-sha1 = "ca95b2220ef440817963baa71525a8f2f4ae7f8f" +uuid = "66dad0bd-aa9a-41b7-9441-69ab47430ed8" +version = "1.0.0" + +[[deps.ArgCheck]] +git-tree-sha1 = "a3a402a35a2f7e0b87828ccabbd5ebfbebe356b4" +uuid = "dce04be8-c92d-5529-be00-80e4d2c0e197" +version = "2.3.0" + +[[deps.ArgTools]] +uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f" +version = "1.1.1" + +[[deps.ArnoldiMethod]] +deps = ["LinearAlgebra", "Random", "StaticArrays"] +git-tree-sha1 = "d57bd3762d308bded22c3b82d033bff85f6195c6" +uuid = "ec485272-7323-5ecc-a04f-4719b315124d" +version = "0.4.0" + +[[deps.Arpack]] +deps = ["Arpack_jll", "Libdl", "LinearAlgebra", "Logging"] +git-tree-sha1 = "9b9b347613394885fd1c8c7729bfc60528faa436" +uuid = "7d9fca2a-8960-54d3-9f78-7d1dccf2cb97" +version = "0.5.4" + +[[deps.Arpack_jll]] +deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "OpenBLAS_jll", "Pkg"] +git-tree-sha1 = "5ba6c757e8feccf03a1554dfaf3e26b3cfc7fd5e" +uuid = "68821587-b530-5797-8361-c406ea357684" +version = "3.5.1+1" + +[[deps.ArrayInterface]] +deps = ["Adapt", "LinearAlgebra", "SparseArrays", "SuiteSparse"] +git-tree-sha1 = "133a240faec6e074e07c31ee75619c90544179cf" +uuid = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9" +version = "7.10.0" + + [deps.ArrayInterface.extensions] + ArrayInterfaceBandedMatricesExt = "BandedMatrices" + ArrayInterfaceBlockBandedMatricesExt = "BlockBandedMatrices" + ArrayInterfaceCUDAExt = "CUDA" + ArrayInterfaceCUDSSExt = "CUDSS" + ArrayInterfaceChainRulesExt = "ChainRules" + ArrayInterfaceGPUArraysCoreExt = "GPUArraysCore" + ArrayInterfaceReverseDiffExt = "ReverseDiff" + ArrayInterfaceStaticArraysCoreExt = "StaticArraysCore" + ArrayInterfaceTrackerExt = "Tracker" + + [deps.ArrayInterface.weakdeps] + BandedMatrices = "aae01518-5342-5314-be14-df237901396f" + BlockBandedMatrices = "ffab5731-97b5-5995-9138-79e8c1846df0" + CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" + CUDSS = "45b445bb-4962-46a0-9369-b4df9d0f772e" + ChainRules = "082447d4-558c-5d27-93f4-14fc19e9eca2" + GPUArraysCore = "46192b85-c4d5-4398-a991-12ede77f4527" + ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267" + StaticArraysCore = "1e83bf80-4336-4d27-bf5d-d5a4f845583c" + Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c" + +[[deps.ArrayLayouts]] +deps = ["FillArrays", "LinearAlgebra"] +git-tree-sha1 = "33207a8be6267bc389d0701e97a9bce6a4de68eb" +uuid = "4c555306-a7a7-4459-81d9-ec55ddd5c99a" +version = "1.9.2" +weakdeps = ["SparseArrays"] + + [deps.ArrayLayouts.extensions] + ArrayLayoutsSparseArraysExt = "SparseArrays" + +[[deps.Artifacts]] +uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" + +[[deps.BangBang]] +deps = ["Accessors", "Compat", "ConstructionBase", "InitialValues", "LinearAlgebra", "Requires"] +git-tree-sha1 = "490e739172eb18f762e68dc3b928cad2a077983a" +uuid = "198e06fe-97b7-11e9-32a5-e1d131e6ad66" +version = "0.4.1" + + [deps.BangBang.extensions] + BangBangChainRulesCoreExt = "ChainRulesCore" + BangBangDataFramesExt = "DataFrames" + BangBangStaticArraysExt = "StaticArrays" + BangBangStructArraysExt = "StructArrays" + BangBangTablesExt = "Tables" + BangBangTypedTablesExt = "TypedTables" + + [deps.BangBang.weakdeps] + ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" + DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" + StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" + StructArrays = "09ab397b-f2b6-538f-b94a-2f83cf4a842a" + Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c" + TypedTables = "9d95f2ec-7b3d-5a63-8d20-e2491e220bb9" + +[[deps.Base64]] +uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" + +[[deps.Baselet]] +git-tree-sha1 = "aebf55e6d7795e02ca500a689d326ac979aaf89e" +uuid = "9718e550-a3fa-408a-8086-8db961cd8217" +version = "0.1.1" + +[[deps.BinaryProvider]] +deps = ["Libdl", "Logging", "SHA"] +git-tree-sha1 = "ecdec412a9abc8db54c0efc5548c64dfce072058" +uuid = "b99e7846-7c00-51b0-8f62-c81ae34c0232" +version = "0.5.10" + +[[deps.BitFlags]] +git-tree-sha1 = "2dc09997850d68179b69dafb58ae806167a32b1b" +uuid = "d1d4a3ce-64b1-5f1a-9ba4-7e7e69966f35" +version = "0.1.8" + +[[deps.BitIntegers]] +deps = ["Random"] +git-tree-sha1 = "a55462dfddabc34bc97d3a7403a2ca2802179ae6" +uuid = "c3b6d118-76ef-56ca-8cc7-ebb389d030a1" +version = "0.3.1" + +[[deps.Calculus]] +deps = ["LinearAlgebra"] +git-tree-sha1 = "f641eb0a4f00c343bbc32346e1217b86f3ce9dad" +uuid = "49dc2e85-a5d0-5ad3-a950-438e2897f1b9" +version = "0.5.1" + +[[deps.Clustering]] +deps = ["Distances", "LinearAlgebra", "NearestNeighbors", "Printf", "Random", "SparseArrays", "Statistics", "StatsBase"] +git-tree-sha1 = "9ebb045901e9bbf58767a9f34ff89831ed711aae" +uuid = "aaaa29a8-35af-508c-8bc3-b662a17a0fe5" +version = "0.15.7" + +[[deps.CodecLz4]] +deps = ["Lz4_jll", "TranscodingStreams"] +git-tree-sha1 = "b8aecef9f90530cf322a8386630ec18485c17991" +uuid = "5ba52731-8f18-5e0d-9241-30f10d1ec561" +version = "0.4.3" + +[[deps.CodecZlib]] +deps = ["TranscodingStreams", "Zlib_jll"] +git-tree-sha1 = "59939d8a997469ee05c4b4944560a820f9ba0d73" +uuid = "944b1d66-785c-5afd-91f1-9de20f533193" +version = "0.7.4" + +[[deps.CodecZstd]] +deps = ["TranscodingStreams", "Zstd_jll"] +git-tree-sha1 = "23373fecba848397b1705f6183188a0c0bc86917" +uuid = "6b39b394-51ab-5f42-8807-6242bab2b4c2" +version = "0.8.2" + +[[deps.CommonSubexpressions]] +deps = ["MacroTools", "Test"] +git-tree-sha1 = "7b8a93dba8af7e3b42fecabf646260105ac373f7" +uuid = "bbf7d656-a473-5ed7-a52c-81e309532950" +version = "0.3.0" + +[[deps.Compat]] +deps = ["TOML", "UUIDs"] +git-tree-sha1 = "c955881e3c981181362ae4088b35995446298b80" +uuid = "34da2185-b29b-5c13-b0c7-acf172513d20" +version = "4.14.0" +weakdeps = ["Dates", "LinearAlgebra"] + + [deps.Compat.extensions] + CompatLinearAlgebraExt = "LinearAlgebra" + +[[deps.CompilerSupportLibraries_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae" +version = "1.1.0+0" + +[[deps.CompositionsBase]] +git-tree-sha1 = "802bb88cd69dfd1509f6670416bd4434015693ad" +uuid = "a33af91c-f02d-484b-be07-31d278c5ca2b" +version = "0.1.2" +weakdeps = ["InverseFunctions"] + + [deps.CompositionsBase.extensions] + CompositionsBaseInverseFunctionsExt = "InverseFunctions" + +[[deps.ConcurrentUtilities]] +deps = ["Serialization", "Sockets"] +git-tree-sha1 = "6cbbd4d241d7e6579ab354737f4dd95ca43946e1" +uuid = "f0e56b4a-5159-44fe-b623-3e5288b988bb" +version = "2.4.1" + +[[deps.ConstructionBase]] +deps = ["LinearAlgebra"] +git-tree-sha1 = "260fd2400ed2dab602a7c15cf10c1933c59930a2" +uuid = "187b0558-2788-49d3-abe0-74a17ed4e7c9" +version = "1.5.5" + + [deps.ConstructionBase.extensions] + ConstructionBaseIntervalSetsExt = "IntervalSets" + ConstructionBaseStaticArraysExt = "StaticArrays" + + [deps.ConstructionBase.weakdeps] + IntervalSets = "8197267c-284f-5f27-9208-e0e47529a953" + StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" + +[[deps.DataAPI]] +git-tree-sha1 = "abe83f3a2f1b857aac70ef8b269080af17764bbe" +uuid = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a" +version = "1.16.0" + +[[deps.DataDeps]] +deps = ["HTTP", "Libdl", "Reexport", "SHA", "Scratch", "p7zip_jll"] +git-tree-sha1 = "8ae085b71c462c2cb1cfedcb10c3c877ec6cf03f" +uuid = "124859b0-ceae-595e-8997-d05f6a7a8dfe" +version = "0.7.13" + +[[deps.DataStructures]] +deps = ["Compat", "InteractiveUtils", "OrderedCollections"] +git-tree-sha1 = "1d0a14036acb104d9e89698bd408f63ab58cdc82" +uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" +version = "0.18.20" + +[[deps.DataValueInterfaces]] +git-tree-sha1 = "bfc1187b79289637fa0ef6d4436ebdfe6905cbd6" +uuid = "e2d170a0-9d28-54be-80f0-106bbe20a464" +version = "1.0.0" + +[[deps.Dates]] +deps = ["Printf"] +uuid = "ade2ca70-3891-5945-98fb-dc099432e06a" + +[[deps.DecFP]] +deps = ["DecFP_jll", "Printf", "Random", "SpecialFunctions"] +git-tree-sha1 = "4a10cec664e26d9d63597daf9e62147e79d636e3" +uuid = "55939f99-70c6-5e9b-8bb0-5071ed7d61fd" +version = "1.3.2" + +[[deps.DecFP_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "e9a8da19f847bbfed4076071f6fef8665a30d9e5" +uuid = "47200ebd-12ce-5be5-abb7-8e082af23329" +version = "2.0.3+1" + +[[deps.DefineSingletons]] +git-tree-sha1 = "0fba8b706d0178b4dc7fd44a96a92382c9065c2c" +uuid = "244e2a9f-e319-4986-a169-4d1fe445cd52" +version = "0.1.2" + +[[deps.DiffResults]] +deps = ["StaticArraysCore"] +git-tree-sha1 = "782dd5f4561f5d267313f23853baaaa4c52ea621" +uuid = "163ba53b-c6d8-5494-b064-1a9d43ac40c5" +version = "1.1.0" + +[[deps.DiffRules]] +deps = ["IrrationalConstants", "LogExpFunctions", "NaNMath", "Random", "SpecialFunctions"] +git-tree-sha1 = "23163d55f885173722d1e4cf0f6110cdbaf7e272" +uuid = "b552c78f-8df3-52c6-915a-8e097449b14b" +version = "1.15.1" + +[[deps.Distances]] +deps = ["LinearAlgebra", "Statistics", "StatsAPI"] +git-tree-sha1 = "66c4c81f259586e8f002eacebc177e1fb06363b0" +uuid = "b4f34e82-e78d-54a5-968a-f98e89d6e8f7" +version = "0.10.11" + + [deps.Distances.extensions] + DistancesChainRulesCoreExt = "ChainRulesCore" + DistancesSparseArraysExt = "SparseArrays" + + [deps.Distances.weakdeps] + ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" + SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" + +[[deps.Distributed]] +deps = ["Random", "Serialization", "Sockets"] +uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b" + +[[deps.Distributions]] +deps = ["AliasTables", "FillArrays", "LinearAlgebra", "PDMats", "Printf", "QuadGK", "Random", "SpecialFunctions", "Statistics", "StatsAPI", "StatsBase", "StatsFuns"] +git-tree-sha1 = "22c595ca4146c07b16bcf9c8bea86f731f7109d2" +uuid = "31c24e10-a181-5473-b8eb-7969acd0382f" +version = "0.25.108" + + [deps.Distributions.extensions] + DistributionsChainRulesCoreExt = "ChainRulesCore" + DistributionsDensityInterfaceExt = "DensityInterface" + DistributionsTestExt = "Test" + + [deps.Distributions.weakdeps] + ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" + DensityInterface = "b429d917-457f-4dbc-8f4c-0cc954292b1d" + Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" + +[[deps.DocStringExtensions]] +deps = ["LibGit2"] +git-tree-sha1 = "2fb1e02f2b635d0845df5d7c167fec4dd739b00d" +uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" +version = "0.9.3" + +[[deps.Downloads]] +deps = ["ArgTools", "FileWatching", "LibCURL", "NetworkOptions"] +uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6" +version = "1.6.0" + +[[deps.DualNumbers]] +deps = ["Calculus", "NaNMath", "SpecialFunctions"] +git-tree-sha1 = "5837a837389fccf076445fce071c8ddaea35a566" +uuid = "fa6b7ba4-c1ee-5f82-b5fc-ecf0adba8f74" +version = "0.6.8" + +[[deps.ExceptionUnwrapping]] +deps = ["Test"] +git-tree-sha1 = "dcb08a0d93ec0b1cdc4af184b26b591e9695423a" +uuid = "460bff9d-24e4-43bc-9d9f-a8973cb893f4" +version = "0.1.10" + +[[deps.FNVHash]] +git-tree-sha1 = "d6de2c735a8bffce9bc481942dfa453cc815357e" +uuid = "5207ad80-27db-4d23-8732-fa0bd339ea89" +version = "0.1.0" + +[[deps.FilePathsBase]] +deps = ["Compat", "Dates", "Mmap", "Printf", "Test", "UUIDs"] +git-tree-sha1 = "9f00e42f8d99fdde64d40c8ea5d14269a2e2c1aa" +uuid = "48062228-2e41-5def-b9a4-89aafe57970f" +version = "0.9.21" + +[[deps.FileWatching]] +uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee" + +[[deps.FillArrays]] +deps = ["LinearAlgebra"] +git-tree-sha1 = "bfe82a708416cf00b73a3198db0859c82f741558" +uuid = "1a297f60-69ca-5386-bcde-b61e274b549b" +version = "1.10.0" +weakdeps = ["PDMats", "SparseArrays", "Statistics"] + + [deps.FillArrays.extensions] + FillArraysPDMatsExt = "PDMats" + FillArraysSparseArraysExt = "SparseArrays" + FillArraysStatisticsExt = "Statistics" + +[[deps.FiniteDiff]] +deps = ["ArrayInterface", "LinearAlgebra", "Requires", "Setfield", "SparseArrays"] +git-tree-sha1 = "2de436b72c3422940cbe1367611d137008af7ec3" +uuid = "6a86dc24-6348-571c-b903-95158fe2bd41" +version = "2.23.1" + + [deps.FiniteDiff.extensions] + FiniteDiffBandedMatricesExt = "BandedMatrices" + FiniteDiffBlockBandedMatricesExt = "BlockBandedMatrices" + FiniteDiffStaticArraysExt = "StaticArrays" + + [deps.FiniteDiff.weakdeps] + BandedMatrices = "aae01518-5342-5314-be14-df237901396f" + BlockBandedMatrices = "ffab5731-97b5-5995-9138-79e8c1846df0" + StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" + +[[deps.ForwardDiff]] +deps = ["CommonSubexpressions", "DiffResults", "DiffRules", "LinearAlgebra", "LogExpFunctions", "NaNMath", "Preferences", "Printf", "Random", "SpecialFunctions"] +git-tree-sha1 = "cf0fe81336da9fb90944683b8c41984b08793dad" +uuid = "f6369f11-7733-5829-9624-2563aa707210" +version = "0.10.36" +weakdeps = ["StaticArrays"] + + [deps.ForwardDiff.extensions] + ForwardDiffStaticArraysExt = "StaticArrays" + +[[deps.Future]] +deps = ["Random"] +uuid = "9fa8497b-333b-5362-9e8d-4d0656e87820" + +[[deps.Graphs]] +deps = ["ArnoldiMethod", "Compat", "DataStructures", "Distributed", "Inflate", "LinearAlgebra", "Random", "SharedArrays", "SimpleTraits", "SparseArrays", "Statistics"] +git-tree-sha1 = "3863330da5466410782f2bffc64f3d505a6a8334" +uuid = "86223c79-3864-5bf0-83f7-82e725a168b6" +version = "1.10.0" + +[[deps.HTML_Entities]] +deps = ["StrTables"] +git-tree-sha1 = "c4144ed3bc5f67f595622ad03c0e39fa6c70ccc7" +uuid = "7693890a-d069-55fe-a829-b4a6d304f0ee" +version = "1.0.1" + +[[deps.HTTP]] +deps = ["Base64", "CodecZlib", "ConcurrentUtilities", "Dates", "ExceptionUnwrapping", "Logging", "LoggingExtras", "MbedTLS", "NetworkOptions", "OpenSSL", "Random", "SimpleBufferStream", "Sockets", "URIs", "UUIDs"] +git-tree-sha1 = "8e59b47b9dc525b70550ca082ce85bcd7f5477cd" +uuid = "cd3eb016-35fb-5094-929b-558a96fad6f3" +version = "1.10.5" + +[[deps.HypergeometricFunctions]] +deps = ["DualNumbers", "LinearAlgebra", "OpenLibm_jll", "SpecialFunctions"] +git-tree-sha1 = "f218fe3736ddf977e0e772bc9a586b2383da2685" +uuid = "34004b35-14d8-5ef3-9330-4cdb6864b03a" +version = "0.3.23" + +[[deps.Inflate]] +git-tree-sha1 = "ea8031dea4aff6bd41f1df8f2fdfb25b33626381" +uuid = "d25df0c9-e2be-5dd7-82c8-3ad0b3e990b9" +version = "0.1.4" + +[[deps.InitialValues]] +git-tree-sha1 = "4da0f88e9a39111c2fa3add390ab15f3a44f3ca3" +uuid = "22cec73e-a1b8-11e9-2c92-598750a2cf9c" +version = "0.3.1" + +[[deps.InlineStrings]] +deps = ["Parsers"] +git-tree-sha1 = "9cc2baf75c6d09f9da536ddf58eb2f29dedaf461" +uuid = "842dd82b-1e85-43dc-bf29-5d0ee9dffc48" +version = "1.4.0" + +[[deps.InteractiveUtils]] +deps = ["Markdown"] +uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" + +[[deps.InverseFunctions]] +deps = ["Test"] +git-tree-sha1 = "896385798a8d49a255c398bd49162062e4a4c435" +uuid = "3587e190-3f89-42d0-90ee-14403ec27112" +version = "0.1.13" +weakdeps = ["Dates"] + + [deps.InverseFunctions.extensions] + DatesExt = "Dates" + +[[deps.IrrationalConstants]] +git-tree-sha1 = "630b497eafcc20001bba38a4651b327dcfc491d2" +uuid = "92d709cd-6900-40b7-9082-c6be49f344b6" +version = "0.2.2" + +[[deps.IterativeSolvers]] +deps = ["LinearAlgebra", "Printf", "Random", "RecipesBase", "SparseArrays"] +git-tree-sha1 = "59545b0a2b27208b0650df0a46b8e3019f85055b" +uuid = "42fd0dbc-a981-5370-80f2-aaf504508153" +version = "0.9.4" + +[[deps.IteratorInterfaceExtensions]] +git-tree-sha1 = "a3f24677c21f5bbe9d2a714f95dcd58337fb2856" +uuid = "82899510-4779-5014-852e-03e436cf321d" +version = "1.0.0" + +[[deps.JLLWrappers]] +deps = ["Artifacts", "Preferences"] +git-tree-sha1 = "7e5d6779a1e09a36db2a7b6cff50942a0a7d0fca" +uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210" +version = "1.5.0" + +[[deps.JSON]] +deps = ["Dates", "Mmap", "Parsers", "Unicode"] +git-tree-sha1 = "31e996f0a15c7b280ba9f76636b3ff9e2ae58c9a" +uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" +version = "0.21.4" + +[[deps.JSON3]] +deps = ["Dates", "Mmap", "Parsers", "PrecompileTools", "StructTypes", "UUIDs"] +git-tree-sha1 = "eb3edce0ed4fa32f75a0a11217433c31d56bd48b" +uuid = "0f8b85d8-7281-11e9-16c2-39a750bddbf1" +version = "1.14.0" + + [deps.JSON3.extensions] + JSON3ArrowExt = ["ArrowTypes"] + + [deps.JSON3.weakdeps] + ArrowTypes = "31f734f8-188a-4ce0-8406-c8a06bd891cd" + +[[deps.LLMTextAnalysis]] +deps = ["Clustering", "Distances", "Languages", "LinearAlgebra", "Logging", "MLJLinearModels", "PrecompileTools", "PromptingTools", "Random", "Snowball", "SparseArrays", "Statistics", "Tables", "UMAP", "WordTokenizers"] +git-tree-sha1 = "5e16fdfc2de205b8bba72c16142aac2de33cdfef" +uuid = "a88142f3-a164-49e9-925a-9408902b6922" +version = "0.5.0" + + [deps.LLMTextAnalysis.extensions] + PlotlyJSLLMTextAnalysisExt = ["PlotlyJS"] + PlotsLLMTextAnalysisExt = ["Plots"] + + [deps.LLMTextAnalysis.weakdeps] + PlotlyJS = "f0f68f2c-4968-5e81-91da-67840de0976a" + Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" + +[[deps.LZO_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "e5b909bcf985c5e2605737d2ce278ed791b89be6" +uuid = "dd4b983a-f0e5-5f8d-a1b7-129d4a5fb1ac" +version = "2.10.1+0" + +[[deps.Languages]] +deps = ["InteractiveUtils", "JSON", "RelocatableFolders"] +git-tree-sha1 = "0cf92ba8402f94c9f4db0ec156888ee8d299fcb8" +uuid = "8ef0a80b-9436-5d2c-a485-80b904378c43" +version = "0.4.6" + +[[deps.LazyArrays]] +deps = ["ArrayLayouts", "FillArrays", "LinearAlgebra", "MacroTools", "MatrixFactorizations", "SparseArrays"] +git-tree-sha1 = "35079a6a869eecace778bcda8641f9a54ca3a828" +uuid = "5078a376-72f3-5289-bfd5-ec5146d43c02" +version = "1.10.0" +weakdeps = ["StaticArrays"] + + [deps.LazyArrays.extensions] + LazyArraysStaticArraysExt = "StaticArrays" + +[[deps.LibCURL]] +deps = ["LibCURL_jll", "MozillaCACerts_jll"] +uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21" +version = "0.6.4" + +[[deps.LibCURL_jll]] +deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll", "Zlib_jll", "nghttp2_jll"] +uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0" +version = "8.4.0+0" + +[[deps.LibGit2]] +deps = ["Base64", "LibGit2_jll", "NetworkOptions", "Printf", "SHA"] +uuid = "76f85450-5226-5b5a-8eaa-529ad045b433" + +[[deps.LibGit2_jll]] +deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll"] +uuid = "e37daf67-58a4-590a-8e99-b0245dd2ffc5" +version = "1.6.4+0" + +[[deps.LibSSH2_jll]] +deps = ["Artifacts", "Libdl", "MbedTLS_jll"] +uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8" +version = "1.11.0+1" + +[[deps.Libdl]] +uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb" + +[[deps.LightBSON]] +deps = ["DataStructures", "Dates", "DecFP", "FNVHash", "JSON3", "Sockets", "StructTypes", "Transducers", "UUIDs", "UnsafeArrays", "WeakRefStrings"] +git-tree-sha1 = "d4d5cc8209c57ad04b35071da39ee8a006a0d938" +uuid = "a4a7f996-b3a6-4de6-b9db-2fa5f350df41" +version = "0.2.17" + +[[deps.LineSearches]] +deps = ["LinearAlgebra", "NLSolversBase", "NaNMath", "Parameters", "Printf"] +git-tree-sha1 = "7bbea35cec17305fc70a0e5b4641477dc0789d9d" +uuid = "d3d80556-e9d4-5f37-9878-2ab0fcc64255" +version = "7.2.0" + +[[deps.LinearAlgebra]] +deps = ["Libdl", "OpenBLAS_jll", "libblastrampoline_jll"] +uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" + +[[deps.LinearMaps]] +deps = ["LinearAlgebra"] +git-tree-sha1 = "9948d6f8208acfebc3e8cf4681362b2124339e7e" +uuid = "7a12625a-238d-50fd-b39a-03d52299707e" +version = "3.11.2" + + [deps.LinearMaps.extensions] + LinearMapsChainRulesCoreExt = "ChainRulesCore" + LinearMapsSparseArraysExt = "SparseArrays" + LinearMapsStatisticsExt = "Statistics" + + [deps.LinearMaps.weakdeps] + ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" + SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" + Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" + +[[deps.LogExpFunctions]] +deps = ["DocStringExtensions", "IrrationalConstants", "LinearAlgebra"] +git-tree-sha1 = "18144f3e9cbe9b15b070288eef858f71b291ce37" +uuid = "2ab3a3ac-af41-5b50-aa03-7779005ae688" +version = "0.3.27" + + [deps.LogExpFunctions.extensions] + LogExpFunctionsChainRulesCoreExt = "ChainRulesCore" + LogExpFunctionsChangesOfVariablesExt = "ChangesOfVariables" + LogExpFunctionsInverseFunctionsExt = "InverseFunctions" + + [deps.LogExpFunctions.weakdeps] + ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" + ChangesOfVariables = "9e997f8a-9a97-42d5-a9f1-ce6bfc15e2c0" + InverseFunctions = "3587e190-3f89-42d0-90ee-14403ec27112" + +[[deps.Logging]] +uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" + +[[deps.LoggingExtras]] +deps = ["Dates", "Logging"] +git-tree-sha1 = "c1dd6d7978c12545b4179fb6153b9250c96b0075" +uuid = "e6f89c97-d47a-5376-807f-9c37f3926c36" +version = "1.0.3" + +[[deps.LsqFit]] +deps = ["Distributions", "ForwardDiff", "LinearAlgebra", "NLSolversBase", "Printf", "StatsAPI"] +git-tree-sha1 = "40acc20cfb253cf061c1a2a2ea28de85235eeee1" +uuid = "2fda8390-95c7-5789-9bda-21331edee243" +version = "0.15.0" + +[[deps.Lz4_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "6c26c5e8a4203d43b5497be3ec5d4e0c3cde240a" +uuid = "5ced341a-0733-55b8-9ab6-a4889d929147" +version = "1.9.4+0" + +[[deps.MLJLinearModels]] +deps = ["DocStringExtensions", "IterativeSolvers", "LinearAlgebra", "LinearMaps", "MLJModelInterface", "Optim", "Parameters"] +git-tree-sha1 = "7f517fd840ca433a8fae673edb31678ff55d969c" +uuid = "6ee0df7b-362f-4a72-a706-9e79364fb692" +version = "0.10.0" + +[[deps.MLJModelInterface]] +deps = ["Random", "ScientificTypesBase", "StatisticalTraits"] +git-tree-sha1 = "d2a45e1b5998ba3fdfb6cfe0c81096d4c7fb40e7" +uuid = "e80e1ace-859a-464e-9ed9-23947d8ae3ea" +version = "1.9.6" + +[[deps.MacroTools]] +deps = ["Markdown", "Random"] +git-tree-sha1 = "2fa9ee3e63fd3a4f7a9a4f4744a52f4856de82df" +uuid = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09" +version = "0.5.13" + +[[deps.Markdown]] +deps = ["Base64"] +uuid = "d6f4376e-aef5-505a-96c1-9c027394607a" + +[[deps.MatrixFactorizations]] +deps = ["ArrayLayouts", "LinearAlgebra", "Printf", "Random"] +git-tree-sha1 = "6731e0574fa5ee21c02733e397beb133df90de35" +uuid = "a3b82374-2e81-5b9e-98ce-41277c0e4c87" +version = "2.2.0" + +[[deps.MbedTLS]] +deps = ["Dates", "MbedTLS_jll", "MozillaCACerts_jll", "NetworkOptions", "Random", "Sockets"] +git-tree-sha1 = "c067a280ddc25f196b5e7df3877c6b226d390aaf" +uuid = "739be429-bea8-5141-9913-cc70e7f3736d" +version = "1.1.9" + +[[deps.MbedTLS_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1" +version = "2.28.2+1" + +[[deps.MemPool]] +deps = ["DataStructures", "Distributed", "Mmap", "Random", "Serialization", "Sockets", "Test"] +git-tree-sha1 = "d52799152697059353a8eac1000d32ba8d92aa25" +uuid = "f9f48841-c794-520a-933b-121f7ba6ed94" +version = "0.2.0" + +[[deps.MicroCollections]] +deps = ["Accessors", "BangBang", "InitialValues"] +git-tree-sha1 = "44d32db644e84c75dab479f1bc15ee76a1a3618f" +uuid = "128add7d-3638-4c79-886c-908ea0c25c34" +version = "0.2.0" + +[[deps.Missings]] +deps = ["DataAPI"] +git-tree-sha1 = "ec4f7fbeab05d7747bdf98eb74d130a2a2ed298d" +uuid = "e1d29d7a-bbdc-5cf2-9ac0-f12de2c33e28" +version = "1.2.0" + +[[deps.Mmap]] +uuid = "a63ad114-7e13-5084-954f-fe012c677804" + +[[deps.MongoC_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "OpenSSL_jll", "Zlib_jll", "Zstd_jll", "snappy_jll"] +git-tree-sha1 = "5a0f9f14a8186eae48608ff7922ac0c00ff52cdc" +uuid = "90100e71-7732-535a-9be7-2e9affd1cfc1" +version = "1.25.1+0" + +[[deps.Mongoc]] +deps = ["Dates", "DecFP", "MongoC_jll", "Serialization"] +git-tree-sha1 = "f47bf7ed9d9c1da0a632777ca7dc406e3ad5f923" +uuid = "4fe8b98c-fc19-5c23-8ec2-168ff83495f2" +version = "0.9.0" + +[[deps.MozillaCACerts_jll]] +uuid = "14a3606d-f60d-562e-9121-12d972cd8159" +version = "2023.1.10" + +[[deps.MultivariateStats]] +deps = ["Arpack", "LinearAlgebra", "SparseArrays", "Statistics", "StatsAPI", "StatsBase"] +git-tree-sha1 = "68bf5103e002c44adfd71fea6bd770b3f0586843" +uuid = "6f286f6a-111f-5878-ab1e-185364afe411" +version = "0.10.2" + +[[deps.NLSolversBase]] +deps = ["DiffResults", "Distributed", "FiniteDiff", "ForwardDiff"] +git-tree-sha1 = "a0b464d183da839699f4c79e7606d9d186ec172c" +uuid = "d41bc354-129a-5804-8e4c-c37616107c6c" +version = "7.8.3" + +[[deps.NaNMath]] +deps = ["OpenLibm_jll"] +git-tree-sha1 = "0877504529a3e5c3343c6f8b4c0381e57e4387e4" +uuid = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3" +version = "1.0.2" + +[[deps.NearestNeighborDescent]] +deps = ["DataStructures", "Distances", "Graphs", "Random", "Reexport", "SparseArrays"] +git-tree-sha1 = "b7d4bd2ab58f0c3a001fd6eedc2e0aac8e278152" +uuid = "dd2c4c9e-a32f-5b2f-b342-08c2f244fce8" +version = "0.3.6" + +[[deps.NearestNeighbors]] +deps = ["Distances", "StaticArrays"] +git-tree-sha1 = "ded64ff6d4fdd1cb68dfcbb818c69e144a5b2e4c" +uuid = "b8a86587-4115-5ab1-83bc-aa920d37bbce" +version = "0.4.16" + +[[deps.NetworkOptions]] +uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908" +version = "1.2.0" + +[[deps.OpenAI]] +deps = ["Dates", "HTTP", "JSON3"] +git-tree-sha1 = "c66f597044ac6cd41cbf4b191d59abbaf2003d9f" +uuid = "e9f21f70-7185-4079-aca2-91159181367c" +version = "0.9.0" + +[[deps.OpenBLAS_jll]] +deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"] +uuid = "4536629a-c528-5b80-bd46-f80d51c5b363" +version = "0.3.23+4" + +[[deps.OpenLibm_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "05823500-19ac-5b8b-9628-191a04bc5112" +version = "0.8.1+2" + +[[deps.OpenSSL]] +deps = ["BitFlags", "Dates", "MozillaCACerts_jll", "OpenSSL_jll", "Sockets"] +git-tree-sha1 = "38cb508d080d21dc1128f7fb04f20387ed4c0af4" +uuid = "4d8831e6-92b7-49fb-bdf8-b643e874388c" +version = "1.4.3" + +[[deps.OpenSSL_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "a12e56c72edee3ce6b96667745e6cbbe5498f200" +uuid = "458c3c95-2e84-50aa-8efc-19380b2a3a95" +version = "1.1.23+0" + +[[deps.OpenSpecFun_jll]] +deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "13652491f6856acfd2db29360e1bbcd4565d04f1" +uuid = "efe28fd5-8261-553b-a9e1-b2916fc3738e" +version = "0.5.5+0" + +[[deps.Optim]] +deps = ["Compat", "FillArrays", "ForwardDiff", "LineSearches", "LinearAlgebra", "NLSolversBase", "NaNMath", "Parameters", "PositiveFactorizations", "Printf", "SparseArrays", "StatsBase"] +git-tree-sha1 = "d9b79c4eed437421ac4285148fcadf42e0700e89" +uuid = "429524aa-4258-5aef-a3af-852621145aeb" +version = "1.9.4" + + [deps.Optim.extensions] + OptimMOIExt = "MathOptInterface" + + [deps.Optim.weakdeps] + MathOptInterface = "b8f27783-ece8-5eb3-8dc8-9495eed66fee" + +[[deps.OrderedCollections]] +git-tree-sha1 = "dfdf5519f235516220579f949664f1bf44e741c5" +uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" +version = "1.6.3" + +[[deps.PDMats]] +deps = ["LinearAlgebra", "SparseArrays", "SuiteSparse"] +git-tree-sha1 = "949347156c25054de2db3b166c52ac4728cbad65" +uuid = "90014a1f-27ba-587c-ab20-58faa44d9150" +version = "0.11.31" + +[[deps.Parameters]] +deps = ["OrderedCollections", "UnPack"] +git-tree-sha1 = "34c0e9ad262e5f7fc75b10a9952ca7692cfc5fbe" +uuid = "d96e819e-fc66-5662-9728-84c9c7592b0a" +version = "0.12.3" + +[[deps.Parquet]] +deps = ["CodecZlib", "MemPool", "ProtoBuf", "Snappy", "Thrift"] +git-tree-sha1 = "d8970214b128dcd470d9da2d850722247be1ad9b" +uuid = "626c502c-15b0-58ad-a749-f091afb673ae" +version = "0.3.2" + +[[deps.Parquet2]] +deps = ["AbstractTrees", "BitIntegers", "CodecLz4", "CodecZlib", "CodecZstd", "DataAPI", "Dates", "DecFP", "FilePathsBase", "FillArrays", "JSON3", "LazyArrays", "LightBSON", "Mmap", "OrderedCollections", "PooledArrays", "PrecompileTools", "SentinelArrays", "Snappy", "StaticArrays", "TableOperations", "Tables", "Thrift2", "Transducers", "UUIDs", "WeakRefStrings"] +git-tree-sha1 = "a3ab6596d22fd461b1e4fd6dcd30b8a4f419d78d" +uuid = "98572fba-bba0-415d-956f-fa77e587d26d" +version = "0.2.21" + +[[deps.Parsers]] +deps = ["Dates", "PrecompileTools", "UUIDs"] +git-tree-sha1 = "8489905bcdbcfac64d1daa51ca07c0d8f0283821" +uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0" +version = "2.8.1" + +[[deps.Pkg]] +deps = ["Artifacts", "Dates", "Downloads", "FileWatching", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"] +uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" +version = "1.10.0" + +[[deps.PooledArrays]] +deps = ["DataAPI", "Future"] +git-tree-sha1 = "36d8b4b899628fb92c2749eb488d884a926614d3" +uuid = "2dfb63ee-cc39-5dd5-95bd-886bf059d720" +version = "1.4.3" + +[[deps.PositiveFactorizations]] +deps = ["LinearAlgebra"] +git-tree-sha1 = "17275485f373e6673f7e7f97051f703ed5b15b20" +uuid = "85a6dd25-e78a-55b7-8502-1745935b8125" +version = "0.2.4" + +[[deps.PrecompileTools]] +deps = ["Preferences"] +git-tree-sha1 = "5aa36f7049a63a1528fe8f7c3f2113413ffd4e1f" +uuid = "aea7be01-6a6a-4083-8856-8a6e6704d82a" +version = "1.2.1" + +[[deps.Preferences]] +deps = ["TOML"] +git-tree-sha1 = "9306f6085165d270f7e3db02af26a400d580f5c6" +uuid = "21216c6a-2e73-6563-6e65-726566657250" +version = "1.4.3" + +[[deps.Printf]] +deps = ["Unicode"] +uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7" + +[[deps.PromptingTools]] +deps = ["AbstractTrees", "Base64", "HTTP", "JSON3", "Logging", "OpenAI", "Pkg", "PrecompileTools", "Preferences", "Random", "Test"] +git-tree-sha1 = "f48828b20ada03d1af953296eae2658321f59731" +uuid = "670122d1-24a8-4d70-bfce-740807c42192" +version = "0.15.0" +weakdeps = ["LinearAlgebra", "Markdown", "SparseArrays"] + + [deps.PromptingTools.extensions] + MarkdownPromptingToolsExt = ["Markdown"] + RAGToolsExperimentalExt = ["SparseArrays", "LinearAlgebra"] + +[[deps.ProtoBuf]] +git-tree-sha1 = "51b74991da46594fb411a715e7e092bef50b99ff" +uuid = "3349acd9-ac6a-5e09-bcdb-63829b23a429" +version = "0.8.0" + +[[deps.QuadGK]] +deps = ["DataStructures", "LinearAlgebra"] +git-tree-sha1 = "9b23c31e76e333e6fb4c1595ae6afa74966a729e" +uuid = "1fd47b50-473d-5c70-9696-f719f8f3bcdc" +version = "2.9.4" + +[[deps.REPL]] +deps = ["InteractiveUtils", "Markdown", "Sockets", "Unicode"] +uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" + +[[deps.Random]] +deps = ["SHA"] +uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" + +[[deps.RecipesBase]] +deps = ["PrecompileTools"] +git-tree-sha1 = "5c3d09cc4f31f5fc6af001c250bf1278733100ff" +uuid = "3cdcf5f2-1ef4-517c-9805-6587b60abb01" +version = "1.3.4" + +[[deps.Reexport]] +git-tree-sha1 = "45e428421666073eab6f2da5c9d310d99bb12f9b" +uuid = "189a3867-3050-52da-a836-e630ba90ab69" +version = "1.2.2" + +[[deps.RelocatableFolders]] +deps = ["SHA", "Scratch"] +git-tree-sha1 = "ffdaf70d81cf6ff22c2b6e733c900c3321cab864" +uuid = "05181044-ff0b-4ac5-8273-598c1e38db00" +version = "1.0.1" + +[[deps.Requires]] +deps = ["UUIDs"] +git-tree-sha1 = "838a3a4188e2ded87a4f9f184b4b0d78a1e91cb7" +uuid = "ae029012-a4dd-5104-9daa-d747884805df" +version = "1.3.0" + +[[deps.Rmath]] +deps = ["Random", "Rmath_jll"] +git-tree-sha1 = "f65dcb5fa46aee0cf9ed6274ccbd597adc49aa7b" +uuid = "79098fc4-a85e-5d69-aa6a-4863f24498fa" +version = "0.7.1" + +[[deps.Rmath_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "6ed52fdd3382cf21947b15e8870ac0ddbff736da" +uuid = "f50d1b31-88e8-58de-be2c-1cc44531875f" +version = "0.4.0+0" + +[[deps.SHA]] +uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" +version = "0.7.0" + +[[deps.ScientificTypesBase]] +git-tree-sha1 = "a8e18eb383b5ecf1b5e6fc237eb39255044fd92b" +uuid = "30f210dd-8aff-4c5f-94ba-8e64358c1161" +version = "3.0.0" + +[[deps.Scratch]] +deps = ["Dates"] +git-tree-sha1 = "3bac05bc7e74a75fd9cba4295cde4045d9fe2386" +uuid = "6c6a2e73-6563-6170-7368-637461726353" +version = "1.2.1" + +[[deps.SentinelArrays]] +deps = ["Dates", "Random"] +git-tree-sha1 = "0e7508ff27ba32f26cd459474ca2ede1bc10991f" +uuid = "91c51154-3ec4-41a3-a24f-3f23e20d615c" +version = "1.4.1" + +[[deps.Serialization]] +uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" + +[[deps.Setfield]] +deps = ["ConstructionBase", "Future", "MacroTools", "StaticArraysCore"] +git-tree-sha1 = "e2cc6d8c88613c05e1defb55170bf5ff211fbeac" +uuid = "efcf1570-3423-57d1-acb7-fd33fddbac46" +version = "1.1.1" + +[[deps.SharedArrays]] +deps = ["Distributed", "Mmap", "Random", "Serialization"] +uuid = "1a1011a3-84de-559e-8e89-a11a2f7dc383" + +[[deps.SimpleBufferStream]] +git-tree-sha1 = "874e8867b33a00e784c8a7e4b60afe9e037b74e1" +uuid = "777ac1f9-54b0-4bf8-805c-2214025038e7" +version = "1.1.0" + +[[deps.SimpleTraits]] +deps = ["InteractiveUtils", "MacroTools"] +git-tree-sha1 = "5d7e3f4e11935503d3ecaf7186eac40602e7d231" +uuid = "699a6c99-e7fa-54fc-8d76-47d257e15c1d" +version = "0.9.4" + +[[deps.Snappy]] +deps = ["BinaryProvider", "Libdl", "Random", "Test"] +git-tree-sha1 = "25620a91907972a05863941d6028791c2613888e" +uuid = "59d4ed8c-697a-5b28-a4c7-fe95c22820f9" +version = "0.3.0" + +[[deps.Snowball]] +deps = ["Languages", "Snowball_jll", "WordTokenizers"] +git-tree-sha1 = "8b466b16804ab8687f8d3a1b5312a0aa1b7d8b64" +uuid = "fb8f903a-0164-4e73-9ffe-431110250c3b" +version = "0.1.1" + +[[deps.Snowball_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "6ff3a185a583dca7265cbfcaae1da16aa3b6a962" +uuid = "88f46535-a3c0-54f4-998e-4320a1339f51" +version = "2.2.0+0" + +[[deps.Sockets]] +uuid = "6462fe0b-24de-5631-8697-dd941f90decc" + +[[deps.SortingAlgorithms]] +deps = ["DataStructures"] +git-tree-sha1 = "66e0a8e672a0bdfca2c3f5937efb8538b9ddc085" +uuid = "a2af1166-a08f-5f64-846c-94a0d3cef48c" +version = "1.2.1" + +[[deps.SparseArrays]] +deps = ["Libdl", "LinearAlgebra", "Random", "Serialization", "SuiteSparse_jll"] +uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" +version = "1.10.0" + +[[deps.SpecialFunctions]] +deps = ["IrrationalConstants", "LogExpFunctions", "OpenLibm_jll", "OpenSpecFun_jll"] +git-tree-sha1 = "e2cfc4012a19088254b3950b85c3c1d8882d864d" +uuid = "276daf66-3868-5448-9aa4-cd146d93841b" +version = "2.3.1" + + [deps.SpecialFunctions.extensions] + SpecialFunctionsChainRulesCoreExt = "ChainRulesCore" + + [deps.SpecialFunctions.weakdeps] + ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" + +[[deps.SplittablesBase]] +deps = ["Setfield", "Test"] +git-tree-sha1 = "e08a62abc517eb79667d0a29dc08a3b589516bb5" +uuid = "171d559e-b47b-412a-8079-5efa626c420e" +version = "0.1.15" + +[[deps.StaticArrays]] +deps = ["LinearAlgebra", "PrecompileTools", "Random", "StaticArraysCore"] +git-tree-sha1 = "bf074c045d3d5ffd956fa0a461da38a44685d6b2" +uuid = "90137ffa-7385-5640-81b9-e52037218182" +version = "1.9.3" + + [deps.StaticArrays.extensions] + StaticArraysChainRulesCoreExt = "ChainRulesCore" + StaticArraysStatisticsExt = "Statistics" + + [deps.StaticArrays.weakdeps] + ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" + Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" + +[[deps.StaticArraysCore]] +git-tree-sha1 = "36b3d696ce6366023a0ea192b4cd442268995a0d" +uuid = "1e83bf80-4336-4d27-bf5d-d5a4f845583c" +version = "1.4.2" + +[[deps.StatisticalTraits]] +deps = ["ScientificTypesBase"] +git-tree-sha1 = "30b9236691858e13f167ce829490a68e1a597782" +uuid = "64bff920-2084-43da-a3e6-9bb72801c0c9" +version = "3.2.0" + +[[deps.Statistics]] +deps = ["LinearAlgebra", "SparseArrays"] +uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" +version = "1.10.0" + +[[deps.StatsAPI]] +deps = ["LinearAlgebra"] +git-tree-sha1 = "1ff449ad350c9c4cbc756624d6f8a8c3ef56d3ed" +uuid = "82ae8749-77ed-4fe6-ae5f-f523153014b0" +version = "1.7.0" + +[[deps.StatsBase]] +deps = ["DataAPI", "DataStructures", "LinearAlgebra", "LogExpFunctions", "Missings", "Printf", "Random", "SortingAlgorithms", "SparseArrays", "Statistics", "StatsAPI"] +git-tree-sha1 = "5cf7606d6cef84b543b483848d4ae08ad9832b21" +uuid = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91" +version = "0.34.3" + +[[deps.StatsFuns]] +deps = ["HypergeometricFunctions", "IrrationalConstants", "LogExpFunctions", "Reexport", "Rmath", "SpecialFunctions"] +git-tree-sha1 = "cef0472124fab0695b58ca35a77c6fb942fdab8a" +uuid = "4c63d2b9-4356-54db-8cca-17b64c39e42c" +version = "1.3.1" + + [deps.StatsFuns.extensions] + StatsFunsChainRulesCoreExt = "ChainRulesCore" + StatsFunsInverseFunctionsExt = "InverseFunctions" + + [deps.StatsFuns.weakdeps] + ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" + InverseFunctions = "3587e190-3f89-42d0-90ee-14403ec27112" + +[[deps.StrTables]] +deps = ["Dates"] +git-tree-sha1 = "5998faae8c6308acc25c25896562a1e66a3bb038" +uuid = "9700d1a9-a7c8-5760-9816-a99fda30bb8f" +version = "1.0.1" + +[[deps.StructTypes]] +deps = ["Dates", "UUIDs"] +git-tree-sha1 = "ca4bccb03acf9faaf4137a9abc1881ed1841aa70" +uuid = "856f2bd8-1eba-4b0a-8007-ebc267875bd4" +version = "1.10.0" + +[[deps.SuiteSparse]] +deps = ["Libdl", "LinearAlgebra", "Serialization", "SparseArrays"] +uuid = "4607b0f0-06f3-5cda-b6b1-a6196a1729e9" + +[[deps.SuiteSparse_jll]] +deps = ["Artifacts", "Libdl", "libblastrampoline_jll"] +uuid = "bea87d4a-7f5b-5778-9afe-8cc45184846c" +version = "7.2.1+1" + +[[deps.TOML]] +deps = ["Dates"] +uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76" +version = "1.0.3" + +[[deps.TableOperations]] +deps = ["SentinelArrays", "Tables", "Test"] +git-tree-sha1 = "e383c87cf2a1dc41fa30c093b2a19877c83e1bc1" +uuid = "ab02a1b2-a7df-11e8-156e-fb1833f50b87" +version = "1.2.0" + +[[deps.TableTraits]] +deps = ["IteratorInterfaceExtensions"] +git-tree-sha1 = "c06b2f539df1c6efa794486abfb6ed2022561a39" +uuid = "3783bdb8-4a98-5b6b-af9a-565f29a5fe9c" +version = "1.0.1" + +[[deps.Tables]] +deps = ["DataAPI", "DataValueInterfaces", "IteratorInterfaceExtensions", "LinearAlgebra", "OrderedCollections", "TableTraits"] +git-tree-sha1 = "cb76cf677714c095e535e3501ac7954732aeea2d" +uuid = "bd369af6-aec1-5ad0-b16a-f7cc5008161c" +version = "1.11.1" + +[[deps.Tar]] +deps = ["ArgTools", "SHA"] +uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e" +version = "1.10.0" + +[[deps.Test]] +deps = ["InteractiveUtils", "Logging", "Random", "Serialization"] +uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40" + +[[deps.Thrift]] +deps = ["BinaryProvider", "Distributed", "Sockets"] +git-tree-sha1 = "c3dd01c6067985a77fef761839203838ac12825b" +uuid = "8d9c9c80-f77e-5080-9541-c6f69d204e22" +version = "0.6.2" + +[[deps.Thrift2]] +deps = ["MacroTools", "OrderedCollections", "PrecompileTools"] +git-tree-sha1 = "00d618714271f283ea3829ab058d5e5bd1847f85" +uuid = "9be31aac-5446-47db-bfeb-416acd2e4415" +version = "0.1.4" + +[[deps.TranscodingStreams]] +git-tree-sha1 = "71509f04d045ec714c4748c785a59045c3736349" +uuid = "3bb67fe8-82b1-5028-8e26-92a6c54297fa" +version = "0.10.7" +weakdeps = ["Random", "Test"] + + [deps.TranscodingStreams.extensions] + TestExt = ["Test", "Random"] + +[[deps.Transducers]] +deps = ["Accessors", "Adapt", "ArgCheck", "BangBang", "Baselet", "CompositionsBase", "ConstructionBase", "DefineSingletons", "Distributed", "InitialValues", "Logging", "Markdown", "MicroCollections", "Requires", "SplittablesBase", "Tables"] +git-tree-sha1 = "47e516e2eabd0cf1304cd67839d9a85d52dd659d" +uuid = "28d57a85-8fef-5791-bfe6-a80928e7c999" +version = "0.4.81" + + [deps.Transducers.extensions] + TransducersBlockArraysExt = "BlockArrays" + TransducersDataFramesExt = "DataFrames" + TransducersLazyArraysExt = "LazyArrays" + TransducersOnlineStatsBaseExt = "OnlineStatsBase" + TransducersReferenceablesExt = "Referenceables" + + [deps.Transducers.weakdeps] + BlockArrays = "8e7c35d0-a365-5155-bbbb-fb81a777f24e" + DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" + LazyArrays = "5078a376-72f3-5289-bfd5-ec5146d43c02" + OnlineStatsBase = "925886fa-5bf2-5e8e-b522-a9147a512338" + Referenceables = "42d2dcc6-99eb-4e98-b66c-637b7d73030e" + +[[deps.UMAP]] +deps = ["Arpack", "Distances", "LinearAlgebra", "LsqFit", "NearestNeighborDescent", "Random", "SparseArrays"] +git-tree-sha1 = "df15e2580e56acb1bde25d2ac36460d22f0f57f2" +uuid = "c4f8c510-2410-5be4-91d7-4fbaeb39457e" +version = "0.1.11" + +[[deps.URIs]] +git-tree-sha1 = "67db6cc7b3821e19ebe75791a9dd19c9b1188f2b" +uuid = "5c2747f8-b7ea-4ff2-ba2e-563bfd36b1d4" +version = "1.5.1" + +[[deps.UUIDs]] +deps = ["Random", "SHA"] +uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" + +[[deps.UnPack]] +git-tree-sha1 = "387c1f73762231e86e0c9c5443ce3b4a0a9a0c2b" +uuid = "3a884ed6-31ef-47d7-9d2a-63182c4928ed" +version = "1.0.2" + +[[deps.Unicode]] +uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" + +[[deps.UnsafeArrays]] +git-tree-sha1 = "e7f1c67ba99ac6df440de191fa4d5cbfcbdddcd1" +uuid = "c4a57d5a-5b31-53a6-b365-19f8c011fbd6" +version = "1.0.5" + +[[deps.WeakRefStrings]] +deps = ["DataAPI", "InlineStrings", "Parsers"] +git-tree-sha1 = "b1be2855ed9ed8eac54e5caff2afcdb442d52c23" +uuid = "ea10d353-3f73-51f8-a26c-33c1cb351aa5" +version = "1.4.2" + +[[deps.WordTokenizers]] +deps = ["DataDeps", "HTML_Entities", "StrTables", "Unicode"] +git-tree-sha1 = "01dd4068c638da2431269f49a5964bf42ff6c9d2" +uuid = "796a5d58-b03d-544a-977e-18100b691f6e" +version = "0.5.6" + +[[deps.Zlib_jll]] +deps = ["Libdl"] +uuid = "83775a58-1f1d-513f-b197-d71354ab007a" +version = "1.2.13+1" + +[[deps.Zstd_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "e678132f07ddb5bfa46857f0d7620fb9be675d3b" +uuid = "3161d3a3-bdf6-5164-811a-617609db77b4" +version = "1.5.6+0" + +[[deps.libblastrampoline_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "8e850b90-86db-534c-a0d3-1478176c7d93" +version = "5.8.0+1" + +[[deps.nghttp2_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d" +version = "1.52.0+1" + +[[deps.p7zip_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0" +version = "17.4.0+2" + +[[deps.snappy_jll]] +deps = ["Artifacts", "JLLWrappers", "LZO_jll", "Libdl", "Zlib_jll"] +git-tree-sha1 = "ab27636e7c8222f14b9318a983fcd89cf130d419" +uuid = "fe1e1685-f7be-5f59-ac9f-4ca204017dfd" +version = "1.1.10+0" diff --git a/cameron/Project.toml b/cameron/Project.toml new file mode 100644 index 0000000..e5226c7 --- /dev/null +++ b/cameron/Project.toml @@ -0,0 +1,8 @@ +[deps] +Clustering = "aaaa29a8-35af-508c-8bc3-b662a17a0fe5" +LLMTextAnalysis = "a88142f3-a164-49e9-925a-9408902b6922" +Mongoc = "4fe8b98c-fc19-5c23-8ec2-168ff83495f2" +MultivariateStats = "6f286f6a-111f-5878-ab1e-185364afe411" +Parquet = "626c502c-15b0-58ad-a749-f091afb673ae" +Parquet2 = "98572fba-bba0-415d-956f-fa77e587d26d" +PromptingTools = "670122d1-24a8-4d70-bfce-740807c42192" diff --git a/cameron/__pycache__/embed.cpython-310.pyc b/cameron/__pycache__/embed.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1580e5fe12b4ffd7922eac02fcfb3e08224e789b GIT binary patch literal 5886 zcmc}i<>g{vU|^Wts*={G%)sy%#6iZK3=9ko3=9m#42%p6DGVu$ISjdsQH+crHd78$ zE^`!fE=v?kE^8DkSd2M`Etfrt9n5CQ;mGBT;>_iW;>zWY;?CuX;>qQW;?3oY;seXG z=I}@Hr!b_jL)TIHE*TIa5VbIC~kR#8SAT#8dgQ zBvM6ZGo*0OWlG^m;q7ILl1$~!l1kxA;qPT!Ae|zRBA6nSBAg^7CDi&isLjz65TYLqTB^mj7@nxw+#UNjB7Nr*CWF{w;q*if5q;#|L zi&JlL6hW*mzQvYbkeZj6d5gWE66}g9p5o-p?939~oYcgkyj!e!rMU%_FBusa7^(!p z3c$|PEe3m3llc~FCfMhk*{P`o@#Tp{xwqIMa>ch;0{nwRG#QJy85kIDu@@v(=Hw@) z++v4Xoy-J^2`Cn4U|?WpU|?VdCDeVOgvyx01WKs2OpFXQOexIGjJ3=)%qc9A47DsJ zOf@XcjEoF5EGev#44q6h3@L1q47IE&j42E`%(ZMaY*{QNtP9vu*cURUaHMedGS#xD zaHVj!Fmy02U{7JIVa;S*$mqh*%vj4&!coJ~%$UNM&0Nb_!j!^O!`Te7k+aC7h9iYh zk|BjxlA)F>kH3aJi!+NWg|CJ+g+E20m${a^hC7QJq#}!_maBxRgrkNFlInBSj$(!lp z1yaO7?yM02yH2o#DMcLQQ?U7hQ1d~)YnUGV{_6jf@?@3cyJ$5tNYiOmgy# zic?DUz~U)MdU>fO`c?d39zxYE&XoM*(%jU%lHyw|C8-r9w*=ihgIvS?gS>;|9Rob$ zy7T56Gga(+sxKALBAjSP%T^iy+_Qd9H_ zDsOSwLZ!u^x7ilvvFcc|(vNvl)4IjPB@`T-oDMH(Ql^Fq`@3+XhFx5OA27+4sYn3x!0kmWbif42WD+*PW$A`ZnA zj1YsRxFQu$kb}|}*aezQMQR{7FcyKi5CY_?B25MchBA;^El|-dR+L(tQ&Ow|^+0Nh zLUBf7LF!7zTg(B@j+%_OcziSSd=o2zlM{1Ni%@I_*$l$q_)=nEVCVqHRxe{MV+lhI zLlz^bh^S#)z*NJqkg=AjhAEgqliBYjD4l}L&5H-6-TXXI<^-juf+BEz3AX+gZ(3$a zd`VGaUU6D}QLZNQEwh&x8RWHFtYGmvP(X7q zFfed2f*=cHl`O8H1*=a6c>Eo7`^PGJTm z%NB+b#v0}nh7^WYrWCd`CP@Z3j~&cos9|ho0hO(ppc0V7Pm}58|NsC07lGs7thmKk3C@K@2C#tAWCf>-B43bzABX_uG=w}_LYWQ}jS)?2Kg(xvzo8@Q+_E^-4o z%L63ORt!#dnoLCwATdu6frxH4h*kX{H}WwsFmNz(F>^6;Fsrb${ABrGC5PXIC_xNL zlq?Jk44@$XECMUL*+At?3WFpAEKnhV339T$~9m1nohw2bU`-N-ZeLPfi6lNx@Nh zi#4&RD6#SuOIC4y-YwRY(%gb#P4OZbkgc*H0_1~RY{}r(!7ZkgB#<)-N=xEF0Z;_? zlmNV{j)y7}0@r4ldFk=6I;Qv*Ka3di~hX|>fq{XCor4h!nK&3Zm{=G&7?~K^{zwHg7spir^e( zP@6VIcn(uKsHkViV#s35VoDJKl}w0WT2!e3PVJdxsS1h3 z#hJw=iFqXo<(VZJ3W>>})T&UDuaH)n2d>wP^%O#jQx!@wQganD(-c6>tIVR*6up&9 zw^)kub5d`yC+Fvtq~?{}Vks?7EvhOAP6f3H6cQDROAAtq6p9k_Qu1>ZO7aUblNA#4 zQXp2t9a5Z;UsR$1PKaPxh^Ca(lEloM)D(rB{JeApP})~WNi9w;$^>^s71HvHKn{W! zdW!?*)LVS%sU?s^4bCrBa_*@mV1+P8q*j!GZ2{Y-cZ)4QDJwO(1k|-H0yP1-k<@|w zS5jG!dW##$<|;9;POt-z)aq$6-Gb@`TMVgI>Otw>fPsNwC38_NC^K;t6y+DB7L{bC z7K3tPVJRpeS27pzgA{^l?^|32iA9OIsU@jJ#VeV>nu;nI7#MyTCMGB6m*$le>%%j@ zKDZrPte;k{3-iBja$-)7uCYmyZkfR?mc-JM{PbBfLExqRO4cGBkP|p^Q;Ule(?QL= zlKlLf;#=GxDn2Xcht zV4uW;%EBU0WAzp*s9RjD$yEeuIu><;4Cn$mo*!g7xb*}v{1y+?h&KtVg~VHqHJ6&Us(RK{A2mgApt6)Aeim91cv|<2eSY(7c&Pl2O}2~7b6E# z(Hu~b1gd>u4KS1Fl92PaHTV*@XcXP;h)2tA^s#Sw~FEo%*HiWsQ)sbK@D1Q$o*k_@%%;NpmV zA!98^4Mz$Wv>1|r7CxN844RUDMa2vZ3{_R|QYR0oph?fqPf=6a~16(#B%+o8X0jX*L z5zQc?6-2awh;~qO3z9*1+81?zgh1VDa5^sP193quyrK!9<`Oh7fGSNyhA5f=QZy4p zfYN@^ED&ophyXhZoU*|Lxc*f_P2TaK^c|lL^%|tq{02(ypav)`xpSZ_$jMA90;Tv{>}iR`C5Z)@MW7By5vciD z1ZwKv5`>ED!D6wvhz*pdS#$GK5_5_`!(m0BTDu6;TP^}+m?F?fS`iP(%aI_JfU%WS z7G&n77x98bz-5V0aYsvfB7N-ZuaE&{cgZ*e#V1jPF}`nuj?DFzK+atFBv zhx&vB$Gdn2-Qr9u%Fm4l4LjcAgSCLl@^eaa!PP-hW@27^aZYCLE$)KMg80n5;*!Li zoFWO3rJ&*(+};4^aIpW8${9p#aMDVN`&$Wf*ywSeUq& tSQteZSy-4DS^k3y9C+uMiIM3i(_b+@P+N(Kk?B7Z6W>3EdJcXbHvp;5M=AgS literal 0 HcmV?d00001 diff --git a/cameron/embed.py b/cameron/embed.py new file mode 100644 index 0000000..2f5e179 --- /dev/null +++ b/cameron/embed.py @@ -0,0 +1,305 @@ +from pathlib import Path +from fastapi import Depends, HTTPException, status +from fastapi.responses import FileResponse +from modal import Stub, web_endpoint, Image, Secret, method, NetworkFileSystem +import os +from typing import Dict +import json + +from starlette.requests import Request + +APP_NAME = "mongo-hack" + +stub = Stub(name=APP_NAME) +RESULTS_DIR = "/results" +results_volume = NetworkFileSystem.from_name(f"{APP_NAME}-results-vol", create_if_missing=True) +# results_volume = NetworkFileSystem.new().persisted(f"{APP_NAME}-results-vol") + +image = ( + Image.debian_slim( + python_version="3.10" + ).pip_install( + "replicate", + "python-jose", + "requests", + "openai", + "pymongo", + "scikit-learn", + "numpy" + ) +) + +@stub.function(image=image, keep_warm=1, secrets=[Secret.from_name("mongo-hack-secret")]) +@web_endpoint(method="POST") +def handle_request( + payload: Dict, + request: Request +): + + from pymongo import MongoClient + client = MongoClient("mongodb+srv://cameron:testing123@mongo-hackathon.4lo2sdu.mongodb.net/") + db = client["mongo-hackathon"] + print(db) + + collection = db["documents"] + input_text=payload["text"] + + import openai + fireworks_client = openai.OpenAI( + api_key=os.getenv('FIREWORKS_API_KEY'), + base_url="https://api.fireworks.ai/inference/v1" + ) + + # Check if input text is already in the database + existing_documents = [d for d in collection.find({"text": input_text})] + document_exists = len(existing_documents) != 0 + + print("Document exists:", document_exists) + + # If we already have the document, get the embedding. + if document_exists: + embedding = existing_documents[0]["embedding"] + else: + response = fireworks_client.embeddings.create( + model="nomic-ai/nomic-embed-text-v1.5", + input=input_text, + dimensions=768, + ) + + embedding = response.data[0].embedding + + print(len(embedding)) + + # Okay -- if our document exists, check if it has a title, and if it does, use it. Otherwise, generate a title. + # if document_exists: + # print("Document exists, checking for title") + # if "title" in existing_documents[0] and existing_documents[0]["title"] != "": + # print("Title exists, using it") + # new_title = existing_documents[0]["title"] + # print("Old title:", new_title) + # else: + # print("Title doesn't exist, generating it") + # new_title = fire_function__call_generate_title(fireworks_client, input_text) + # print("New title:", new_title) + + # # Update the document + # collection.update_one({"_id": existing_documents[0]["_id"]}, {"$set": {"title": new_title}}) + # else: + # new_title = fire_function__call_generate_title(fireworks_client, input_text) + new_title = "" + + document = { + # "_id": ObjectId("6624177242be2e1d80040517"), + "embedding": embedding, + "text": input_text, + "title": new_title + } + + if not document_exists: + result = collection.insert_one(document) + print("Inserted document ID:", result.inserted_id) + + def query_results(query_vec): + results = collection.aggregate([ + { + '$vectorSearch': { + "index": "embedding_index", + "path": "embedding", + "queryVector": query_vec, + "numCandidates": 1000, + "limit": 100, + } + } + ]) + return results + + # run pipeline + results = query_results(embedding) + results_collected = [r for r in results] + print("reslts collected shape") + print(len(results_collected)) + + import numpy as np + from sklearn.decomposition import PCA + from sklearn.preprocessing import MinMaxScaler + + def smush(matrix): + pca = PCA(n_components=2) + print(matrix.shape) + smushed = pca.fit_transform(matrix) + return smushed + + # Converts a matrix to a JSON with the format + # { + # "data": [ + # { + # "x": x1, + # "y": y1, + # "text": text1 + # } + # ... + # ] + # } + def bundle(texts, titles, matrix): + smushed = smush(matrix) + + # Normalize the matrix + scaler = MinMaxScaler(feature_range=(-1, 1)) + smushed = scaler.fit_transform(matrix) + + return { + "data": [ + { + "x": x, + "y": y, + "text": text, + "title": title + } + for x, y, text, title in zip(smushed[:, 0], smushed[:, 1], texts, titles) + ] + } + + # Unpack things + texts = [t["text"] for t in results_collected] + embeddings = [t["embedding"] for t in results_collected] + + print("texts length") + print(len(texts)) + + print("embeddings length") + print(len(embeddings)) + + matrix = np.array(embeddings) + return json.dumps(bundle(texts, [""] * len(texts), matrix)) + + +def fire_function_call(client): + + messages = [ + { + "role": "system", + "content": "You are a very creative assistant with access to functions. Use them if required." + }, + { + "role": "user", + "content": "Select a super random topic and create a very short title and super detailed long text description for the topic" + } + ] + + tools = [ + { + "type": "function", + "function": { + "name": "get_title_text", + "description": "Get the random text and title.", + "parameters": { + "type": "object", + "properties": { + "random_text": { + "type": "string", + "description": "random text", + }, + "title": { + "type": "string", + "description": "title for random text." + }, + }, + "required": ["random_text", "title"], + }, + }, + } + ] + + chat_completion = client.chat.completions.create( + model="accounts/fireworks/models/fw-function-call-34b-v0", + messages=messages, + tools=tools, + tool_choice="auto", + temperature=0.8 + ) + + print(repr(chat_completion.choices[0].message.model_dump())) + + message_data = chat_completion.choices[0].message.model_dump() + + # Assuming message_data now contains a dictionary with the 'tool_calls' key + tool_calls = message_data['tool_calls'] + + # Extract the function arguments from the first tool call + function_args_str = tool_calls[0]['function']['arguments'] + + # Parse the JSON string in function arguments + function_args = json.loads(function_args_str) + + # Extract 'random_text' and 'title' values + random_text = function_args['random_text'] + title = function_args['title'] + + print("Random Text:", random_text) + print("Title:", title) + + return random_text, title + + + + +def fire_function__call_generate_title(client, text): + + messages = [ + { + "role": "system", + "content": "You are an assistant good at creative titles with access to functions. Please use the get_title function in your response." + }, + { + "role": "user", + "content": f"Create a very short title for the input text: {text}" + } + ] + + tools = [ + { + "type": "function", + "function": { + "name": "get_title", + "description": "Generate a short title.", + "parameters": { + "type": "object", + "properties": { + "title": { + "type": "string", + "description": "title for input text." + }, + }, + "required": ["title"], + }, + }, + } + ] + + chat_completion = client.chat.completions.create( + model="accounts/fireworks/models/fw-function-call-34b-v0", + messages=messages, + tools=tools, + tool_choice="auto", + temperature=0.1 + ) + + print(repr(chat_completion.choices[0].message.model_dump())) + + message_data = chat_completion.choices[0].message.model_dump() + + # Assuming message_data now contains a dictionary with the 'tool_calls' key + tool_calls = message_data['tool_calls'] + + # Extract the function arguments from the first tool call + function_args_str = tool_calls[0]['function']['arguments'] + + # Parse the JSON string in function arguments + function_args = json.loads(function_args_str) + + # Extract 'random_text' and 'title' values + title = function_args['title'] + + print("Title:", title) + + return title \ No newline at end of file diff --git a/cameron/env.jl b/cameron/env.jl new file mode 100644 index 0000000..057f3d8 --- /dev/null +++ b/cameron/env.jl @@ -0,0 +1,3 @@ +ENV["FIREWORKS_API_KEY"] = "bm38HrH82R4Qc2AdindG4xSHlVb9AlJMcNWyoRAH0akh1Mze" +ENV["SSL_CERT_DIR"] = "/etc/ssl/certs/" +ENV["MONGO_CONNSTRING"] = "mongodb+srv://cameron:testing123@mongo-hackathon.4lo2sdu.mongodb.net/?retryWrites=true&w=majority&appName=mongo-hackathon?tlsCAFile=/etc/ssl/certs/ca-certificates.crt" diff --git a/cameron/fireworks.py b/cameron/fireworks.py new file mode 100644 index 0000000..a8b686e --- /dev/null +++ b/cameron/fireworks.py @@ -0,0 +1,12 @@ +import openai + +client = openai.OpenAI( + base_url = "https://api.fireworks.ai/inference/v1", + api_key="bm38HrH82R4Qc2AdindG4xSHlVb9AlJMcNWyoRAH0akh1Mze", +) +response = client.embeddings.create( + model="nomic-ai/nomic-embed-text-v1.5", + input="search_document: Spiderman was a particularly entertaining movie with...", +) + +print(response) \ No newline at end of file diff --git a/cameron/go.jl b/cameron/go.jl new file mode 100644 index 0000000..44bb84b --- /dev/null +++ b/cameron/go.jl @@ -0,0 +1,145 @@ +using Mongoc +using PromptingTools +using Clustering +using MultivariateStats +using Statistics +using Plots + +# get env shit +include("env.jl") + +connection_string = ENV["MONGO_CONNSTRING"] +client = Mongoc.Client(connection_string) +@assert Mongoc.ping(client)["ok"] == 1 +db = client["mongo-hackathon"] +collection = db["documents"] + +# Convenience function to get embedding +function embed_fireworks(text::AbstractString; model="nomic-ai/nomic-embed-text-v1.5") + return PromptingTools.aiembed( + PromptingTools.FireworksOpenAISchema(), + text, + model=model + ) +end + +function embed(text::AbstractString; model="mxbai-embed-large") + return PromptingTools.aiembed( + PromptingTools.OllamaSchema(), + text, + model=model + ).content |> Array +end + +# Random text generator +function makeprompt() + # + new_prompt = aigenerate( + PromptingTools.OllamaSchema(), + "Give me an interesting fact. Please respond only with the fact.", + model="mistral:latest" + ).content + + println(new_prompt) + + return new_prompt + + # Ask more + # response = aigenerate( + # PromptingTools.OllamaSchema(), + # "Please tell me more about $new_prompt", + # model="gemma:2b" + # ).content + + # # Make a title for this text + # title = aigenerate( + # PromptingTools.OllamaSchema(), + # "Please give me a title for this text: $new_prompt", + # model="gemma:2b" + # ).content + + # return (title, new_prompt, response) +end + +# bson convenience function +bson(x) = Mongoc.BSON(x) + +# Function to upload text to mongo +function upload(text::AbstractString; model="nomic-embed-text:latest") + # Check if the text already exists + exists = Mongoc.find_one(collection, bson(Dict("text" => text))) + if !isnothing(exists) + @info "Doc exists, skipping insert" + return exists + end + + # Get embedding + embedding = embed(text; model=model) + + # Start a document + doc = Dict( + "text" => text, + "embedding" => embedding + ) + + # Insert into collection + push!(collection, bson(doc)) +end + +# upload("cameron") +# upload("gus") +# upload("anand") +# upload("dog") +# upload("cat") + +for i in 1:1000 + upload(makeprompt()) +end + + + + + +# { +# "$vectorSearch": { +# "index": "", +# "path": "", +# "queryVector": [], +# "numCandidates": , +# "limit": , +# "filter": {} +# } +# } + +# qvec = "cameron" +# query_embedding = embed(qvec) +# query_doc = bson(Dict( +# "\$vectorSearch" => Dict( +# "queryVector" => [query_embedding], +# ) +# )) + +# println(query_doc) + +# for c in Mongoc.aggregate(collection, query_doc) +# println(c) +# end + +# docs = collect(collection) +embeddings = reduce(hcat, map(identity, doc["embedding"]) for doc in docs) +texts = [doc["text"] for doc in docs] +M = fit(PCA, embeddings; maxoutdim=2) +smushed = predict(M, embeddings) +scanned = Clustering.dbscan(smushed, 0.5) + +cluster_docs = Dict{Int,Vector{String}}() +for (assignment, text) = zip(scanned.assignments, texts) + if !haskey(cluster_docs, assignment) + cluster_docs[assignment] = String[] + end + push!(cluster_docs[assignment], text) +end + +# Now we want to transform this matrix so that the first row is the origin +transformation_matrix = smushed + diff --git a/cameron/parquet-load.py b/cameron/parquet-load.py new file mode 100644 index 0000000..3bcf215 --- /dev/null +++ b/cameron/parquet-load.py @@ -0,0 +1,43 @@ +import pandas as pd +import glob +import requests +import json +import os # Make sure to import os at the top of your file + +def load_parquet_files(folder_path): + # Expand the user's home directory + folder_path = os.path.expanduser(folder_path) + # Create a pattern to match all parquet files in the folder + pattern = f"{folder_path}/*.parquet" + # Use glob to find all files matching the pattern + parquet_files = glob.glob(pattern) + # Load and concatenate all parquet files into a single DataFrame + df = pd.concat([pd.read_parquet(file) for file in parquet_files[0:1]], ignore_index=True) + return df + +def post_text_to_endpoint(df, url): + # Iterate over each row in the DataFrame + for index, row in df.iterrows(): + # Extract text from the current row + text = row['text'] + # Prepare the data for POST request + data = json.dumps({"text": text}) + headers = {'Content-Type': 'application/json'} + # Send POST request to the specified URL + response = requests.post(url, data=data, headers=headers) + # Check if the request was successful + if response.status_code == 200: + print(f"Successfully posted text from row {index}") + else: + print(f"Failed to post text from row {index}. Status code: {response.status_code}") + +# Define the folder path and URL +folder_path = "~/code/tiny-strange-textbooks" +url = "https://cpfiffer--mongo-hack-handle-request-dev.modal.run/" + +# Load parquet files into a DataFrame +df = load_parquet_files(folder_path) +print(df) + +# Post text to the specified endpoint +post_text_to_endpoint(df, url) diff --git a/cameron/run.sh b/cameron/run.sh new file mode 100644 index 0000000..c510360 --- /dev/null +++ b/cameron/run.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +# Build the Docker image +docker build -t myapp . + +# Run the Docker container +docker run -p 5000:5000 myapp \ No newline at end of file diff --git a/cameron/server.py b/cameron/server.py new file mode 100644 index 0000000..c121534 --- /dev/null +++ b/cameron/server.py @@ -0,0 +1,35 @@ +# ENV["FIREWORKS_API_KEY"] = "bm38HrH82R4Qc2AdindG4xSHlVb9AlJMcNWyoRAH0akh1Mze" +# ENV["SSL_CERT_DIR"] = "/etc/ssl/certs/" +# ENV["MONGO_CONNSTRING"] = "mongodb+srv://cameron:testing123@mongo-hackathon.4lo2sdu.mongodb.net/?retryWrites=true&w=majority&appName=mongo-hackathon?tlsCAFile=/etc/ssl/certs/ca-certificates.crt" + + +import os +from flask import Flask, request, jsonify +from pymongo import MongoClient + +app = Flask(__name__) + +# Connect to MongoDB +mongo_connstring = os.environ["MONGO_CONNSTRING"] +client = MongoClient(mongo_connstring) +db = client.data + +@app.route('/text', methods=['POST']) +def handle_text(): + # Get the text from the request + text = request.json['text'] + + # TODO: Process the text and generate x and y + x = "example_x" + y = "example_y" + + # Return the response as JSON + response = { + "documents": text, + "x": x, + "y": y + } + return jsonify(response) + +if __name__ == '__main__': + app.run() diff --git a/cameron/smush.py b/cameron/smush.py new file mode 100644 index 0000000..53ac072 --- /dev/null +++ b/cameron/smush.py @@ -0,0 +1,79 @@ +import numpy as np +import matplotlib.pyplot as plt +from sklearn.preprocessing import MinMaxScaler + +# Define the dimensions of the matrix +n = 1000 +k = 2 # Use 2D data for easier visualization + +# Create the matrix +data = np.random.randn(n, k) + +# Re-center the matrix around the first row +recentered_data = data - data[0] + +# Define the rotation angle in degrees +rotation_angle_deg = 45 +# Convert rotation angle to radians +rotation_angle_rad = np.deg2rad(rotation_angle_deg) + +# Define scaling factors for each axis +scaling_x = 1.5 +scaling_y = 0.75 + +# Define shear factors for each axis +shear_x = 0.5 +shear_y = 0.2 + +# Create a 2D rotation matrix +rotation_matrix = np.array([ + [np.cos(rotation_angle_rad), -np.sin(rotation_angle_rad)], + [np.sin(rotation_angle_rad), np.cos(rotation_angle_rad)] +]) + +# Create a 2D scaling matrix +scaling_matrix = np.array([ + [scaling_x, 0], + [0, scaling_y] +]) + +# Create a 2D shear matrix +shear_matrix = np.array([ + [1, shear_x], + [shear_y, 1] +]) + +# Combine rotation, scaling, and shear matrices +transformation_matrix = np.dot(rotation_matrix, np.dot(scaling_matrix, shear_matrix)) + +# Apply the transformation matrix to the recentered data +transformed_data = np.dot(recentered_data, transformation_matrix) + +# Normalize the transformed data to be between -1 and 1 +scaler = MinMaxScaler(feature_range=(-1, 1)) +normalized_transformed_data = scaler.fit_transform(transformed_data) + +# Plotting the original and normalized transformed data +plt.figure(figsize=(10, 5)) + +# Plot original data (re-centered) +plt.subplot(1, 2, 1) +plt.scatter(recentered_data[:, 0], recentered_data[:, 1], color='b', label='Original Data') +plt.scatter(recentered_data[0, 0], recentered_data[0, 1], color='r', marker='*', s=100, label='First Row') +plt.title('Recentered Data') +plt.xlabel('X') +plt.ylabel('Y') +plt.legend() + +# Plot normalized transformed data +plt.subplot(1, 2, 2) +plt.scatter(normalized_transformed_data[:, 0], normalized_transformed_data[:, 1], color='r', label='Normalized Transformed Data') +plt.scatter(normalized_transformed_data[0, 0], normalized_transformed_data[0, 1], color='b', marker='*', s=100, label='First Row') +plt.title('Normalized Transformed Data') +plt.xlabel('X') +plt.ylabel('Y') +plt.legend() + +# Show the plots +plt.tight_layout() +plt.show() diff --git a/cameron/upload.jl b/cameron/upload.jl new file mode 100644 index 0000000..8912f3e --- /dev/null +++ b/cameron/upload.jl @@ -0,0 +1,50 @@ +using HTTP +using JSON3 +using Parquet2, DataFrames +# df = DataFrame(read_parquet(path)) + +function load_parquet_files(folder_path::String) + # load the parquet files + parquet_files = filter( + x -> endswith(x, ".parquet"), + readdir(folder_path, join=true) + ) + + # Load and concatenate all parquet files into a single DataFrame + dfs = DataFrame[] + for file in parquet_files[1:10] + ds = Parquet2.Dataset(file) + df = DataFrame(ds; copycols=false) + push!(dfs, df) + end + return reduce(vcat, dfs) +end + +function post_text_to_endpoint(df::DataFrame, url::String) + # Iterate over each row in the DataFrame + for row in eachrow(df) + # Extract text from the current row + text = row["text"] + # Prepare the data for POST request + data = JSON3.write(Dict("text" => text)) + headers = Dict("Content-Type" => "application/json") + # Send POST request to the specified URL + response = HTTP.post(url, headers=headers, body=data) + # Check if the request was successful + if response.status == 200 + println("Successfully posted text from row") + else + println("Failed to post text from row. Status code: $(response.status)") + end + end +end + +# Define the folder path and URL +folder_path = joinpath(homedir(), "code/tiny-strange-textbooks") +url = "https://cpfiffer--mongo-hack-handle-request-dev.modal.run/" + +# Load parquet files into a DataFrame +df = load_parquet_files(folder_path) + +# Post text to the specified endpoint +post_text_to_endpoint(df, url) -- knotmirror 0.0.1