From 9b956ffc458609db01e120dddf9554fc24828e5c Mon Sep 17 00:00:00 2001 From: Tyler Hutcherson Date: Mon, 24 Feb 2025 13:44:38 -0500 Subject: [PATCH 1/7] update redisvl --- .gitignore | 3 +- backend/poetry.lock | 260 ++++++++++++++++++-- backend/productsearch/api/routes/product.py | 30 +-- backend/productsearch/db/load.py | 3 +- backend/productsearch/db/redis_helpers.py | 8 +- backend/pyproject.toml | 8 +- docker-local-redis.yml | 2 +- 7 files changed, 254 insertions(+), 60 deletions(-) diff --git a/.gitignore b/.gitignore index 027fa3e..d66a270 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,5 @@ product_metadata.json product_vectors.json data/ !backend/data -.env \ No newline at end of file +.env +.python-version diff --git a/backend/poetry.lock b/backend/poetry.lock index c919a9e..883707a 100644 --- a/backend/poetry.lock +++ b/backend/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. +# This file is automatically @generated by Poetry 2.0.1 and should not be changed by hand. [[package]] name = "annotated-types" @@ -6,6 +6,7 @@ version = "0.7.0" description = "Reusable constraint types to use with typing.Annotated" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53"}, {file = "annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89"}, @@ -17,6 +18,7 @@ version = "4.4.0" description = "High level compatibility layer for multiple asynchronous event loop implementations" optional = false python-versions = ">=3.8" +groups = ["main", "dev"] files = [ {file = "anyio-4.4.0-py3-none-any.whl", hash = "sha256:c1b2d8f46a8a812513012e1107cb0e68c17159a7a594208005a57dc776e1bdc7"}, {file = "anyio-4.4.0.tar.gz", hash = "sha256:5aadc6a1bbb7cdb0bede386cac5e2940f5e2ff3aa20277e991cf028e0585ce94"}, @@ -38,6 +40,7 @@ version = "3.1.0" description = "An abstract syntax tree for Python with inference support." optional = false python-versions = ">=3.8.0" +groups = ["dev"] files = [ {file = "astroid-3.1.0-py3-none-any.whl", hash = "sha256:951798f922990137ac090c53af473db7ab4e70c770e6d7fae0cec59f74411819"}, {file = "astroid-3.1.0.tar.gz", hash = "sha256:ac248253bfa4bd924a0de213707e7ebeeb3138abeb48d798784ead1e56d419d4"}, @@ -49,6 +52,7 @@ version = "2.4.1" description = "Annotate AST trees with source code positions" optional = false python-versions = "*" +groups = ["main"] files = [ {file = "asttokens-2.4.1-py2.py3-none-any.whl", hash = "sha256:051ed49c3dcae8913ea7cd08e46a606dba30b79993209636c4875bc1d637bc24"}, {file = "asttokens-2.4.1.tar.gz", hash = "sha256:b03869718ba9a6eb027e134bfdf69f38a236d681c83c160d510768af11254ba0"}, @@ -67,6 +71,8 @@ version = "4.0.3" description = "Timeout context manager for asyncio programs" optional = false python-versions = ">=3.7" +groups = ["main"] +markers = "python_full_version < \"3.11.3\"" files = [ {file = "async-timeout-4.0.3.tar.gz", hash = "sha256:4640d96be84d82d02ed59ea2b7105a0f7b33abe8703703cd0ab0bf87c427522f"}, {file = "async_timeout-4.0.3-py3-none-any.whl", hash = "sha256:7405140ff1230c310e51dc27b3145b9092d659ce68ff733fb0cefe3ee42be028"}, @@ -78,6 +84,7 @@ version = "23.2.0" description = "Classes Without Boilerplate" optional = false python-versions = ">=3.7" +groups = ["dev"] files = [ {file = "attrs-23.2.0-py3-none-any.whl", hash = "sha256:99b87a485a5820b23b879f04c2305b44b951b502fd64be915879d77a7e8fc6f1"}, {file = "attrs-23.2.0.tar.gz", hash = "sha256:935dc3b529c262f6cf76e50877d35a4bd3c1de194fd41f47a2b7ae8f19971f30"}, @@ -97,6 +104,7 @@ version = "24.4.2" description = "The uncompromising code formatter." optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "black-24.4.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:dd1b5a14e417189db4c7b64a6540f31730713d173f0b63e55fabd52d61d8fdce"}, {file = "black-24.4.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:8e537d281831ad0e71007dcdcbe50a71470b978c453fa41ce77186bbe0ed6021"}, @@ -141,6 +149,7 @@ version = "1.34.150" description = "The AWS SDK for Python" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "boto3-1.34.150-py3-none-any.whl", hash = "sha256:ad648c89a4935590a69341e5430fc42a021489a22de171ee3fd7bb204f9ef0fa"}, {file = "boto3-1.34.150.tar.gz", hash = "sha256:894b222f7850b870a7ac63d7e378ac36c5c34375da24ddc30e131d9fafe369dc"}, @@ -160,6 +169,7 @@ version = "1.34.150" description = "Low-level, data-driven core of boto 3." optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "botocore-1.34.150-py3-none-any.whl", hash = "sha256:b988d47f4d502df85befce11a48002421e4e6ea4289997b5e0261bac5fa76ce6"}, {file = "botocore-1.34.150.tar.gz", hash = "sha256:4d23387e0f076d87b637a2a35c0ff2b8daca16eace36b63ce27f65630c6b375a"}, @@ -179,6 +189,7 @@ version = "2024.7.4" description = "Python package for providing Mozilla's CA Bundle." optional = false python-versions = ">=3.6" +groups = ["main"] files = [ {file = "certifi-2024.7.4-py3-none-any.whl", hash = "sha256:c198e21b1289c2ab85ee4e67bb4b4ef3ead0892059901a8d5b622f24a1101e90"}, {file = "certifi-2024.7.4.tar.gz", hash = "sha256:5a1e7645bc0ec61a09e26c36f6106dd4cf40c6db3a1fb6352b0244e7fb057c7b"}, @@ -190,6 +201,8 @@ version = "1.16.0" description = "Foreign Function Interface for Python calling C code." optional = false python-versions = ">=3.8" +groups = ["dev"] +markers = "os_name == \"nt\" and implementation_name != \"pypy\" or platform_python_implementation != \"PyPy\"" files = [ {file = "cffi-1.16.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:6b3d6606d369fc1da4fd8c357d026317fbb9c9b75d36dc16e90e84c26854b088"}, {file = "cffi-1.16.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:ac0f5edd2360eea2f1daa9e26a41db02dd4b0451b48f7c318e217ee092a213e9"}, @@ -254,6 +267,7 @@ version = "3.3.2" description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." optional = false python-versions = ">=3.7.0" +groups = ["main"] files = [ {file = "charset-normalizer-3.3.2.tar.gz", hash = "sha256:f30c3cb33b24454a82faecaf01b19c18562b1e89558fb6c56de4d9118a032fd5"}, {file = "charset_normalizer-3.3.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:25baf083bf6f6b341f4121c2f3c548875ee6f5339300e08be3f2b2ba1721cdd3"}, @@ -353,6 +367,7 @@ version = "8.1.7" description = "Composable command line interface toolkit" optional = false python-versions = ">=3.7" +groups = ["main", "dev"] files = [ {file = "click-8.1.7-py3-none-any.whl", hash = "sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28"}, {file = "click-8.1.7.tar.gz", hash = "sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de"}, @@ -367,6 +382,7 @@ version = "5.6.2" description = "" optional = false python-versions = "<4.0,>=3.8" +groups = ["main"] files = [ {file = "cohere-5.6.2-py3-none-any.whl", hash = "sha256:cfecf1343bcaa4091266c5a231fbcb3ccbd80cad05ea093ef80024a117aa3a2f"}, {file = "cohere-5.6.2.tar.gz", hash = "sha256:6bb901afdfb02f62ad8ed2d82f12d8ea87a6869710f5f880cb89190c4e994805"}, @@ -390,6 +406,8 @@ version = "0.4.6" description = "Cross-platform colored terminal text." optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" +groups = ["main", "dev"] +markers = "platform_system == \"Windows\" or sys_platform == \"win32\"" files = [ {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, @@ -401,6 +419,7 @@ version = "15.0.1" description = "Colored terminal output for Python's logging module" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" +groups = ["main"] files = [ {file = "coloredlogs-15.0.1-py2.py3-none-any.whl", hash = "sha256:612ee75c546f53e92e70049c9dbfcc18c935a2b9a53b66085ce9ef6a6e5c0934"}, {file = "coloredlogs-15.0.1.tar.gz", hash = "sha256:7c991aa71a4577af2f82600d8f8f3a89f936baeaf9b50a9c197da014e5bf16b0"}, @@ -418,6 +437,7 @@ version = "7.6.0" description = "Code coverage measurement for Python" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "coverage-7.6.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:dff044f661f59dace805eedb4a7404c573b6ff0cdba4a524141bc63d7be5c7fd"}, {file = "coverage-7.6.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:a8659fd33ee9e6ca03950cfdcdf271d645cf681609153f218826dd9805ab585c"}, @@ -482,6 +502,7 @@ version = "43.0.0" description = "cryptography is a package which provides cryptographic recipes and primitives to Python developers." optional = false python-versions = ">=3.7" +groups = ["dev"] files = [ {file = "cryptography-43.0.0-cp37-abi3-macosx_10_9_universal2.whl", hash = "sha256:64c3f16e2a4fc51c0d06af28441881f98c5d91009b8caaff40cf3548089e9c74"}, {file = "cryptography-43.0.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3dcdedae5c7710b9f97ac6bba7e1052b95c7083c9d0e9df96e02a1932e777895"}, @@ -531,6 +552,7 @@ version = "5.1.1" description = "Decorators for Humans" optional = false python-versions = ">=3.5" +groups = ["main"] files = [ {file = "decorator-5.1.1-py3-none-any.whl", hash = "sha256:b8c3f85900b9dc423225913c5aace94729fe1fa9763b38939a95226f02d37186"}, {file = "decorator-5.1.1.tar.gz", hash = "sha256:637996211036b6385ef91435e4fae22989472f9d571faba8927ba8253acbc330"}, @@ -542,6 +564,7 @@ version = "0.3.8" description = "serialize all of Python" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "dill-0.3.8-py3-none-any.whl", hash = "sha256:c36ca9ffb54365bdd2f8eb3eff7d2a21237f8452b57ace88b1ac615b7e815bd7"}, {file = "dill-0.3.8.tar.gz", hash = "sha256:3ebe3c479ad625c4553aca177444d89b486b1d84982eeacded644afc0cf797ca"}, @@ -557,6 +580,7 @@ version = "1.9.0" description = "Distro - an OS platform information API" optional = false python-versions = ">=3.6" +groups = ["main"] files = [ {file = "distro-1.9.0-py3-none-any.whl", hash = "sha256:7bffd925d65168f85027d8da9af6bddab658135b840670a223589bc0c8ef02b2"}, {file = "distro-1.9.0.tar.gz", hash = "sha256:2fa77c6fd8940f116ee1d6b94a2f90b13b5ea8d019b98bc8bafdcabcdd9bdbed"}, @@ -568,6 +592,7 @@ version = "2.6.1" description = "DNS toolkit" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "dnspython-2.6.1-py3-none-any.whl", hash = "sha256:5ef3b9680161f6fa89daf8ad451b5f1a33b18ae8a1c6778cdf4b43f08c0a6e50"}, {file = "dnspython-2.6.1.tar.gz", hash = "sha256:e8f0f9c23a7b7cb99ded64e6c3a6f3e701d78f50c55e002b839dea7225cff7cc"}, @@ -588,6 +613,7 @@ version = "2.2.0" description = "A robust email address syntax and deliverability validation library." optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "email_validator-2.2.0-py3-none-any.whl", hash = "sha256:561977c2d73ce3611850a06fa56b414621e0c8faa9d66f2611407d87465da631"}, {file = "email_validator-2.2.0.tar.gz", hash = "sha256:cb690f344c617a714f22e66ae771445a1ceb46821152df8e165c5f9a364582b7"}, @@ -603,6 +629,7 @@ version = "2.0.1" description = "Get the currently executing AST node of a frame, and other information" optional = false python-versions = ">=3.5" +groups = ["main"] files = [ {file = "executing-2.0.1-py2.py3-none-any.whl", hash = "sha256:eac49ca94516ccc753f9fb5ce82603156e590b27525a8bc32cce8ae302eb61bc"}, {file = "executing-2.0.1.tar.gz", hash = "sha256:35afe2ce3affba8ee97f2d69927fa823b08b472b7b994e36a52a964b93d16147"}, @@ -617,6 +644,7 @@ version = "0.111.1" description = "FastAPI framework, high performance, easy to learn, fast to code, ready for production" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "fastapi-0.111.1-py3-none-any.whl", hash = "sha256:4f51cfa25d72f9fbc3280832e84b32494cf186f50158d364a8765aabf22587bf"}, {file = "fastapi-0.111.1.tar.gz", hash = "sha256:ddd1ac34cb1f76c2e2d7f8545a4bcb5463bce4834e81abf0b189e0c359ab2413"}, @@ -642,6 +670,7 @@ version = "0.0.4" description = "Run and manage FastAPI apps from the command line with FastAPI CLI. 🚀" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "fastapi_cli-0.0.4-py3-none-any.whl", hash = "sha256:a2552f3a7ae64058cdbb530be6fa6dbfc975dc165e4fa66d224c3d396e25e809"}, {file = "fastapi_cli-0.0.4.tar.gz", hash = "sha256:e2e9ffaffc1f7767f488d6da34b6f5a377751c996f397902eb6abb99a67bde32"}, @@ -659,6 +688,7 @@ version = "1.9.5" description = "Fast read/write of AVRO files" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "fastavro-1.9.5-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:61253148e95dd2b6457247b441b7555074a55de17aef85f5165bfd5facf600fc"}, {file = "fastavro-1.9.5-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b604935d671ad47d888efc92a106f98e9440874108b444ac10e28d643109c937"}, @@ -705,6 +735,7 @@ version = "3.15.4" description = "A platform independent file lock." optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "filelock-3.15.4-py3-none-any.whl", hash = "sha256:6ca1fffae96225dab4c6eaf1c4f4f28cd2568d3ec2a44e15a08520504de468e7"}, {file = "filelock-3.15.4.tar.gz", hash = "sha256:2207938cbc1844345cb01a5a95524dae30f0ce089eba5b00378295a17e3e90cb"}, @@ -721,6 +752,7 @@ version = "2024.6.1" description = "File-system specification" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "fsspec-2024.6.1-py3-none-any.whl", hash = "sha256:3cb443f8bcd2efb31295a5b9fdb02aee81d8452c80d28f97a6d0959e6cee101e"}, {file = "fsspec-2024.6.1.tar.gz", hash = "sha256:fad7d7e209dd4c1208e3bbfda706620e0da5142bebbd9c384afb95b07e798e49"}, @@ -760,6 +792,7 @@ version = "0.14.0" description = "A pure-Python, bring-your-own-I/O implementation of HTTP/1.1" optional = false python-versions = ">=3.7" +groups = ["main"] files = [ {file = "h11-0.14.0-py3-none-any.whl", hash = "sha256:e3fe4ac4b851c468cc8363d500db52c2ead036020723024a109d37346efaa761"}, {file = "h11-0.14.0.tar.gz", hash = "sha256:8f19fbbe99e72420ff35c00b27a34cb9937e902a8b810e2c88300c6f0a3b699d"}, @@ -771,6 +804,7 @@ version = "1.0.5" description = "A minimal low-level HTTP client." optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "httpcore-1.0.5-py3-none-any.whl", hash = "sha256:421f18bac248b25d310f3cacd198d55b8e6125c107797b609ff9b7a6ba7991b5"}, {file = "httpcore-1.0.5.tar.gz", hash = "sha256:34a38e2f9291467ee3b44e89dd52615370e152954ba21721378a87b2960f7a61"}, @@ -792,6 +826,7 @@ version = "0.6.1" description = "A collection of framework independent HTTP protocol utils." optional = false python-versions = ">=3.8.0" +groups = ["main"] files = [ {file = "httptools-0.6.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:d2f6c3c4cb1948d912538217838f6e9960bc4a521d7f9b323b3da579cd14532f"}, {file = "httptools-0.6.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:00d5d4b68a717765b1fabfd9ca755bd12bf44105eeb806c03d1962acd9b8e563"}, @@ -840,6 +875,7 @@ version = "0.27.0" description = "The next generation HTTP client." optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "httpx-0.27.0-py3-none-any.whl", hash = "sha256:71d5465162c13681bff01ad59b2cc68dd838ea1f10e51574bac27103f00c91a5"}, {file = "httpx-0.27.0.tar.gz", hash = "sha256:a0cb88a46f32dc874e04ee956e4c2764aba2aa228f650b06788ba6bda2962ab5"}, @@ -864,6 +900,7 @@ version = "0.4.0" description = "Consume Server-Sent Event (SSE) messages with HTTPX." optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "httpx-sse-0.4.0.tar.gz", hash = "sha256:1e81a3a3070ce322add1d3529ed42eb5f70817f45ed6ec915ab753f961139721"}, {file = "httpx_sse-0.4.0-py3-none-any.whl", hash = "sha256:f329af6eae57eaa2bdfd962b42524764af68075ea87370a2de920af5341e318f"}, @@ -875,6 +912,7 @@ version = "0.24.3" description = "Client library to download and publish models, datasets and other repos on the huggingface.co hub" optional = false python-versions = ">=3.8.0" +groups = ["main"] files = [ {file = "huggingface_hub-0.24.3-py3-none-any.whl", hash = "sha256:69ecce486dd6cdad69937ba76779e893c224a670a9d947636c1d5cbd049e44d8"}, {file = "huggingface_hub-0.24.3.tar.gz", hash = "sha256:bfdc05cc9b64a0e24e8614a44222698799183268f6b68be209aa2df70cff2cde"}, @@ -909,6 +947,7 @@ version = "10.0" description = "Human friendly output for text interfaces using Python" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" +groups = ["main"] files = [ {file = "humanfriendly-10.0-py2.py3-none-any.whl", hash = "sha256:1697e1a8a8f550fd43c2865cd84542fc175a61dcb779b6fee18cf6b6ccba1477"}, {file = "humanfriendly-10.0.tar.gz", hash = "sha256:6b0b831ce8f15f7300721aa49829fc4e83921a9a301cc7f606be6686a2288ddc"}, @@ -923,6 +962,7 @@ version = "3.7" description = "Internationalized Domain Names in Applications (IDNA)" optional = false python-versions = ">=3.5" +groups = ["main", "dev"] files = [ {file = "idna-3.7-py3-none-any.whl", hash = "sha256:82fee1fc78add43492d3a1898bfa6d8a904cc97d8427f683ed8e798d07761aa0"}, {file = "idna-3.7.tar.gz", hash = "sha256:028ff3aadf0609c1fd278d8ea3089299412a7a8b9bd005dd08b9f8285bcb5cfc"}, @@ -934,6 +974,7 @@ version = "2.0.0" description = "brain-dead simple config-ini parsing" optional = false python-versions = ">=3.7" +groups = ["dev"] files = [ {file = "iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374"}, {file = "iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3"}, @@ -945,6 +986,7 @@ version = "8.26.0" description = "IPython: Productive Interactive Computing" optional = false python-versions = ">=3.10" +groups = ["main"] files = [ {file = "ipython-8.26.0-py3-none-any.whl", hash = "sha256:e6b347c27bdf9c32ee9d31ae85defc525755a1869f14057e900675b9e8d6e6ff"}, {file = "ipython-8.26.0.tar.gz", hash = "sha256:1cec0fbba8404af13facebe83d04436a7434c7400e59f47acf467c64abd0956c"}, @@ -982,6 +1024,7 @@ version = "5.13.2" description = "A Python utility / library to sort Python imports." optional = false python-versions = ">=3.8.0" +groups = ["dev"] files = [ {file = "isort-5.13.2-py3-none-any.whl", hash = "sha256:8ca5e72a8d85860d5a3fa69b8745237f2939afe12dbf656afbcb47fe72d947a6"}, {file = "isort-5.13.2.tar.gz", hash = "sha256:48fdfcb9face5d58a4f6dde2e72a1fb8dcaf8ab26f95ab49fab84c2ddefb0109"}, @@ -996,6 +1039,7 @@ version = "0.19.1" description = "An autocompletion tool for Python that can be used for text editors." optional = false python-versions = ">=3.6" +groups = ["main"] files = [ {file = "jedi-0.19.1-py2.py3-none-any.whl", hash = "sha256:e983c654fe5c02867aef4cdfce5a2fbb4a50adc0af145f70504238f18ef5e7e0"}, {file = "jedi-0.19.1.tar.gz", hash = "sha256:cf0496f3651bc65d7174ac1b7d043eff454892c708a87d1b683e57b569927ffd"}, @@ -1015,6 +1059,7 @@ version = "3.1.4" description = "A very fast and expressive template engine." optional = false python-versions = ">=3.7" +groups = ["main"] files = [ {file = "jinja2-3.1.4-py3-none-any.whl", hash = "sha256:bc5dd2abb727a5319567b7a813e6a2e7318c39f4f487cfe6c89c6f9c7d25197d"}, {file = "jinja2-3.1.4.tar.gz", hash = "sha256:4a3aee7acbbe7303aede8e9648d13b8bf88a429282aa6122a993f0ac800cb369"}, @@ -1032,6 +1077,7 @@ version = "1.0.1" description = "JSON Matching Expressions" optional = false python-versions = ">=3.7" +groups = ["main"] files = [ {file = "jmespath-1.0.1-py3-none-any.whl", hash = "sha256:02e2e4cc71b5bcab88332eebf907519190dd9e6e82107fa7f83b1003a6252980"}, {file = "jmespath-1.0.1.tar.gz", hash = "sha256:90261b206d6defd58fdd5e85f478bf633a2901798906be2ad389150c5c60edbe"}, @@ -1043,6 +1089,7 @@ version = "1.4.2" description = "Lightweight pipelining with Python functions" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "joblib-1.4.2-py3-none-any.whl", hash = "sha256:06d478d5674cbc267e7496a410ee875abd68e4340feff4490bcb7afb88060ae6"}, {file = "joblib-1.4.2.tar.gz", hash = "sha256:2382c5816b2636fbd20a09e0f4e9dad4736765fdfb7dca582943b9c1366b3f0e"}, @@ -1054,6 +1101,7 @@ version = "3.0.0" description = "Python port of markdown-it. Markdown parsing, done right!" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "markdown-it-py-3.0.0.tar.gz", hash = "sha256:e3f60a94fa066dc52ec76661e37c851cb232d92f9886b15cb560aaada2df8feb"}, {file = "markdown_it_py-3.0.0-py3-none-any.whl", hash = "sha256:355216845c60bd96232cd8d8c40e8f9765cc86f46880e43a8fd22dc1a1a8cab1"}, @@ -1078,6 +1126,7 @@ version = "2.1.5" description = "Safely add untrusted strings to HTML/XML markup." optional = false python-versions = ">=3.7" +groups = ["main"] files = [ {file = "MarkupSafe-2.1.5-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:a17a92de5231666cfbe003f0e4b9b3a7ae3afb1ec2845aadc2bacc93ff85febc"}, {file = "MarkupSafe-2.1.5-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:72b6be590cc35924b02c78ef34b467da4ba07e4e0f0454a2c5907f473fc50ce5"}, @@ -1147,6 +1196,7 @@ version = "0.1.7" description = "Inline Matplotlib backend for Jupyter" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "matplotlib_inline-0.1.7-py3-none-any.whl", hash = "sha256:df192d39a4ff8f21b1895d72e6a13f5fcc5099f00fa84384e0ea28c2cc0653ca"}, {file = "matplotlib_inline-0.1.7.tar.gz", hash = "sha256:8423b23ec666be3d16e16b60bdd8ac4e86e840ebd1dd11a30b9f117f2fa0ab90"}, @@ -1161,6 +1211,7 @@ version = "0.7.0" description = "McCabe checker, plugin for flake8" optional = false python-versions = ">=3.6" +groups = ["dev"] files = [ {file = "mccabe-0.7.0-py2.py3-none-any.whl", hash = "sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e"}, {file = "mccabe-0.7.0.tar.gz", hash = "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325"}, @@ -1172,17 +1223,55 @@ version = "0.1.2" description = "Markdown URL utilities" optional = false python-versions = ">=3.7" +groups = ["main"] files = [ {file = "mdurl-0.1.2-py3-none-any.whl", hash = "sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8"}, {file = "mdurl-0.1.2.tar.gz", hash = "sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba"}, ] +[[package]] +name = "ml-dtypes" +version = "0.4.1" +description = "" +optional = false +python-versions = ">=3.9" +groups = ["main"] +files = [ + {file = "ml_dtypes-0.4.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:1fe8b5b5e70cd67211db94b05cfd58dace592f24489b038dc6f9fe347d2e07d5"}, + {file = "ml_dtypes-0.4.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8c09a6d11d8475c2a9fd2bc0695628aec105f97cab3b3a3fb7c9660348ff7d24"}, + {file = "ml_dtypes-0.4.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9f5e8f75fa371020dd30f9196e7d73babae2abd51cf59bdd56cb4f8de7e13354"}, + {file = "ml_dtypes-0.4.1-cp310-cp310-win_amd64.whl", hash = "sha256:15fdd922fea57e493844e5abb930b9c0bd0af217d9edd3724479fc3d7ce70e3f"}, + {file = "ml_dtypes-0.4.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:2d55b588116a7085d6e074cf0cdb1d6fa3875c059dddc4d2c94a4cc81c23e975"}, + {file = "ml_dtypes-0.4.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e138a9b7a48079c900ea969341a5754019a1ad17ae27ee330f7ebf43f23877f9"}, + {file = "ml_dtypes-0.4.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:74c6cfb5cf78535b103fde9ea3ded8e9f16f75bc07789054edc7776abfb3d752"}, + {file = "ml_dtypes-0.4.1-cp311-cp311-win_amd64.whl", hash = "sha256:274cc7193dd73b35fb26bef6c5d40ae3eb258359ee71cd82f6e96a8c948bdaa6"}, + {file = "ml_dtypes-0.4.1-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:827d3ca2097085cf0355f8fdf092b888890bb1b1455f52801a2d7756f056f54b"}, + {file = "ml_dtypes-0.4.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:772426b08a6172a891274d581ce58ea2789cc8abc1c002a27223f314aaf894e7"}, + {file = "ml_dtypes-0.4.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:126e7d679b8676d1a958f2651949fbfa182832c3cd08020d8facd94e4114f3e9"}, + {file = "ml_dtypes-0.4.1-cp312-cp312-win_amd64.whl", hash = "sha256:df0fb650d5c582a9e72bb5bd96cfebb2cdb889d89daff621c8fbc60295eba66c"}, + {file = "ml_dtypes-0.4.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:e35e486e97aee577d0890bc3bd9e9f9eece50c08c163304008587ec8cfe7575b"}, + {file = "ml_dtypes-0.4.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:560be16dc1e3bdf7c087eb727e2cf9c0e6a3d87e9f415079d2491cc419b3ebf5"}, + {file = "ml_dtypes-0.4.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ad0b757d445a20df39035c4cdeed457ec8b60d236020d2560dbc25887533cf50"}, + {file = "ml_dtypes-0.4.1-cp39-cp39-win_amd64.whl", hash = "sha256:ef0d7e3fece227b49b544fa69e50e607ac20948f0043e9f76b44f35f229ea450"}, + {file = "ml_dtypes-0.4.1.tar.gz", hash = "sha256:fad5f2de464fd09127e49b7fd1252b9006fb43d2edc1ff112d390c324af5ca7a"}, +] + +[package.dependencies] +numpy = [ + {version = ">=1.23.3", markers = "python_version >= \"3.11\" and python_version < \"3.12\""}, + {version = ">=1.26.0", markers = "python_version >= \"3.12\""}, +] + +[package.extras] +dev = ["absl-py", "pyink", "pylint (>=2.6.0)", "pytest", "pytest-xdist"] + [[package]] name = "mpmath" version = "1.3.0" description = "Python library for arbitrary-precision floating-point arithmetic" optional = false python-versions = "*" +groups = ["main"] files = [ {file = "mpmath-1.3.0-py3-none-any.whl", hash = "sha256:a0b2b9fe80bbcd81a6647ff13108738cfb482d481d826cc0e02f5b35e5c88d2c"}, {file = "mpmath-1.3.0.tar.gz", hash = "sha256:7a28eb2a9774d00c7bc92411c19a89209d5da7c4c9a9e227be8330a23a25b91f"}, @@ -1200,6 +1289,7 @@ version = "1.9.0" description = "Optional static typing for Python" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "mypy-1.9.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:f8a67616990062232ee4c3952f41c779afac41405806042a8126fe96e098419f"}, {file = "mypy-1.9.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:d357423fa57a489e8c47b7c85dfb96698caba13d66e086b412298a1a0ea3b0ed"}, @@ -1246,6 +1336,7 @@ version = "1.0.0" description = "Type system extensions for programs checked with the mypy type checker." optional = false python-versions = ">=3.5" +groups = ["dev"] files = [ {file = "mypy_extensions-1.0.0-py3-none-any.whl", hash = "sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d"}, {file = "mypy_extensions-1.0.0.tar.gz", hash = "sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782"}, @@ -1257,6 +1348,7 @@ version = "3.3" description = "Python package for creating and manipulating graphs and networks" optional = false python-versions = ">=3.10" +groups = ["main"] files = [ {file = "networkx-3.3-py3-none-any.whl", hash = "sha256:28575580c6ebdaf4505b22c6256a2b9de86b316dc63ba9e93abde3d78dfdbcf2"}, {file = "networkx-3.3.tar.gz", hash = "sha256:0c127d8b2f4865f59ae9cb8aafcd60b5c70f3241ebd66f7defad7c4ab90126c9"}, @@ -1275,6 +1367,7 @@ version = "1.26.4" description = "Fundamental package for array computing in Python" optional = false python-versions = ">=3.9" +groups = ["main"] files = [ {file = "numpy-1.26.4-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:9ff0f4f29c51e2803569d7a51c2304de5554655a60c5d776e35b4a41413830d0"}, {file = "numpy-1.26.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:2e4ee3380d6de9c9ec04745830fd9e2eccb3e6cf790d39d7b98ffd19b0dd754a"}, @@ -1320,6 +1413,8 @@ version = "12.1.3.1" description = "CUBLAS native runtime libraries" optional = false python-versions = ">=3" +groups = ["main"] +markers = "platform_machine == \"x86_64\" and platform_system == \"Linux\"" files = [ {file = "nvidia_cublas_cu12-12.1.3.1-py3-none-manylinux1_x86_64.whl", hash = "sha256:ee53ccca76a6fc08fb9701aa95b6ceb242cdaab118c3bb152af4e579af792728"}, {file = "nvidia_cublas_cu12-12.1.3.1-py3-none-win_amd64.whl", hash = "sha256:2b964d60e8cf11b5e1073d179d85fa340c120e99b3067558f3cf98dd69d02906"}, @@ -1331,6 +1426,8 @@ version = "12.1.105" description = "CUDA profiling tools runtime libs." optional = false python-versions = ">=3" +groups = ["main"] +markers = "platform_machine == \"x86_64\" and platform_system == \"Linux\"" files = [ {file = "nvidia_cuda_cupti_cu12-12.1.105-py3-none-manylinux1_x86_64.whl", hash = "sha256:e54fde3983165c624cb79254ae9818a456eb6e87a7fd4d56a2352c24ee542d7e"}, {file = "nvidia_cuda_cupti_cu12-12.1.105-py3-none-win_amd64.whl", hash = "sha256:bea8236d13a0ac7190bd2919c3e8e6ce1e402104276e6f9694479e48bb0eb2a4"}, @@ -1342,6 +1439,8 @@ version = "12.1.105" description = "NVRTC native runtime libraries" optional = false python-versions = ">=3" +groups = ["main"] +markers = "platform_machine == \"x86_64\" and platform_system == \"Linux\"" files = [ {file = "nvidia_cuda_nvrtc_cu12-12.1.105-py3-none-manylinux1_x86_64.whl", hash = "sha256:339b385f50c309763ca65456ec75e17bbefcbbf2893f462cb8b90584cd27a1c2"}, {file = "nvidia_cuda_nvrtc_cu12-12.1.105-py3-none-win_amd64.whl", hash = "sha256:0a98a522d9ff138b96c010a65e145dc1b4850e9ecb75a0172371793752fd46ed"}, @@ -1353,6 +1452,8 @@ version = "12.1.105" description = "CUDA Runtime native Libraries" optional = false python-versions = ">=3" +groups = ["main"] +markers = "platform_machine == \"x86_64\" and platform_system == \"Linux\"" files = [ {file = "nvidia_cuda_runtime_cu12-12.1.105-py3-none-manylinux1_x86_64.whl", hash = "sha256:6e258468ddf5796e25f1dc591a31029fa317d97a0a94ed93468fc86301d61e40"}, {file = "nvidia_cuda_runtime_cu12-12.1.105-py3-none-win_amd64.whl", hash = "sha256:dfb46ef84d73fababab44cf03e3b83f80700d27ca300e537f85f636fac474344"}, @@ -1364,6 +1465,8 @@ version = "9.1.0.70" description = "cuDNN runtime libraries" optional = false python-versions = ">=3" +groups = ["main"] +markers = "platform_machine == \"x86_64\" and platform_system == \"Linux\"" files = [ {file = "nvidia_cudnn_cu12-9.1.0.70-py3-none-manylinux2014_x86_64.whl", hash = "sha256:165764f44ef8c61fcdfdfdbe769d687e06374059fbb388b6c89ecb0e28793a6f"}, {file = "nvidia_cudnn_cu12-9.1.0.70-py3-none-win_amd64.whl", hash = "sha256:6278562929433d68365a07a4a1546c237ba2849852c0d4b2262a486e805b977a"}, @@ -1378,6 +1481,8 @@ version = "11.0.2.54" description = "CUFFT native runtime libraries" optional = false python-versions = ">=3" +groups = ["main"] +markers = "platform_machine == \"x86_64\" and platform_system == \"Linux\"" files = [ {file = "nvidia_cufft_cu12-11.0.2.54-py3-none-manylinux1_x86_64.whl", hash = "sha256:794e3948a1aa71fd817c3775866943936774d1c14e7628c74f6f7417224cdf56"}, {file = "nvidia_cufft_cu12-11.0.2.54-py3-none-win_amd64.whl", hash = "sha256:d9ac353f78ff89951da4af698f80870b1534ed69993f10a4cf1d96f21357e253"}, @@ -1389,6 +1494,8 @@ version = "10.3.2.106" description = "CURAND native runtime libraries" optional = false python-versions = ">=3" +groups = ["main"] +markers = "platform_machine == \"x86_64\" and platform_system == \"Linux\"" files = [ {file = "nvidia_curand_cu12-10.3.2.106-py3-none-manylinux1_x86_64.whl", hash = "sha256:9d264c5036dde4e64f1de8c50ae753237c12e0b1348738169cd0f8a536c0e1e0"}, {file = "nvidia_curand_cu12-10.3.2.106-py3-none-win_amd64.whl", hash = "sha256:75b6b0c574c0037839121317e17fd01f8a69fd2ef8e25853d826fec30bdba74a"}, @@ -1400,6 +1507,8 @@ version = "11.4.5.107" description = "CUDA solver native runtime libraries" optional = false python-versions = ">=3" +groups = ["main"] +markers = "platform_machine == \"x86_64\" and platform_system == \"Linux\"" files = [ {file = "nvidia_cusolver_cu12-11.4.5.107-py3-none-manylinux1_x86_64.whl", hash = "sha256:8a7ec542f0412294b15072fa7dab71d31334014a69f953004ea7a118206fe0dd"}, {file = "nvidia_cusolver_cu12-11.4.5.107-py3-none-win_amd64.whl", hash = "sha256:74e0c3a24c78612192a74fcd90dd117f1cf21dea4822e66d89e8ea80e3cd2da5"}, @@ -1416,6 +1525,8 @@ version = "12.1.0.106" description = "CUSPARSE native runtime libraries" optional = false python-versions = ">=3" +groups = ["main"] +markers = "platform_machine == \"x86_64\" and platform_system == \"Linux\"" files = [ {file = "nvidia_cusparse_cu12-12.1.0.106-py3-none-manylinux1_x86_64.whl", hash = "sha256:f3b50f42cf363f86ab21f720998517a659a48131e8d538dc02f8768237bd884c"}, {file = "nvidia_cusparse_cu12-12.1.0.106-py3-none-win_amd64.whl", hash = "sha256:b798237e81b9719373e8fae8d4f091b70a0cf09d9d85c95a557e11df2d8e9a5a"}, @@ -1430,6 +1541,8 @@ version = "2.20.5" description = "NVIDIA Collective Communication Library (NCCL) Runtime" optional = false python-versions = ">=3" +groups = ["main"] +markers = "platform_machine == \"x86_64\" and platform_system == \"Linux\"" files = [ {file = "nvidia_nccl_cu12-2.20.5-py3-none-manylinux2014_aarch64.whl", hash = "sha256:1fc150d5c3250b170b29410ba682384b14581db722b2531b0d8d33c595f33d01"}, {file = "nvidia_nccl_cu12-2.20.5-py3-none-manylinux2014_x86_64.whl", hash = "sha256:057f6bf9685f75215d0c53bf3ac4a10b3e6578351de307abad9e18a99182af56"}, @@ -1441,7 +1554,10 @@ version = "12.5.82" description = "Nvidia JIT LTO Library" optional = false python-versions = ">=3" +groups = ["main"] +markers = "platform_machine == \"x86_64\" and platform_system == \"Linux\"" files = [ + {file = "nvidia_nvjitlink_cu12-12.5.82-py3-none-manylinux2014_aarch64.whl", hash = "sha256:98103729cc5226e13ca319a10bbf9433bbbd44ef64fe72f45f067cacc14b8d27"}, {file = "nvidia_nvjitlink_cu12-12.5.82-py3-none-manylinux2014_x86_64.whl", hash = "sha256:f9b37bc5c8cf7509665cb6ada5aaa0ce65618f2332b7d3e78e9790511f111212"}, {file = "nvidia_nvjitlink_cu12-12.5.82-py3-none-win_amd64.whl", hash = "sha256:e782564d705ff0bf61ac3e1bf730166da66dd2fe9012f111ede5fc49b64ae697"}, ] @@ -1452,6 +1568,8 @@ version = "12.1.105" description = "NVIDIA Tools Extension" optional = false python-versions = ">=3" +groups = ["main"] +markers = "platform_machine == \"x86_64\" and platform_system == \"Linux\"" files = [ {file = "nvidia_nvtx_cu12-12.1.105-py3-none-manylinux1_x86_64.whl", hash = "sha256:dc21cf308ca5691e7c04d962e213f8a4aa9bbfa23d95412f452254c2caeb09e5"}, {file = "nvidia_nvtx_cu12-12.1.105-py3-none-win_amd64.whl", hash = "sha256:65f4d98982b31b60026e0e6de73fbdfc09d08a96f4656dd3665ca616a11e1e82"}, @@ -1463,6 +1581,7 @@ version = "1.37.1" description = "The official Python library for the openai API" optional = false python-versions = ">=3.7.1" +groups = ["main"] files = [ {file = "openai-1.37.1-py3-none-any.whl", hash = "sha256:9a6adda0d6ae8fce02d235c5671c399cfa40d6a281b3628914c7ebf244888ee3"}, {file = "openai-1.37.1.tar.gz", hash = "sha256:faf87206785a6b5d9e34555d6a3242482a6852bc802e453e2a891f68ee04ce55"}, @@ -1486,6 +1605,7 @@ version = "1.3.0.post0" description = "Capture the outcome of Python function calls." optional = false python-versions = ">=3.7" +groups = ["dev"] files = [ {file = "outcome-1.3.0.post0-py2.py3-none-any.whl", hash = "sha256:e771c5ce06d1415e356078d3bdd68523f284b4ce5419828922b6871e65eda82b"}, {file = "outcome-1.3.0.post0.tar.gz", hash = "sha256:9dcf02e65f2971b80047b377468e72a268e15c0af3cf1238e6ff14f7f91143b8"}, @@ -1500,6 +1620,7 @@ version = "24.1" description = "Core utilities for Python packages" optional = false python-versions = ">=3.8" +groups = ["main", "dev"] files = [ {file = "packaging-24.1-py3-none-any.whl", hash = "sha256:5b8f2217dbdbd2f7f384c41c628544e6d52f2d0f53c6d0c3ea61aa5d1d7ff124"}, {file = "packaging-24.1.tar.gz", hash = "sha256:026ed72c8ed3fcce5bf8950572258698927fd1dbda10a5e981cdf0ac37f4f002"}, @@ -1511,6 +1632,7 @@ version = "0.9.0" description = "Parameterized testing with any Python test framework" optional = false python-versions = ">=3.7" +groups = ["main"] files = [ {file = "parameterized-0.9.0-py2.py3-none-any.whl", hash = "sha256:4e0758e3d41bea3bbd05ec14fc2c24736723f243b28d702081aef438c9372b1b"}, {file = "parameterized-0.9.0.tar.gz", hash = "sha256:7fc905272cefa4f364c1a3429cbbe9c0f98b793988efb5bf90aac80f08db09b1"}, @@ -1525,6 +1647,7 @@ version = "0.8.4" description = "A Python Parser" optional = false python-versions = ">=3.6" +groups = ["main"] files = [ {file = "parso-0.8.4-py2.py3-none-any.whl", hash = "sha256:a418670a20291dacd2dddc80c377c5c3791378ee1e8d12bffc35420643d43f18"}, {file = "parso-0.8.4.tar.gz", hash = "sha256:eb3a7b58240fb99099a345571deecc0f9540ea5f4dd2fe14c2a99d6b281ab92d"}, @@ -1540,6 +1663,7 @@ version = "0.12.1" description = "Utility library for gitignore style pattern matching of file paths." optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "pathspec-0.12.1-py3-none-any.whl", hash = "sha256:a0d503e138a4c123b27490a4f7beda6a01c6f288df0e4a8b79c7eb0dc7b4cc08"}, {file = "pathspec-0.12.1.tar.gz", hash = "sha256:a482d51503a1ab33b1c67a6c3813a26953dbdc71c31dacaef9a838c4e29f5712"}, @@ -1551,6 +1675,8 @@ version = "4.9.0" description = "Pexpect allows easy control of interactive console applications." optional = false python-versions = "*" +groups = ["main"] +markers = "sys_platform != \"win32\" and sys_platform != \"emscripten\"" files = [ {file = "pexpect-4.9.0-py2.py3-none-any.whl", hash = "sha256:7236d1e080e4936be2dc3e326cec0af72acf9212a7e1d060210e70a47e253523"}, {file = "pexpect-4.9.0.tar.gz", hash = "sha256:ee7d41123f3c9911050ea2c2dac107568dc43b2d3b0c7557a33212c398ead30f"}, @@ -1565,6 +1691,7 @@ version = "10.4.0" description = "Python Imaging Library (Fork)" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "pillow-10.4.0-cp310-cp310-macosx_10_10_x86_64.whl", hash = "sha256:4d9667937cfa347525b319ae34375c37b9ee6b525440f3ef48542fcf66f2731e"}, {file = "pillow-10.4.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:543f3dc61c18dafb755773efc89aae60d06b6596a63914107f75459cf984164d"}, @@ -1662,6 +1789,7 @@ version = "4.2.2" description = "A small Python package for determining appropriate platform-specific dirs, e.g. a `user data dir`." optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "platformdirs-4.2.2-py3-none-any.whl", hash = "sha256:2d7a1657e36a80ea911db832a8a6ece5ee53d8de21edd5cc5879af6530b1bfee"}, {file = "platformdirs-4.2.2.tar.gz", hash = "sha256:38b7b51f512eed9e84a22788b4bce1de17c0adb134d6becb09836e37d8654cd3"}, @@ -1678,6 +1806,7 @@ version = "1.5.0" description = "plugin and hook calling mechanisms for python" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669"}, {file = "pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1"}, @@ -1693,6 +1822,7 @@ version = "3.0.47" description = "Library for building powerful interactive command lines in Python" optional = false python-versions = ">=3.7.0" +groups = ["main"] files = [ {file = "prompt_toolkit-3.0.47-py3-none-any.whl", hash = "sha256:0d7bfa67001d5e39d02c224b663abc33687405033a8c422d0d675a5a13361d10"}, {file = "prompt_toolkit-3.0.47.tar.gz", hash = "sha256:1e1b29cb58080b1e69f207c893a1a7bf16d127a5c30c9d17a25a5d77792e5360"}, @@ -1707,6 +1837,8 @@ version = "0.7.0" description = "Run a subprocess in a pseudo terminal" optional = false python-versions = "*" +groups = ["main"] +markers = "sys_platform != \"win32\" and sys_platform != \"emscripten\"" files = [ {file = "ptyprocess-0.7.0-py2.py3-none-any.whl", hash = "sha256:4b41f3967fce3af57cc7e94b888626c18bf37a083e3651ca8feeb66d492fef35"}, {file = "ptyprocess-0.7.0.tar.gz", hash = "sha256:5c5d0a3b48ceee0b48485e0c26037c0acd7d29765ca3fbb5cb3831d347423220"}, @@ -1718,6 +1850,7 @@ version = "0.2.3" description = "Safely evaluate AST nodes without side effects" optional = false python-versions = "*" +groups = ["main"] files = [ {file = "pure_eval-0.2.3-py3-none-any.whl", hash = "sha256:1db8e35b67b3d218d818ae653e27f06c3aa420901fa7b081ca98cbedc874e0d0"}, {file = "pure_eval-0.2.3.tar.gz", hash = "sha256:5f4e983f40564c576c7c8635ae88db5956bb2229d7e9237d03b3c0b0190eaf42"}, @@ -1732,6 +1865,8 @@ version = "2.22" description = "C parser in Python" optional = false python-versions = ">=3.8" +groups = ["dev"] +markers = "os_name == \"nt\" and implementation_name != \"pypy\" or platform_python_implementation != \"PyPy\"" files = [ {file = "pycparser-2.22-py3-none-any.whl", hash = "sha256:c3702b6d3dd8c7abc1afa565d7e63d53a1d0bd86cdc24edd75470f4de499cfcc"}, {file = "pycparser-2.22.tar.gz", hash = "sha256:491c8be9c040f5390f5bf44a5b07752bd07f56edf992381b05c701439eec10f6"}, @@ -1743,6 +1878,7 @@ version = "2.8.2" description = "Data validation using Python type hints" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "pydantic-2.8.2-py3-none-any.whl", hash = "sha256:73ee9fddd406dc318b885c7a2eab8a6472b68b8fb5ba8150949fc3db939f23c8"}, {file = "pydantic-2.8.2.tar.gz", hash = "sha256:6f62c13d067b0755ad1c21a34bdd06c0c12625a22b0fc09c6b149816604f7c2a"}, @@ -1752,8 +1888,8 @@ files = [ annotated-types = ">=0.4.0" pydantic-core = "2.20.1" typing-extensions = [ - {version = ">=4.12.2", markers = "python_version >= \"3.13\""}, {version = ">=4.6.1", markers = "python_version < \"3.13\""}, + {version = ">=4.12.2", markers = "python_version >= \"3.13\""}, ] [package.extras] @@ -1765,6 +1901,7 @@ version = "2.20.1" description = "Core functionality for Pydantic validation and serialization" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "pydantic_core-2.20.1-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:3acae97ffd19bf091c72df4d726d552c473f3576409b2a7ca36b2f535ffff4a3"}, {file = "pydantic_core-2.20.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:41f4c96227a67a013e7de5ff8f20fb496ce573893b7f4f2707d065907bffdbd6"}, @@ -1866,6 +2003,7 @@ version = "2.18.0" description = "Pygments is a syntax highlighting package written in Python." optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "pygments-2.18.0-py3-none-any.whl", hash = "sha256:b8e6aca0523f3ab76fee51799c488e38782ac06eafcf95e7ba832985c8e7b13a"}, {file = "pygments-2.18.0.tar.gz", hash = "sha256:786ff802f32e91311bff3889f6e9a86e81505fe99f2735bb6d60ae0c5004f199"}, @@ -1880,6 +2018,7 @@ version = "3.1.0" description = "python code static checker" optional = false python-versions = ">=3.8.0" +groups = ["dev"] files = [ {file = "pylint-3.1.0-py3-none-any.whl", hash = "sha256:507a5b60953874766d8a366e8e8c7af63e058b26345cfcb5f91f89d987fd6b74"}, {file = "pylint-3.1.0.tar.gz", hash = "sha256:6a69beb4a6f63debebaab0a3477ecd0f559aa726af4954fc948c51f7a2549e23"}, @@ -1889,8 +2028,8 @@ files = [ astroid = ">=3.1.0,<=3.2.0-dev0" colorama = {version = ">=0.4.5", markers = "sys_platform == \"win32\""} dill = [ - {version = ">=0.3.7", markers = "python_version >= \"3.12\""}, {version = ">=0.3.6", markers = "python_version >= \"3.11\" and python_version < \"3.12\""}, + {version = ">=0.3.7", markers = "python_version >= \"3.12\""}, ] isort = ">=4.2.5,<5.13.0 || >5.13.0,<6" mccabe = ">=0.6,<0.8" @@ -1907,6 +2046,8 @@ version = "3.4.1" description = "A python implementation of GNU readline." optional = false python-versions = "*" +groups = ["main"] +markers = "sys_platform == \"win32\"" files = [ {file = "pyreadline3-3.4.1-py3-none-any.whl", hash = "sha256:b0efb6516fd4fb07b45949053826a62fa4cb353db5be2bbb4a7aa1fdd1e345fb"}, {file = "pyreadline3-3.4.1.tar.gz", hash = "sha256:6f3d1f7b8a31ba32b73917cefc1f28cc660562f39aea8646d30bd6eff21f7bae"}, @@ -1918,6 +2059,7 @@ version = "8.3.2" description = "pytest: simple powerful testing with Python" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "pytest-8.3.2-py3-none-any.whl", hash = "sha256:4ba08f9ae7dcf84ded419494d229b48d0903ea6407b030eaec46df5e6a73bba5"}, {file = "pytest-8.3.2.tar.gz", hash = "sha256:c132345d12ce551242c87269de812483f5bcc87cdbb4722e48487ba194f9fdce"}, @@ -1938,6 +2080,7 @@ version = "0.23.8" description = "Pytest support for asyncio" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "pytest_asyncio-0.23.8-py3-none-any.whl", hash = "sha256:50265d892689a5faefb84df80819d1ecef566eb3549cf915dfb33569359d1ce2"}, {file = "pytest_asyncio-0.23.8.tar.gz", hash = "sha256:759b10b33a6dc61cce40a8bd5205e302978bbbcc00e279a8b61d9a6a3c82e4d3"}, @@ -1956,6 +2099,7 @@ version = "5.0.0" description = "Pytest plugin for measuring coverage." optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "pytest-cov-5.0.0.tar.gz", hash = "sha256:5837b58e9f6ebd335b0f8060eecce69b662415b16dc503883a02f45dfeb14857"}, {file = "pytest_cov-5.0.0-py3-none-any.whl", hash = "sha256:4f0764a1219df53214206bf1feea4633c3b558a2925c8b59f144f682861ce652"}, @@ -1974,6 +2118,7 @@ version = "1.1.3" description = "pytest plugin that allows you to add environment variables." optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "pytest_env-1.1.3-py3-none-any.whl", hash = "sha256:aada77e6d09fcfb04540a6e462c58533c37df35fa853da78707b17ec04d17dfc"}, {file = "pytest_env-1.1.3.tar.gz", hash = "sha256:fcd7dc23bb71efd3d35632bde1bbe5ee8c8dc4489d6617fb010674880d96216b"}, @@ -1991,6 +2136,7 @@ version = "2.9.0.post0" description = "Extensions to the standard Python datetime module" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" +groups = ["main"] files = [ {file = "python-dateutil-2.9.0.post0.tar.gz", hash = "sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3"}, {file = "python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427"}, @@ -2005,6 +2151,7 @@ version = "1.0.1" description = "Read key-value pairs from a .env file and set them as environment variables" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "python-dotenv-1.0.1.tar.gz", hash = "sha256:e324ee90a023d808f1959c46bcbc04446a10ced277783dc6ee09987c37ec10ca"}, {file = "python_dotenv-1.0.1-py3-none-any.whl", hash = "sha256:f7b63ef50f1b690dddf550d03497b66d609393b40b564ed0d674909a68ebf16a"}, @@ -2019,6 +2166,7 @@ version = "0.0.9" description = "A streaming multipart parser for Python" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "python_multipart-0.0.9-py3-none-any.whl", hash = "sha256:97ca7b8ea7b05f977dc3849c3ba99d51689822fab725c3703af7c866a0c2b215"}, {file = "python_multipart-0.0.9.tar.gz", hash = "sha256:03f54688c663f1b7977105f021043b0793151e4cb1c1a9d4a11fc13d622c4026"}, @@ -2027,12 +2175,28 @@ files = [ [package.extras] dev = ["atomicwrites (==1.4.1)", "attrs (==23.2.0)", "coverage (==7.4.1)", "hatch", "invoke (==2.2.0)", "more-itertools (==10.2.0)", "pbr (==6.0.0)", "pluggy (==1.4.0)", "py (==1.11.0)", "pytest (==8.0.0)", "pytest-cov (==4.1.0)", "pytest-timeout (==2.2.0)", "pyyaml (==6.0.1)", "ruff (==0.2.1)"] +[[package]] +name = "python-ulid" +version = "3.0.0" +description = "Universally unique lexicographically sortable identifier" +optional = false +python-versions = ">=3.9" +groups = ["main"] +files = [ + {file = "python_ulid-3.0.0-py3-none-any.whl", hash = "sha256:e4c4942ff50dbd79167ad01ac725ec58f924b4018025ce22c858bfcff99a5e31"}, + {file = "python_ulid-3.0.0.tar.gz", hash = "sha256:e50296a47dc8209d28629a22fc81ca26c00982c78934bd7766377ba37ea49a9f"}, +] + +[package.extras] +pydantic = ["pydantic (>=2.0)"] + [[package]] name = "pyyaml" version = "6.0.1" description = "YAML parser and emitter for Python" optional = false python-versions = ">=3.6" +groups = ["main"] files = [ {file = "PyYAML-6.0.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d858aa552c999bc8a8d57426ed01e40bef403cd8ccdd0fc5f6f04a00414cac2a"}, {file = "PyYAML-6.0.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:fd66fc5d0da6d9815ba2cebeb4205f95818ff4b79c3ebe268e75d961704af52f"}, @@ -2093,6 +2257,7 @@ version = "5.0.8" description = "Python client for Redis database and key-value store" optional = false python-versions = ">=3.7" +groups = ["main"] files = [ {file = "redis-5.0.8-py3-none-any.whl", hash = "sha256:56134ee08ea909106090934adc36f65c9bcbbaecea5b21ba704ba6fb561f8eb4"}, {file = "redis-5.0.8.tar.gz", hash = "sha256:0c5b10d387568dfe0698c6fad6615750c24170e548ca2deac10c649d463e9870"}, @@ -2107,30 +2272,38 @@ ocsp = ["cryptography (>=36.0.1)", "pyopenssl (==20.0.1)", "requests (>=2.26.0)" [[package]] name = "redisvl" -version = "0.2.3" +version = "0.4.1" description = "Python client library and CLI for using Redis as a vector database" optional = false -python-versions = "<4.0,>=3.9" +python-versions = "<3.14,>=3.9" +groups = ["main"] files = [ - {file = "redisvl-0.2.3-py3-none-any.whl", hash = "sha256:0739889de62f45345b501fbd6aea03b7350e25dc078c9154c0bc9c32d67e5eb1"}, - {file = "redisvl-0.2.3.tar.gz", hash = "sha256:13e07a3f70550f74b424ab3734171661a9199c9d1a9f6e001c38ccc422e71f83"}, + {file = "redisvl-0.4.1-py3-none-any.whl", hash = "sha256:6db5d5bc95b1fe8032a1cdae74ce1c65bc7fe9054e5429b5d34d5a91d28bae5f"}, + {file = "redisvl-0.4.1.tar.gz", hash = "sha256:fd6a36426ba94792c0efca20915c31232d4ee3cc58eb23794a62c142696401e6"}, ] [package.dependencies] -coloredlogs = "*" -numpy = "*" +coloredlogs = ">=15.0,<16.0" +ml-dtypes = ">=0.4.0,<0.5.0" +numpy = [ + {version = ">=1,<2", markers = "python_version < \"3.12\""}, + {version = ">=1.26.0,<3", markers = "python_version >= \"3.12\""}, +] pydantic = ">=2,<3" -pyyaml = "*" -redis = ">=5.0.0" -tabulate = ">=0.9.0,<1" +python-ulid = ">=3.0.0,<4.0.0" +pyyaml = ">=5.4,<7.0" +redis = ">=5.0,<6.0" +tabulate = ">=0.9.0,<0.10.0" tenacity = ">=8.2.2" [package.extras] +bedrock = ["boto3[bedrock] (>=1.36.0,<2.0.0)"] cohere = ["cohere (>=4.44)"] -google-cloud-aiplatform = ["google-cloud-aiplatform (>=1.26)"] -mistralai = ["mistralai (>=0.2.0)"] -openai = ["openai (>=1.13.0)"] -sentence-transformers = ["sentence-transformers (>=2.2.2)"] +mistralai = ["mistralai (>=1.0.0)"] +openai = ["openai (>=1.13.0,<2.0.0)"] +sentence-transformers = ["scipy (<1.15)", "scipy (>=1.15,<2.0)", "sentence-transformers (>=3.4.0,<4.0.0)"] +vertexai = ["google-cloud-aiplatform (>=1.26,<2.0)", "protobuf (>=5.29.1,<6.0.0)"] +voyageai = ["voyageai (>=0.2.2)"] [[package]] name = "regex" @@ -2138,6 +2311,7 @@ version = "2024.7.24" description = "Alternative regular expression module, to replace re." optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "regex-2024.7.24-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:228b0d3f567fafa0633aee87f08b9276c7062da9616931382993c03808bb68ce"}, {file = "regex-2024.7.24-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:3426de3b91d1bc73249042742f45c2148803c111d1175b283270177fdf669024"}, @@ -2226,6 +2400,7 @@ version = "2.32.3" description = "Python HTTP for Humans." optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "requests-2.32.3-py3-none-any.whl", hash = "sha256:70761cfe03c773ceb22aa2f671b4757976145175cdfca038c02654d061d6dcc6"}, {file = "requests-2.32.3.tar.gz", hash = "sha256:55365417734eb18255590a9ff9eb97e9e1da868d4ccd6402399eaf68af20a760"}, @@ -2247,6 +2422,7 @@ version = "13.7.1" description = "Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal" optional = false python-versions = ">=3.7.0" +groups = ["main"] files = [ {file = "rich-13.7.1-py3-none-any.whl", hash = "sha256:4edbae314f59eb482f54e9e30bf00d33350aaa94f4bfcd4e9e3110e64d0d7222"}, {file = "rich-13.7.1.tar.gz", hash = "sha256:9be308cb1fe2f1f57d67ce99e95af38a1e2bc71ad9813b0e247cf7ffbcc3a432"}, @@ -2265,6 +2441,7 @@ version = "0.10.2" description = "An Amazon S3 Transfer Manager" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "s3transfer-0.10.2-py3-none-any.whl", hash = "sha256:eca1c20de70a39daee580aef4986996620f365c4e0fda6a86100231d62f1bf69"}, {file = "s3transfer-0.10.2.tar.gz", hash = "sha256:0711534e9356d3cc692fdde846b4a1e4b0cb6519971860796e6bc4c7aea00ef6"}, @@ -2282,6 +2459,7 @@ version = "0.4.3" description = "" optional = false python-versions = ">=3.7" +groups = ["main"] files = [ {file = "safetensors-0.4.3-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:dcf5705cab159ce0130cd56057f5f3425023c407e170bca60b4868048bae64fd"}, {file = "safetensors-0.4.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:bb4f8c5d0358a31e9a08daeebb68f5e161cdd4018855426d3f0c23bb51087055"}, @@ -2404,6 +2582,7 @@ version = "1.5.1" description = "A set of python modules for machine learning and data mining" optional = false python-versions = ">=3.9" +groups = ["main"] files = [ {file = "scikit_learn-1.5.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:781586c414f8cc58e71da4f3d7af311e0505a683e112f2f62919e3019abd3745"}, {file = "scikit_learn-1.5.1-cp310-cp310-macosx_12_0_arm64.whl", hash = "sha256:f5b213bc29cc30a89a3130393b0e39c847a15d769d6e59539cd86b75d276b1a7"}, @@ -2449,6 +2628,7 @@ version = "1.14.0" description = "Fundamental algorithms for scientific computing in Python" optional = false python-versions = ">=3.10" +groups = ["main"] files = [ {file = "scipy-1.14.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:7e911933d54ead4d557c02402710c2396529540b81dd554fc1ba270eb7308484"}, {file = "scipy-1.14.0-cp310-cp310-macosx_12_0_arm64.whl", hash = "sha256:687af0a35462402dd851726295c1a5ae5f987bd6e9026f52e9505994e2f84ef6"}, @@ -2491,6 +2671,7 @@ version = "3.0.1" description = "Multilingual text embeddings" optional = false python-versions = ">=3.8.0" +groups = ["main"] files = [ {file = "sentence_transformers-3.0.1-py3-none-any.whl", hash = "sha256:01050cc4053c49b9f5b78f6980b5a72db3fd3a0abb9169b1792ac83875505ee6"}, {file = "sentence_transformers-3.0.1.tar.gz", hash = "sha256:8a3d2c537cc4d1014ccc20ac92be3d6135420a3bc60ae29a3a8a9b4bb35fbff6"}, @@ -2516,6 +2697,7 @@ version = "0.2.0" description = "SentencePiece python wrapper" optional = false python-versions = "*" +groups = ["main"] files = [ {file = "sentencepiece-0.2.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:188779e1298a1c8b8253c7d3ad729cb0a9891e5cef5e5d07ce4592c54869e227"}, {file = "sentencepiece-0.2.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:bed9cf85b296fa2b76fc2547b9cbb691a523864cebaee86304c43a7b4cb1b452"}, @@ -2578,6 +2760,7 @@ version = "1.5.4" description = "Tool to Detect Surrounding Shell" optional = false python-versions = ">=3.7" +groups = ["main"] files = [ {file = "shellingham-1.5.4-py2.py3-none-any.whl", hash = "sha256:7ecfff8f2fd72616f7481040475a65b2bf8af90a56c89140852d1120324e8686"}, {file = "shellingham-1.5.4.tar.gz", hash = "sha256:8dbca0739d487e5bd35ab3ca4b36e11c4078f3a234bfce294b0a0291363404de"}, @@ -2589,6 +2772,7 @@ version = "1.16.0" description = "Python 2 and 3 compatibility utilities" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" +groups = ["main"] files = [ {file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"}, {file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"}, @@ -2600,6 +2784,7 @@ version = "1.3.1" description = "Sniff out which async library your code is running under" optional = false python-versions = ">=3.7" +groups = ["main", "dev"] files = [ {file = "sniffio-1.3.1-py3-none-any.whl", hash = "sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2"}, {file = "sniffio-1.3.1.tar.gz", hash = "sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc"}, @@ -2611,6 +2796,7 @@ version = "2.4.0" description = "Sorted Containers -- Sorted List, Sorted Dict, Sorted Set" optional = false python-versions = "*" +groups = ["dev"] files = [ {file = "sortedcontainers-2.4.0-py2.py3-none-any.whl", hash = "sha256:a163dcaede0f1c021485e957a39245190e74249897e2ae4b2aa38595db237ee0"}, {file = "sortedcontainers-2.4.0.tar.gz", hash = "sha256:25caa5a06cc30b6b83d11423433f65d1f9d76c4c6a0c90e3379eaa43b9bfdb88"}, @@ -2622,6 +2808,7 @@ version = "0.6.3" description = "Extract data from python stack frames and tracebacks for informative displays" optional = false python-versions = "*" +groups = ["main"] files = [ {file = "stack_data-0.6.3-py3-none-any.whl", hash = "sha256:d5558e0c25a4cb0853cddad3d77da9891a08cb85dd9f9f91b9f8cd66e511e695"}, {file = "stack_data-0.6.3.tar.gz", hash = "sha256:836a778de4fec4dcd1dcd89ed8abff8a221f58308462e1c4aa2a3cf30148f0b9"}, @@ -2641,6 +2828,7 @@ version = "0.37.2" description = "The little ASGI library that shines." optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "starlette-0.37.2-py3-none-any.whl", hash = "sha256:6fe59f29268538e5d0d182f2791a479a0c64638e6935d1c6989e63fb2699c6ee"}, {file = "starlette-0.37.2.tar.gz", hash = "sha256:9af890290133b79fc3db55474ade20f6220a364a0402e0b556e7cd5e1e093823"}, @@ -2658,6 +2846,7 @@ version = "1.13.1" description = "Computer algebra system (CAS) in Python" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "sympy-1.13.1-py3-none-any.whl", hash = "sha256:db36cdc64bf61b9b24578b6f7bab1ecdd2452cf008f34faa33776680c26d66f8"}, {file = "sympy-1.13.1.tar.gz", hash = "sha256:9cebf7e04ff162015ce31c9c6c9144daa34a93bd082f54fd8f12deca4f47515f"}, @@ -2675,6 +2864,7 @@ version = "0.9.0" description = "Pretty-print tabular data" optional = false python-versions = ">=3.7" +groups = ["main"] files = [ {file = "tabulate-0.9.0-py3-none-any.whl", hash = "sha256:024ca478df22e9340661486f85298cff5f6dcdba14f3813e8830015b9ed1948f"}, {file = "tabulate-0.9.0.tar.gz", hash = "sha256:0095b12bf5966de529c0feb1fa08671671b3368eec77d7ef7ab114be2c068b3c"}, @@ -2689,6 +2879,7 @@ version = "9.0.0" description = "Retry code until it succeeds" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "tenacity-9.0.0-py3-none-any.whl", hash = "sha256:93de0c98785b27fcf659856aa9f54bfbd399e29969b0621bc7f762bd441b4539"}, {file = "tenacity-9.0.0.tar.gz", hash = "sha256:807f37ca97d62aa361264d497b0e31e92b8027044942bfa756160d908320d73b"}, @@ -2704,6 +2895,7 @@ version = "3.5.0" description = "threadpoolctl" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "threadpoolctl-3.5.0-py3-none-any.whl", hash = "sha256:56c1e26c150397e58c4926da8eeee87533b1e32bef131bd4bf6a2f45f3185467"}, {file = "threadpoolctl-3.5.0.tar.gz", hash = "sha256:082433502dd922bf738de0d8bcc4fdcbf0979ff44c42bd40f5af8a282f6fa107"}, @@ -2715,6 +2907,7 @@ version = "0.19.1" description = "" optional = false python-versions = ">=3.7" +groups = ["main"] files = [ {file = "tokenizers-0.19.1-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:952078130b3d101e05ecfc7fc3640282d74ed26bcf691400f872563fca15ac97"}, {file = "tokenizers-0.19.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:82c8b8063de6c0468f08e82c4e198763e7b97aabfe573fd4cf7b33930ca4df77"}, @@ -2832,6 +3025,7 @@ version = "0.13.0" description = "Style preserving TOML library" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "tomlkit-0.13.0-py3-none-any.whl", hash = "sha256:7075d3042d03b80f603482d69bf0c8f345c2b30e41699fd8883227f89972b264"}, {file = "tomlkit-0.13.0.tar.gz", hash = "sha256:08ad192699734149f5b97b45f1f18dad7eb1b6d16bc72ad0c2335772650d7b72"}, @@ -2843,6 +3037,7 @@ version = "2.4.0" description = "Tensors and Dynamic neural networks in Python with strong GPU acceleration" optional = false python-versions = ">=3.8.0" +groups = ["main"] files = [ {file = "torch-2.4.0-cp310-cp310-manylinux1_x86_64.whl", hash = "sha256:4ed94583e244af51d6a8d28701ca5a9e02d1219e782f5a01dd401f90af17d8ac"}, {file = "torch-2.4.0-cp310-cp310-manylinux2014_aarch64.whl", hash = "sha256:c4ca297b7bd58b506bfd6e78ffd14eb97c0e7797dcd7965df62f50bb575d8954"}, @@ -2896,6 +3091,7 @@ version = "4.66.4" description = "Fast, Extensible Progress Meter" optional = false python-versions = ">=3.7" +groups = ["main"] files = [ {file = "tqdm-4.66.4-py3-none-any.whl", hash = "sha256:b75ca56b413b030bc3f00af51fd2c1a1a5eac6a0c1cca83cbb37a5c52abce644"}, {file = "tqdm-4.66.4.tar.gz", hash = "sha256:e4d936c9de8727928f3be6079590e97d9abfe8d39a590be678eb5919ffc186bb"}, @@ -2916,6 +3112,7 @@ version = "5.14.3" description = "Traitlets Python configuration system" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "traitlets-5.14.3-py3-none-any.whl", hash = "sha256:b74e89e397b1ed28cc831db7aea759ba6640cb3de13090ca145426688ff1ac4f"}, {file = "traitlets-5.14.3.tar.gz", hash = "sha256:9ed0579d3502c94b4b3732ac120375cda96f923114522847de4b3bb98b96b6b7"}, @@ -2931,6 +3128,7 @@ version = "4.43.3" description = "State-of-the-art Machine Learning for JAX, PyTorch and TensorFlow" optional = false python-versions = ">=3.8.0" +groups = ["main"] files = [ {file = "transformers-4.43.3-py3-none-any.whl", hash = "sha256:6552beada5d826c25ff9b79139d237ab9050c6ea96b73d7fd2f8a8ba23ee76a4"}, {file = "transformers-4.43.3.tar.gz", hash = "sha256:820c5b192bb1bf47250802901a8f0bf581e06b8fded89179d4ef08a1e903ee1c"}, @@ -2999,6 +3197,7 @@ version = "0.26.0" description = "A friendly Python library for async concurrency and I/O" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "trio-0.26.0-py3-none-any.whl", hash = "sha256:bb9c1b259591af941fccfbabbdc65bc7ed764bd2db76428454c894cd5e3d2032"}, {file = "trio-0.26.0.tar.gz", hash = "sha256:67c5ec3265dd4abc7b1d1ab9ca4fe4c25b896f9c93dac73713778adab487f9c4"}, @@ -3018,17 +3217,14 @@ version = "3.0.0" description = "A language and compiler for custom Deep Learning operations" optional = false python-versions = "*" +groups = ["main"] +markers = "python_version < \"3.13\" and platform_system == \"Linux\" and platform_machine == \"x86_64\"" files = [ {file = "triton-3.0.0-1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:e1efef76935b2febc365bfadf74bcb65a6f959a9872e5bddf44cc9e0adce1e1a"}, {file = "triton-3.0.0-1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:5ce8520437c602fb633f1324cc3871c47bee3b67acf9756c1a66309b60e3216c"}, {file = "triton-3.0.0-1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:34e509deb77f1c067d8640725ef00c5cbfcb2052a1a3cb6a6d343841f92624eb"}, {file = "triton-3.0.0-1-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:bcbf3b1c48af6a28011a5c40a5b3b9b5330530c3827716b5fbf6d7adcc1e53e9"}, {file = "triton-3.0.0-1-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:6e5727202f7078c56f91ff13ad0c1abab14a0e7f2c87e91b12b6f64f3e8ae609"}, - {file = "triton-3.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:39b052da883351fdf6be3d93cedae6db3b8e3988d3b09ed221bccecfa9612230"}, - {file = "triton-3.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cd34f19a8582af96e6291d4afce25dac08cb2a5d218c599163761e8e0827208e"}, - {file = "triton-3.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0d5e10de8c011adeb7c878c6ce0dd6073b14367749e34467f1cff2bde1b78253"}, - {file = "triton-3.0.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e8903767951bf86ec960b4fe4e21bc970055afc65e9d57e916d79ae3c93665e3"}, - {file = "triton-3.0.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:41004fb1ae9a53fcb3e970745feb87f0e3c94c6ce1ba86e95fa3b8537894bef7"}, ] [package.dependencies] @@ -3045,6 +3241,7 @@ version = "0.12.3" description = "Typer, build great CLIs. Easy to code. Based on Python type hints." optional = false python-versions = ">=3.7" +groups = ["main"] files = [ {file = "typer-0.12.3-py3-none-any.whl", hash = "sha256:070d7ca53f785acbccba8e7d28b08dcd88f79f1fbda035ade0aecec71ca5c914"}, {file = "typer-0.12.3.tar.gz", hash = "sha256:49e73131481d804288ef62598d97a1ceef3058905aa536a1134f90891ba35482"}, @@ -3062,6 +3259,7 @@ version = "1.16.0.20240331" description = "Typing stubs for cffi" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "types-cffi-1.16.0.20240331.tar.gz", hash = "sha256:b8b20d23a2b89cfed5f8c5bc53b0cb8677c3aac6d970dbc771e28b9c698f5dee"}, {file = "types_cffi-1.16.0.20240331-py3-none-any.whl", hash = "sha256:a363e5ea54a4eb6a4a105d800685fde596bc318089b025b27dee09849fe41ff0"}, @@ -3076,6 +3274,7 @@ version = "24.1.0.20240722" description = "Typing stubs for pyOpenSSL" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "types-pyOpenSSL-24.1.0.20240722.tar.gz", hash = "sha256:47913b4678a01d879f503a12044468221ed8576263c1540dcb0484ca21b08c39"}, {file = "types_pyOpenSSL-24.1.0.20240722-py3-none-any.whl", hash = "sha256:6a7a5d2ec042537934cfb4c9d4deb0e16c4c6250b09358df1f083682fe6fda54"}, @@ -3091,6 +3290,7 @@ version = "6.0.12.20240724" description = "Typing stubs for PyYAML" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "types-PyYAML-6.0.12.20240724.tar.gz", hash = "sha256:cf7b31ae67e0c5b2919c703d2affc415485099d3fe6666a6912f040fd05cb67f"}, {file = "types_PyYAML-6.0.12.20240724-py3-none-any.whl", hash = "sha256:e5becec598f3aa3a2ddf671de4a75fa1c6856fbf73b2840286c9d50fae2d5d48"}, @@ -3102,6 +3302,7 @@ version = "4.6.0.20240726" description = "Typing stubs for redis" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "types-redis-4.6.0.20240726.tar.gz", hash = "sha256:de2aefcf7afe80057debada8c540463d06c8863de50b8016bd369ccdbcb59b5e"}, {file = "types_redis-4.6.0.20240726-py3-none-any.whl", hash = "sha256:233062b7120a9908532ec9163d17af74b80fa49a89d510444cad4cac42717378"}, @@ -3117,6 +3318,7 @@ version = "2.32.0.20240712" description = "Typing stubs for requests" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "types-requests-2.32.0.20240712.tar.gz", hash = "sha256:90c079ff05e549f6bf50e02e910210b98b8ff1ebdd18e19c873cd237737c1358"}, {file = "types_requests-2.32.0.20240712-py3-none-any.whl", hash = "sha256:f754283e152c752e46e70942fa2a146b5bc70393522257bb85bd1ef7e019dcc3"}, @@ -3131,6 +3333,7 @@ version = "71.1.0.20240726" description = "Typing stubs for setuptools" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "types-setuptools-71.1.0.20240726.tar.gz", hash = "sha256:85ba28e9461bb1be86ebba4db0f1c2408f2b11115b1966334ea9dc464e29303e"}, {file = "types_setuptools-71.1.0.20240726-py3-none-any.whl", hash = "sha256:a7775376f36e0ff09bcad236bf265777590a66b11623e48c20bfc30f1444ea36"}, @@ -3142,6 +3345,7 @@ version = "0.9.0.20240106" description = "Typing stubs for tabulate" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "types-tabulate-0.9.0.20240106.tar.gz", hash = "sha256:c9b6db10dd7fcf55bd1712dd3537f86ddce72a08fd62bb1af4338c7096ce947e"}, {file = "types_tabulate-0.9.0.20240106-py3-none-any.whl", hash = "sha256:0378b7b6fe0ccb4986299496d027a6d4c218298ecad67199bbd0e2d7e9d335a1"}, @@ -3153,6 +3357,7 @@ version = "4.12.2" description = "Backported and Experimental Type Hints for Python 3.8+" optional = false python-versions = ">=3.8" +groups = ["main", "dev"] files = [ {file = "typing_extensions-4.12.2-py3-none-any.whl", hash = "sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d"}, {file = "typing_extensions-4.12.2.tar.gz", hash = "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8"}, @@ -3164,6 +3369,7 @@ version = "2.2.2" description = "HTTP library with thread-safe connection pooling, file post, and more." optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "urllib3-2.2.2-py3-none-any.whl", hash = "sha256:a448b2f64d686155468037e1ace9f2d2199776e17f0a46610480d311f73e3472"}, {file = "urllib3-2.2.2.tar.gz", hash = "sha256:dd505485549a7a552833da5e6063639d0d177c04f23bc3864e41e5dc5f612168"}, @@ -3181,6 +3387,7 @@ version = "0.30.3" description = "The lightning-fast ASGI server." optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "uvicorn-0.30.3-py3-none-any.whl", hash = "sha256:94a3608da0e530cea8f69683aa4126364ac18e3826b6630d1a65f4638aade503"}, {file = "uvicorn-0.30.3.tar.gz", hash = "sha256:0d114d0831ff1adbf231d358cbf42f17333413042552a624ea6a9b4c33dcfd81"}, @@ -3206,6 +3413,8 @@ version = "0.19.0" description = "Fast implementation of asyncio event loop on top of libuv" optional = false python-versions = ">=3.8.0" +groups = ["main"] +markers = "platform_python_implementation != \"PyPy\" and (sys_platform != \"win32\" and sys_platform != \"cygwin\")" files = [ {file = "uvloop-0.19.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:de4313d7f575474c8f5a12e163f6d89c0a878bc49219641d49e6f1444369a90e"}, {file = "uvloop-0.19.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:5588bd21cf1fcf06bded085f37e43ce0e00424197e7c10e77afd4bbefffef428"}, @@ -3250,6 +3459,7 @@ version = "0.22.0" description = "Simple, modern and high performance file watching and code reload in python." optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "watchfiles-0.22.0-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:da1e0a8caebf17976e2ffd00fa15f258e14749db5e014660f53114b676e68538"}, {file = "watchfiles-0.22.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:61af9efa0733dc4ca462347becb82e8ef4945aba5135b1638bfc20fad64d4f0e"}, @@ -3337,6 +3547,7 @@ version = "0.2.13" description = "Measures the displayed width of unicode strings in a terminal" optional = false python-versions = "*" +groups = ["main"] files = [ {file = "wcwidth-0.2.13-py2.py3-none-any.whl", hash = "sha256:3da69048e4540d84af32131829ff948f1e022c1c6bdb8d6102117aac784f6859"}, {file = "wcwidth-0.2.13.tar.gz", hash = "sha256:72ea0c06399eb286d978fdedb6923a9eb47e1c486ce63e9b4e64fc18303972b5"}, @@ -3348,6 +3559,7 @@ version = "12.0" description = "An implementation of the WebSocket Protocol (RFC 6455 & 7692)" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "websockets-12.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:d554236b2a2006e0ce16315c16eaa0d628dab009c33b63ea03f41c6107958374"}, {file = "websockets-12.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:2d225bb6886591b1746b17c0573e29804619c8f755b5598d875bb4235ea639be"}, @@ -3424,6 +3636,6 @@ files = [ ] [metadata] -lock-version = "2.0" -python-versions = "^3.11" -content-hash = "3b88d55fb8d9d9d8eaac17fd17cab813c594dc37c3f1c309001d4b97ccf04f0a" +lock-version = "2.1" +python-versions = ">=3.11,<3.14" +content-hash = "d4536b4f23a967b785da2f4af794891c92348952d88a9b601f81caee62b3ba7f" diff --git a/backend/productsearch/api/routes/product.py b/backend/productsearch/api/routes/product.py index 62b2510..1ef4042 100644 --- a/backend/productsearch/api/routes/product.py +++ b/backend/productsearch/api/routes/product.py @@ -2,10 +2,9 @@ import numpy as np from fastapi import APIRouter, Depends -from redis.commands.search.document import Document from redis.commands.search.query import Query from redisvl.index import AsyncSearchIndex -from redisvl.query import FilterQuery, VectorQuery +from redisvl.query import CountQuery, FilterQuery, VectorQuery from redisvl.query.filter import FilterExpression, Tag from productsearch import config @@ -16,24 +15,9 @@ ) from productsearch.db import redis_helpers - router = APIRouter() -def create_count_query(filter_expression: FilterExpression) -> Query: - """ - Create a "count" query where simply want to know how many records - match a particular filter expression - - Args: - filter_expression (FilterExpression): The filter expression for the query. - - Returns: - Query: The Redis query object. - """ - return Query(str(filter_expression)).no_content().dialect(2) - - @router.get( "/", response_model=ProductSearchResponse, @@ -116,14 +100,14 @@ async def find_products_by_image( return_fields=config.RETURN_FIELDS, filter_expression=filter_expression, ) - count_query = create_count_query(filter_expression) + count_query = CountQuery(filter_expression) # Execute search count, result_papers = await asyncio.gather( - index.search(count_query), index.query(paper_similarity_query) + index.query(count_query), index.query(paper_similarity_query) ) # Get Paper records of those results - return ProductVectorSearchResponse(total=count.total, products=result_papers) + return ProductVectorSearchResponse(total=count, products=result_papers) @router.post( @@ -174,11 +158,11 @@ async def find_products_by_text( return_fields=config.RETURN_FIELDS, filter_expression=filter_expression, ) - count_query = create_count_query(filter_expression) + count_query = CountQuery(filter_expression) # Execute search count, result_papers = await asyncio.gather( - index.search(count_query), index.query(paper_similarity_query) + index.query(count_query), index.query(paper_similarity_query) ) # Get Paper records of those results - return ProductVectorSearchResponse(total=count.total, products=result_papers) + return ProductVectorSearchResponse(total=count, products=result_papers) diff --git a/backend/productsearch/db/load.py b/backend/productsearch/db/load.py index c58fbed..84dd2c5 100644 --- a/backend/productsearch/db/load.py +++ b/backend/productsearch/db/load.py @@ -6,9 +6,10 @@ import numpy as np import requests -from productsearch import config from redisvl.index import AsyncSearchIndex +from productsearch import config + def read_from_s3(): res = requests.get(config.S3_DATA_URL) diff --git a/backend/productsearch/db/redis_helpers.py b/backend/productsearch/db/redis_helpers.py index 6ec02ba..9019923 100644 --- a/backend/productsearch/db/redis_helpers.py +++ b/backend/productsearch/db/redis_helpers.py @@ -1,10 +1,8 @@ import logging import os -from typing import List from redis.asyncio import Redis from redisvl.index import AsyncSearchIndex, SearchIndex -from redisvl.query.filter import FilterExpression, Tag from redisvl.schema import IndexSchema from productsearch import config @@ -15,13 +13,11 @@ dir_path = os.path.dirname(os.path.realpath(__file__)) + "/schema" file_path = os.path.join(dir_path, "products.yml") schema = IndexSchema.from_yaml(file_path) -client = Redis.from_url(config.REDIS_URL) global_index = None def get_test_index(): - index = SearchIndex.from_yaml(file_path) - index.connect(redis_url=config.REDIS_URL) + index = SearchIndex.from_yaml(file_path, redis_url=config.REDIS_URL) if not index.exists(): index.create(overwrite=True) @@ -32,5 +28,5 @@ def get_test_index(): async def get_async_index(): global global_index if not global_index: - global_index = AsyncSearchIndex(schema, client) + global_index = AsyncSearchIndex(schema, redis_url=config.REDIS_URL) yield global_index diff --git a/backend/pyproject.toml b/backend/pyproject.toml index 7723201..e0c0a9f 100644 --- a/backend/pyproject.toml +++ b/backend/pyproject.toml @@ -1,23 +1,23 @@ [tool.poetry] name = "productsearch" -version = "0.1.0" +version = "0.2.0" description = "Reference architecture for vector search application with Redis" authors = ["Robert Shelton "] readme = "README.md" package-mode = false [tool.poetry.dependencies] -python = "^3.11" +python = ">=3.11,<3.14" fastapi = "^0.111.0" uvicorn = "^0.30.1" ipython = "^8.26.0" numpy = "1.26.4" -redisvl = "^0.2.3" +redisvl = "^0.4.1" cohere = "^5.5.8" openai = "^1.35.9" sentence-transformers = "^3.0.1" sentencepiece = "^0.2.0" -redis = "^5.0.7" + [tool.poetry.group.dev.dependencies] mypy = "1.9.0" diff --git a/docker-local-redis.yml b/docker-local-redis.yml index ff8d1ca..398d5eb 100644 --- a/docker-local-redis.yml +++ b/docker-local-redis.yml @@ -14,7 +14,7 @@ services: depends_on: - "redis-vector-db" redis-vector-db: - image: redis/redis-stack:latest + image: redis:8.0-M03 ports: - "6379:6379" - "8001:8001" From 54e1f4776d7faf8ef0c77f3a7196bb2747fa17f0 Mon Sep 17 00:00:00 2001 From: Tyler Hutcherson Date: Mon, 24 Feb 2025 14:30:26 -0500 Subject: [PATCH 2/7] update search index init --- backend/productsearch/db/load.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/productsearch/db/load.py b/backend/productsearch/db/load.py index 84dd2c5..6821928 100644 --- a/backend/productsearch/db/load.py +++ b/backend/productsearch/db/load.py @@ -60,9 +60,9 @@ def preprocess(product: dict) -> dict: async def load_data(): index = AsyncSearchIndex.from_yaml( - os.path.join("./productsearch/db/schema", "products.yml") + os.path.join("./productsearch/db/schema", "products.yml"), + redis_url=config.REDIS_URL, ) - index.connect(config.REDIS_URL) # Check if index exists if await index.exists() and len((await index.search("*")).docs) > 0: From a2a07d78c1ae173bff6cada7d171ce9a4660ca7a Mon Sep 17 00:00:00 2001 From: Tyler Hutcherson Date: Mon, 24 Feb 2025 19:03:39 -0500 Subject: [PATCH 3/7] async best practices --- README.md | 2 +- backend/poetry.lock | 69 +- backend/productsearch/api/routes/product.py | 16 +- backend/productsearch/db/load.py | 7 +- backend/productsearch/db/redis_helpers.py | 32 - backend/productsearch/main.py | 27 +- .../tests/api/routes/test_product.py | 21 +- backend/productsearch/tests/conftest.py | 68 +- backend/productsearch/tests/utils/__init__.py | 0 backend/productsearch/tests/utils/seed.py | 34 - .../tests/utils/test_vectors.json | 3899 ----------------- backend/pyproject.toml | 3 +- 12 files changed, 141 insertions(+), 4037 deletions(-) delete mode 100644 backend/productsearch/db/redis_helpers.py delete mode 100644 backend/productsearch/tests/utils/__init__.py delete mode 100644 backend/productsearch/tests/utils/seed.py delete mode 100644 backend/productsearch/tests/utils/test_vectors.json diff --git a/README.md b/README.md index 4455d64..b04b410 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ Much inspiration taken from [tiangelo/full-stack-fastapi-template](https://githu product.py # primary API logic lives here /db load.py # seeds Redis DB - redis_helpers.py # redis util + utils.py # redis util /schema # pydantic models for serialization/validation from API /tests diff --git a/backend/poetry.lock b/backend/poetry.lock index 883707a..5a3adcf 100644 --- a/backend/poetry.lock +++ b/backend/poetry.lock @@ -34,6 +34,21 @@ doc = ["Sphinx (>=7)", "packaging", "sphinx-autodoc-typehints (>=1.2.0)", "sphin test = ["anyio[trio]", "coverage[toml] (>=7)", "exceptiongroup (>=1.2.0)", "hypothesis (>=4.0)", "psutil (>=5.9)", "pytest (>=7.0)", "pytest-mock (>=3.6.1)", "trustme", "uvloop (>=0.17)"] trio = ["trio (>=0.23)"] +[[package]] +name = "asgi-lifespan" +version = "2.1.0" +description = "Programmatic startup/shutdown of ASGI apps." +optional = false +python-versions = ">=3.7" +groups = ["main"] +files = [ + {file = "asgi-lifespan-2.1.0.tar.gz", hash = "sha256:5e2effaf0bfe39829cf2d64e7ecc47c7d86d676a6599f7afba378c31f5e3a308"}, + {file = "asgi_lifespan-2.1.0-py3-none-any.whl", hash = "sha256:ed840706680e28428c01e14afb3875d7d76d3206f3d5b2f2294e059b5c23804f"}, +] + +[package.dependencies] +sniffio = "*" + [[package]] name = "astroid" version = "3.1.0" @@ -202,7 +217,7 @@ description = "Foreign Function Interface for Python calling C code." optional = false python-versions = ">=3.8" groups = ["dev"] -markers = "os_name == \"nt\" and implementation_name != \"pypy\" or platform_python_implementation != \"PyPy\"" +markers = "platform_python_implementation != \"PyPy\" or os_name == \"nt\" and implementation_name != \"pypy\"" files = [ {file = "cffi-1.16.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:6b3d6606d369fc1da4fd8c357d026317fbb9c9b75d36dc16e90e84c26854b088"}, {file = "cffi-1.16.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:ac0f5edd2360eea2f1daa9e26a41db02dd4b0451b48f7c318e217ee092a213e9"}, @@ -1258,8 +1273,8 @@ files = [ [package.dependencies] numpy = [ - {version = ">=1.23.3", markers = "python_version >= \"3.11\" and python_version < \"3.12\""}, {version = ">=1.26.0", markers = "python_version >= \"3.12\""}, + {version = ">=1.23.3", markers = "python_version >= \"3.11\" and python_version < \"3.12\""}, ] [package.extras] @@ -1414,7 +1429,7 @@ description = "CUBLAS native runtime libraries" optional = false python-versions = ">=3" groups = ["main"] -markers = "platform_machine == \"x86_64\" and platform_system == \"Linux\"" +markers = "platform_system == \"Linux\" and platform_machine == \"x86_64\"" files = [ {file = "nvidia_cublas_cu12-12.1.3.1-py3-none-manylinux1_x86_64.whl", hash = "sha256:ee53ccca76a6fc08fb9701aa95b6ceb242cdaab118c3bb152af4e579af792728"}, {file = "nvidia_cublas_cu12-12.1.3.1-py3-none-win_amd64.whl", hash = "sha256:2b964d60e8cf11b5e1073d179d85fa340c120e99b3067558f3cf98dd69d02906"}, @@ -1427,7 +1442,7 @@ description = "CUDA profiling tools runtime libs." optional = false python-versions = ">=3" groups = ["main"] -markers = "platform_machine == \"x86_64\" and platform_system == \"Linux\"" +markers = "platform_system == \"Linux\" and platform_machine == \"x86_64\"" files = [ {file = "nvidia_cuda_cupti_cu12-12.1.105-py3-none-manylinux1_x86_64.whl", hash = "sha256:e54fde3983165c624cb79254ae9818a456eb6e87a7fd4d56a2352c24ee542d7e"}, {file = "nvidia_cuda_cupti_cu12-12.1.105-py3-none-win_amd64.whl", hash = "sha256:bea8236d13a0ac7190bd2919c3e8e6ce1e402104276e6f9694479e48bb0eb2a4"}, @@ -1440,7 +1455,7 @@ description = "NVRTC native runtime libraries" optional = false python-versions = ">=3" groups = ["main"] -markers = "platform_machine == \"x86_64\" and platform_system == \"Linux\"" +markers = "platform_system == \"Linux\" and platform_machine == \"x86_64\"" files = [ {file = "nvidia_cuda_nvrtc_cu12-12.1.105-py3-none-manylinux1_x86_64.whl", hash = "sha256:339b385f50c309763ca65456ec75e17bbefcbbf2893f462cb8b90584cd27a1c2"}, {file = "nvidia_cuda_nvrtc_cu12-12.1.105-py3-none-win_amd64.whl", hash = "sha256:0a98a522d9ff138b96c010a65e145dc1b4850e9ecb75a0172371793752fd46ed"}, @@ -1453,7 +1468,7 @@ description = "CUDA Runtime native Libraries" optional = false python-versions = ">=3" groups = ["main"] -markers = "platform_machine == \"x86_64\" and platform_system == \"Linux\"" +markers = "platform_system == \"Linux\" and platform_machine == \"x86_64\"" files = [ {file = "nvidia_cuda_runtime_cu12-12.1.105-py3-none-manylinux1_x86_64.whl", hash = "sha256:6e258468ddf5796e25f1dc591a31029fa317d97a0a94ed93468fc86301d61e40"}, {file = "nvidia_cuda_runtime_cu12-12.1.105-py3-none-win_amd64.whl", hash = "sha256:dfb46ef84d73fababab44cf03e3b83f80700d27ca300e537f85f636fac474344"}, @@ -1466,7 +1481,7 @@ description = "cuDNN runtime libraries" optional = false python-versions = ">=3" groups = ["main"] -markers = "platform_machine == \"x86_64\" and platform_system == \"Linux\"" +markers = "platform_system == \"Linux\" and platform_machine == \"x86_64\"" files = [ {file = "nvidia_cudnn_cu12-9.1.0.70-py3-none-manylinux2014_x86_64.whl", hash = "sha256:165764f44ef8c61fcdfdfdbe769d687e06374059fbb388b6c89ecb0e28793a6f"}, {file = "nvidia_cudnn_cu12-9.1.0.70-py3-none-win_amd64.whl", hash = "sha256:6278562929433d68365a07a4a1546c237ba2849852c0d4b2262a486e805b977a"}, @@ -1482,7 +1497,7 @@ description = "CUFFT native runtime libraries" optional = false python-versions = ">=3" groups = ["main"] -markers = "platform_machine == \"x86_64\" and platform_system == \"Linux\"" +markers = "platform_system == \"Linux\" and platform_machine == \"x86_64\"" files = [ {file = "nvidia_cufft_cu12-11.0.2.54-py3-none-manylinux1_x86_64.whl", hash = "sha256:794e3948a1aa71fd817c3775866943936774d1c14e7628c74f6f7417224cdf56"}, {file = "nvidia_cufft_cu12-11.0.2.54-py3-none-win_amd64.whl", hash = "sha256:d9ac353f78ff89951da4af698f80870b1534ed69993f10a4cf1d96f21357e253"}, @@ -1495,7 +1510,7 @@ description = "CURAND native runtime libraries" optional = false python-versions = ">=3" groups = ["main"] -markers = "platform_machine == \"x86_64\" and platform_system == \"Linux\"" +markers = "platform_system == \"Linux\" and platform_machine == \"x86_64\"" files = [ {file = "nvidia_curand_cu12-10.3.2.106-py3-none-manylinux1_x86_64.whl", hash = "sha256:9d264c5036dde4e64f1de8c50ae753237c12e0b1348738169cd0f8a536c0e1e0"}, {file = "nvidia_curand_cu12-10.3.2.106-py3-none-win_amd64.whl", hash = "sha256:75b6b0c574c0037839121317e17fd01f8a69fd2ef8e25853d826fec30bdba74a"}, @@ -1508,7 +1523,7 @@ description = "CUDA solver native runtime libraries" optional = false python-versions = ">=3" groups = ["main"] -markers = "platform_machine == \"x86_64\" and platform_system == \"Linux\"" +markers = "platform_system == \"Linux\" and platform_machine == \"x86_64\"" files = [ {file = "nvidia_cusolver_cu12-11.4.5.107-py3-none-manylinux1_x86_64.whl", hash = "sha256:8a7ec542f0412294b15072fa7dab71d31334014a69f953004ea7a118206fe0dd"}, {file = "nvidia_cusolver_cu12-11.4.5.107-py3-none-win_amd64.whl", hash = "sha256:74e0c3a24c78612192a74fcd90dd117f1cf21dea4822e66d89e8ea80e3cd2da5"}, @@ -1526,7 +1541,7 @@ description = "CUSPARSE native runtime libraries" optional = false python-versions = ">=3" groups = ["main"] -markers = "platform_machine == \"x86_64\" and platform_system == \"Linux\"" +markers = "platform_system == \"Linux\" and platform_machine == \"x86_64\"" files = [ {file = "nvidia_cusparse_cu12-12.1.0.106-py3-none-manylinux1_x86_64.whl", hash = "sha256:f3b50f42cf363f86ab21f720998517a659a48131e8d538dc02f8768237bd884c"}, {file = "nvidia_cusparse_cu12-12.1.0.106-py3-none-win_amd64.whl", hash = "sha256:b798237e81b9719373e8fae8d4f091b70a0cf09d9d85c95a557e11df2d8e9a5a"}, @@ -1542,7 +1557,7 @@ description = "NVIDIA Collective Communication Library (NCCL) Runtime" optional = false python-versions = ">=3" groups = ["main"] -markers = "platform_machine == \"x86_64\" and platform_system == \"Linux\"" +markers = "platform_system == \"Linux\" and platform_machine == \"x86_64\"" files = [ {file = "nvidia_nccl_cu12-2.20.5-py3-none-manylinux2014_aarch64.whl", hash = "sha256:1fc150d5c3250b170b29410ba682384b14581db722b2531b0d8d33c595f33d01"}, {file = "nvidia_nccl_cu12-2.20.5-py3-none-manylinux2014_x86_64.whl", hash = "sha256:057f6bf9685f75215d0c53bf3ac4a10b3e6578351de307abad9e18a99182af56"}, @@ -1555,7 +1570,7 @@ description = "Nvidia JIT LTO Library" optional = false python-versions = ">=3" groups = ["main"] -markers = "platform_machine == \"x86_64\" and platform_system == \"Linux\"" +markers = "platform_system == \"Linux\" and platform_machine == \"x86_64\"" files = [ {file = "nvidia_nvjitlink_cu12-12.5.82-py3-none-manylinux2014_aarch64.whl", hash = "sha256:98103729cc5226e13ca319a10bbf9433bbbd44ef64fe72f45f067cacc14b8d27"}, {file = "nvidia_nvjitlink_cu12-12.5.82-py3-none-manylinux2014_x86_64.whl", hash = "sha256:f9b37bc5c8cf7509665cb6ada5aaa0ce65618f2332b7d3e78e9790511f111212"}, @@ -1569,7 +1584,7 @@ description = "NVIDIA Tools Extension" optional = false python-versions = ">=3" groups = ["main"] -markers = "platform_machine == \"x86_64\" and platform_system == \"Linux\"" +markers = "platform_system == \"Linux\" and platform_machine == \"x86_64\"" files = [ {file = "nvidia_nvtx_cu12-12.1.105-py3-none-manylinux1_x86_64.whl", hash = "sha256:dc21cf308ca5691e7c04d962e213f8a4aa9bbfa23d95412f452254c2caeb09e5"}, {file = "nvidia_nvtx_cu12-12.1.105-py3-none-win_amd64.whl", hash = "sha256:65f4d98982b31b60026e0e6de73fbdfc09d08a96f4656dd3665ca616a11e1e82"}, @@ -1866,7 +1881,7 @@ description = "C parser in Python" optional = false python-versions = ">=3.8" groups = ["dev"] -markers = "os_name == \"nt\" and implementation_name != \"pypy\" or platform_python_implementation != \"PyPy\"" +markers = "platform_python_implementation != \"PyPy\" or os_name == \"nt\" and implementation_name != \"pypy\"" files = [ {file = "pycparser-2.22-py3-none-any.whl", hash = "sha256:c3702b6d3dd8c7abc1afa565d7e63d53a1d0bd86cdc24edd75470f4de499cfcc"}, {file = "pycparser-2.22.tar.gz", hash = "sha256:491c8be9c040f5390f5bf44a5b07752bd07f56edf992381b05c701439eec10f6"}, @@ -1888,8 +1903,8 @@ files = [ annotated-types = ">=0.4.0" pydantic-core = "2.20.1" typing-extensions = [ - {version = ">=4.6.1", markers = "python_version < \"3.13\""}, {version = ">=4.12.2", markers = "python_version >= \"3.13\""}, + {version = ">=4.6.1", markers = "python_version < \"3.13\""}, ] [package.extras] @@ -2028,8 +2043,8 @@ files = [ astroid = ">=3.1.0,<=3.2.0-dev0" colorama = {version = ">=0.4.5", markers = "sys_platform == \"win32\""} dill = [ - {version = ">=0.3.6", markers = "python_version >= \"3.11\" and python_version < \"3.12\""}, {version = ">=0.3.7", markers = "python_version >= \"3.12\""}, + {version = ">=0.3.6", markers = "python_version >= \"3.11\" and python_version < \"3.12\""}, ] isort = ">=4.2.5,<5.13.0 || >5.13.0,<6" mccabe = ">=0.6,<0.8" @@ -2253,22 +2268,22 @@ files = [ [[package]] name = "redis" -version = "5.0.8" +version = "5.2.1" description = "Python client for Redis database and key-value store" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" groups = ["main"] files = [ - {file = "redis-5.0.8-py3-none-any.whl", hash = "sha256:56134ee08ea909106090934adc36f65c9bcbbaecea5b21ba704ba6fb561f8eb4"}, - {file = "redis-5.0.8.tar.gz", hash = "sha256:0c5b10d387568dfe0698c6fad6615750c24170e548ca2deac10c649d463e9870"}, + {file = "redis-5.2.1-py3-none-any.whl", hash = "sha256:ee7e1056b9aea0f04c6c2ed59452947f34c4940ee025f5dd83e6a6418b6989e4"}, + {file = "redis-5.2.1.tar.gz", hash = "sha256:16f2e22dff21d5125e8481515e386711a34cbec50f0e44413dd7d9c060a54e0f"}, ] [package.dependencies] async-timeout = {version = ">=4.0.3", markers = "python_full_version < \"3.11.3\""} [package.extras] -hiredis = ["hiredis (>1.0.0)"] -ocsp = ["cryptography (>=36.0.1)", "pyopenssl (==20.0.1)", "requests (>=2.26.0)"] +hiredis = ["hiredis (>=3.0.0)"] +ocsp = ["cryptography (>=36.0.1)", "pyopenssl (==23.2.1)", "requests (>=2.31.0)"] [[package]] name = "redisvl" @@ -2286,8 +2301,8 @@ files = [ coloredlogs = ">=15.0,<16.0" ml-dtypes = ">=0.4.0,<0.5.0" numpy = [ - {version = ">=1,<2", markers = "python_version < \"3.12\""}, {version = ">=1.26.0,<3", markers = "python_version >= \"3.12\""}, + {version = ">=1,<2", markers = "python_version < \"3.12\""}, ] pydantic = ">=2,<3" python-ulid = ">=3.0.0,<4.0.0" @@ -3218,7 +3233,7 @@ description = "A language and compiler for custom Deep Learning operations" optional = false python-versions = "*" groups = ["main"] -markers = "python_version < \"3.13\" and platform_system == \"Linux\" and platform_machine == \"x86_64\"" +markers = "platform_system == \"Linux\" and platform_machine == \"x86_64\" and python_version < \"3.13\"" files = [ {file = "triton-3.0.0-1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:e1efef76935b2febc365bfadf74bcb65a6f959a9872e5bddf44cc9e0adce1e1a"}, {file = "triton-3.0.0-1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:5ce8520437c602fb633f1324cc3871c47bee3b67acf9756c1a66309b60e3216c"}, @@ -3414,7 +3429,7 @@ description = "Fast implementation of asyncio event loop on top of libuv" optional = false python-versions = ">=3.8.0" groups = ["main"] -markers = "platform_python_implementation != \"PyPy\" and (sys_platform != \"win32\" and sys_platform != \"cygwin\")" +markers = "(sys_platform != \"win32\" and sys_platform != \"cygwin\") and platform_python_implementation != \"PyPy\"" files = [ {file = "uvloop-0.19.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:de4313d7f575474c8f5a12e163f6d89c0a878bc49219641d49e6f1444369a90e"}, {file = "uvloop-0.19.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:5588bd21cf1fcf06bded085f37e43ce0e00424197e7c10e77afd4bbefffef428"}, @@ -3638,4 +3653,4 @@ files = [ [metadata] lock-version = "2.1" python-versions = ">=3.11,<3.14" -content-hash = "d4536b4f23a967b785da2f4af794891c92348952d88a9b601f81caee62b3ba7f" +content-hash = "fcb47752b1815b59975b114ef84ba5d96b362f4f6f30ea8e5e2b02947f20aab3" diff --git a/backend/productsearch/api/routes/product.py b/backend/productsearch/api/routes/product.py index 1ef4042..6591da8 100644 --- a/backend/productsearch/api/routes/product.py +++ b/backend/productsearch/api/routes/product.py @@ -1,7 +1,7 @@ import asyncio import numpy as np -from fastapi import APIRouter, Depends +from fastapi import APIRouter, Depends, Request from redis.commands.search.query import Query from redisvl.index import AsyncSearchIndex from redisvl.query import CountQuery, FilterQuery, VectorQuery @@ -13,7 +13,7 @@ ProductVectorSearchResponse, SimilarityRequest, ) -from productsearch.db import redis_helpers +from productsearch.db import utils router = APIRouter() @@ -25,11 +25,11 @@ operation_id="get_products_samples", ) async def get_products( + request: Request, limit: int = 20, skip: int = 0, gender: str = "", category: str = "", - index: AsyncSearchIndex = Depends(redis_helpers.get_async_index), ) -> ProductSearchResponse: """Fetch and return products based on gender and category fields @@ -42,6 +42,8 @@ async def get_products( Returns: ProductSearchResponse: Pydantic model containing products and total count """ + index = utils.get_async_index(request) + # Build query filter_expression = (Tag("gender") == gender) & (Tag("category") == category) filter_query = FilterQuery(return_fields=[], filter_expression=filter_expression) @@ -59,8 +61,8 @@ async def get_products( operation_id="compute_image_similarity", ) async def find_products_by_image( + request: Request, similarity_request: SimilarityRequest, - index: AsyncSearchIndex = Depends(redis_helpers.get_async_index), ) -> ProductVectorSearchResponse: """Fetch and return products based on image similarity @@ -83,6 +85,8 @@ async def find_products_by_image( text_vector (str): Text vector for similarity computation img_vector (str): Image vector for similarity computation """ + index = utils.get_async_index(request) + # Fetch paper key and the vector from the HASH, cast to numpy array product = await index.fetch(similarity_request.product_id) product_img_vector = np.frombuffer(product["img_vector"], dtype=np.float32) @@ -117,8 +121,8 @@ async def find_products_by_image( operation_id="compute_text_similarity", ) async def find_products_by_text( + request: Request, similarity_request: SimilarityRequest, - index: AsyncSearchIndex = Depends(redis_helpers.get_async_index), ) -> ProductVectorSearchResponse: """Fetch and return products based on image similarity @@ -141,6 +145,8 @@ async def find_products_by_text( text_vector (str): Text vector for similarity computation img_vector (str): Image vector for similarity computation """ + index = utils.get_async_index(request) + # Fetch paper key and the vector from the HASH, cast to numpy array product = await index.fetch(similarity_request.product_id) product_text_vector = np.frombuffer(product["text_vector"], dtype=np.float32) diff --git a/backend/productsearch/db/load.py b/backend/productsearch/db/load.py index 6821928..db438a7 100644 --- a/backend/productsearch/db/load.py +++ b/backend/productsearch/db/load.py @@ -9,6 +9,7 @@ from redisvl.index import AsyncSearchIndex from productsearch import config +from productsearch.db.utils import get_schema def read_from_s3(): @@ -59,10 +60,8 @@ def preprocess(product: dict) -> dict: async def load_data(): - index = AsyncSearchIndex.from_yaml( - os.path.join("./productsearch/db/schema", "products.yml"), - redis_url=config.REDIS_URL, - ) + schema = get_schema() + index = AsyncSearchIndex(schema, redis_url=config.REDIS_URL) # Check if index exists if await index.exists() and len((await index.search("*")).docs) > 0: diff --git a/backend/productsearch/db/redis_helpers.py b/backend/productsearch/db/redis_helpers.py deleted file mode 100644 index 9019923..0000000 --- a/backend/productsearch/db/redis_helpers.py +++ /dev/null @@ -1,32 +0,0 @@ -import logging -import os - -from redis.asyncio import Redis -from redisvl.index import AsyncSearchIndex, SearchIndex -from redisvl.schema import IndexSchema - -from productsearch import config - -logger = logging.getLogger(__name__) - - -dir_path = os.path.dirname(os.path.realpath(__file__)) + "/schema" -file_path = os.path.join(dir_path, "products.yml") -schema = IndexSchema.from_yaml(file_path) -global_index = None - - -def get_test_index(): - index = SearchIndex.from_yaml(file_path, redis_url=config.REDIS_URL) - - if not index.exists(): - index.create(overwrite=True) - - return index - - -async def get_async_index(): - global global_index - if not global_index: - global_index = AsyncSearchIndex(schema, redis_url=config.REDIS_URL) - yield global_index diff --git a/backend/productsearch/main.py b/backend/productsearch/main.py index 2619835..473d08e 100644 --- a/backend/productsearch/main.py +++ b/backend/productsearch/main.py @@ -1,16 +1,41 @@ +from contextlib import asynccontextmanager from pathlib import Path import uvicorn from fastapi import FastAPI from fastapi.staticfiles import StaticFiles +from redis.asyncio import Redis +from redisvl.index import AsyncSearchIndex from starlette.middleware.cors import CORSMiddleware from productsearch import config from productsearch.api.main import api_router +from productsearch.db.utils import get_schema from productsearch.spa import SinglePageApplication + +@asynccontextmanager +async def lifespan(app: FastAPI): + # Create your async resource(s) in startup logic + client = await Redis.from_url(config.REDIS_URL) + index = AsyncSearchIndex(schema=get_schema(), redis_client=client) + # Store them on app.state + app.state.redis_client = client + app.state.redis_index = index + try: + # Let the application run + yield + finally: + # Dispose of them in shutdown logic + await index.disconnect() + await client.close() + + app = FastAPI( - title=config.PROJECT_NAME, docs_url=config.API_DOCS, openapi_url=config.OPENAPI_DOCS + title=config.PROJECT_NAME, + docs_url=config.API_DOCS, + openapi_url=config.OPENAPI_DOCS, + lifespan=lifespan, ) app.add_middleware( diff --git a/backend/productsearch/tests/api/routes/test_product.py b/backend/productsearch/tests/api/routes/test_product.py index df6d828..b07aa48 100644 --- a/backend/productsearch/tests/api/routes/test_product.py +++ b/backend/productsearch/tests/api/routes/test_product.py @@ -2,30 +2,29 @@ from httpx import AsyncClient from productsearch.api.schema.product import SimilarityRequest -from productsearch.main import app -@pytest.fixture -def gender(products): - return products[0]["gender"] +@pytest.fixture(scope="module") +def gender(test_data): + return test_data[0]["gender"] -@pytest.fixture -def category(products): - return products[0]["category"] +@pytest.fixture(scope="module") +def category(test_data): + return test_data[0]["category"] -@pytest.fixture +@pytest.fixture(scope="module") def bad_req_json(): return {"not": "valid"} -@pytest.fixture -def product_req(gender, category, products): +@pytest.fixture(scope="module") +def product_req(gender, category, test_data): return SimilarityRequest( gender=gender, category=category, - product_id=products[0]["product_id"], + product_id=test_data[0]["product_id"], ) diff --git a/backend/productsearch/tests/conftest.py b/backend/productsearch/tests/conftest.py index 6003bb0..4251b0a 100644 --- a/backend/productsearch/tests/conftest.py +++ b/backend/productsearch/tests/conftest.py @@ -1,36 +1,60 @@ -from asyncio import get_event_loop -from typing import Generator +import json +import os +import httpx +import numpy as np import pytest import pytest_asyncio +from asgi_lifespan import LifespanManager from httpx import AsyncClient from redis.asyncio import Redis +from redisvl.index import SearchIndex from productsearch import config +from productsearch.db.utils import get_schema from productsearch.main import app -from productsearch.tests.utils.seed import seed_test_db -@pytest.fixture(scope="module") -def products(): - products = seed_test_db() - return products - - -@pytest.fixture -async def client(): - client = await Redis.from_url(config.REDIS_URL) - yield client - try: - await client.aclose() - except RuntimeError as e: - if "Event loop is closed" not in str(e): - raise +@pytest_asyncio.fixture(scope="session") +def index(): + index = SearchIndex(schema=get_schema(), redis_url=config.REDIS_URL) + index.create() + yield index + index.disconnect() + + +@pytest.fixture(scope="session", autouse=True) +def test_data(index): + cwd = os.getcwd() + with open(f"{cwd}/productsearch/tests/test_vectors.json", "r") as f: + products = json.load(f) + + parsed_products = [] + + # convert to bytes + for product in products: + parsed = {} + parsed["text_vector"] = np.array( + product["text_vector"], dtype=np.float32 + ).tobytes() + parsed["img_vector"] = np.array( + product["img_vector"], dtype=np.float32 + ).tobytes() + parsed["category"] = product["product_metadata"]["master_category"] + parsed["img_url"] = product["product_metadata"]["img_url"] + parsed["name"] = product["product_metadata"]["name"] + parsed["gender"] = product["product_metadata"]["gender"] + parsed["product_id"] = product["product_id"] + parsed_products.append(parsed) + + keys = index.load(data=parsed_products, id_field="product_id") + return parsed_products @pytest_asyncio.fixture(scope="session") async def async_client(): - - async with AsyncClient(app=app, base_url="http://test/api/v1/") as client: - - yield client + async with LifespanManager(app): + async with AsyncClient( + transport=httpx.ASGITransport(app=app), base_url="http://test/api/v1/" + ) as client: + yield client diff --git a/backend/productsearch/tests/utils/__init__.py b/backend/productsearch/tests/utils/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/backend/productsearch/tests/utils/seed.py b/backend/productsearch/tests/utils/seed.py deleted file mode 100644 index 10a5fd1..0000000 --- a/backend/productsearch/tests/utils/seed.py +++ /dev/null @@ -1,34 +0,0 @@ -import json -import os - -import numpy as np - -from productsearch.db import redis_helpers - - -def seed_test_db(): - cwd = os.getcwd() - with open(f"{cwd}/productsearch/tests/utils/test_vectors.json", "r") as f: - products = json.load(f) - - parsed_products = [] - - # convert to bytes - for product in products: - parsed = {} - parsed["text_vector"] = np.array( - product["text_vector"], dtype=np.float32 - ).tobytes() - parsed["img_vector"] = np.array( - product["img_vector"], dtype=np.float32 - ).tobytes() - parsed["category"] = product["product_metadata"]["master_category"] - parsed["img_url"] = product["product_metadata"]["img_url"] - parsed["name"] = product["product_metadata"]["name"] - parsed["gender"] = product["product_metadata"]["gender"] - parsed["product_id"] = product["product_id"] - parsed_products.append(parsed) - - index = redis_helpers.get_test_index() - index.load(data=parsed_products, id_field="product_id") - return parsed_products diff --git a/backend/productsearch/tests/utils/test_vectors.json b/backend/productsearch/tests/utils/test_vectors.json deleted file mode 100644 index a9a8567..0000000 --- a/backend/productsearch/tests/utils/test_vectors.json +++ /dev/null @@ -1,3899 +0,0 @@ -[ - { - "text_vector": [ - -0.03393559530377388, - -0.04990660026669502, - 0.016132276505231857, - -0.00846362765878439, - -0.05648665502667427, - 0.018785007297992706, - 0.00879194401204586, - 0.06382977217435837, - 0.00597847905009985, - -0.08251062780618668, - 0.0003185232635587454, - -5.0618360546650365e-05, - 0.005405772477388382, - -0.03111191652715206, - 0.004562561400234699, - -0.005532930139452219, - 0.10343310236930847, - 0.10447119921445847, - 0.016839593648910522, - -0.032953377813100815, - 0.04014723002910614, - 0.06387364864349365, - 0.016832515597343445, - 0.05888661742210388, - 0.07573509961366653, - -0.0033486674074083567, - 0.05588237941265106, - -0.016997838392853737, - 0.003693588310852647, - 0.024673664942383766, - -0.005483895540237427, - 0.019571328535676003, - 0.0046260058879852295, - 0.03906898945569992, - 0.019499169662594795, - -0.06892002373933792, - 0.01181041356176138, - -0.026075659319758415, - 0.03275682032108307, - -0.011539081111550331, - 0.07350470125675201, - -0.0591978095471859, - 0.06153172254562378, - -0.011098482646048069, - 0.03916731849312782, - -0.004853249993175268, - 0.01013807114213705, - 0.005201645661145449, - -0.025134054943919182, - -0.015050604939460754, - -0.07768465578556061, - -0.03046954795718193, - -0.0031400478910654783, - -0.02269473299384117, - -0.0005072109634056687, - -0.02397204376757145, - -0.016115568578243256, - -0.014321294613182545, - 0.003676225198432803, - 0.02955225296318531, - 0.014535190537571907, - 0.04973544925451279, - -0.05379035323858261, - 0.06832382082939148, - 0.06784015148878098, - 0.015294838696718216, - -0.009842496365308762, - 0.014504199847579002, - -0.03122352994978428, - -0.01613180711865425, - -0.025248529389500618, - -0.04231264442205429, - -0.016540318727493286, - 0.0001432958379155025, - -0.0056154076009988785, - 0.0097186965867877, - -0.031045211479067802, - -0.07173841446638107, - -0.0871841236948967, - -0.03233925253152847, - 0.017746875062584877, - 0.03401092812418938, - -0.020756222307682037, - 0.04251581430435181, - -0.0036885766312479973, - -0.04426254332065582, - 0.014653257094323635, - 0.03886453062295914, - -0.011128249578177929, - 0.0030326980631798506, - 0.043790675699710846, - -0.03719367831945419, - 0.03924649953842163, - 0.018893342465162277, - 0.04419995844364166, - 0.007890095002949238, - -0.0028986092656850815, - -0.033496830612421036, - 0.0030497724656015635, - -0.09353843331336975, - 0.011364402249455452, - 0.009714250452816486, - -0.028228309005498886, - -0.0034365204628556967, - -0.03337673470377922, - 0.011352911591529846, - 0.03699725493788719, - 0.0041985539719462395, - -0.043616682291030884, - -0.0613630972802639, - -0.0002867076836992055, - 0.06323304027318954, - 0.02979828603565693, - 0.005455720238387585, - 0.034946784377098083, - -0.005342879332602024, - -0.07164490967988968, - 0.022429214790463448, - -0.016895953565835953, - 0.04505882412195206, - 0.005202071741223335, - 0.001803889754228294, - -0.040522582828998566, - -0.00925680436193943, - -0.023505667224526405, - 0.005336982198059559, - -0.005406791344285011, - -0.033150553703308105, - 0.00014492358604911715, - -0.02251916378736496, - -0.03213442862033844, - -0.07870680093765259, - -0.017452707514166832, - 0.0067907157354056835, - -0.020899413153529167, - 0.0005868286825716496, - 0.021772351115942, - -0.05350570008158684, - 0.011851498857140541, - 0.00908143725246191, - -0.053206413984298706, - -0.008514701388776302, - 0.04554542526602745, - 0.03208543360233307, - 0.020564090460538864, - 0.03181111440062523, - -0.008712765760719776, - -0.016613414511084557, - -0.011637146584689617, - 0.016027018427848816, - 0.02783716283738613, - 0.019440852105617523, - -0.02984008938074112, - -0.024519801139831543, - -0.06927864253520966, - 0.018899686634540558, - 0.01639719493687153, - -0.043533872812986374, - 0.06363128125667572, - -0.010938062332570553, - -0.02175607904791832, - -0.05223378911614418, - 0.016116905957460403, - 0.004888846073299646, - 0.07678312808275223, - 0.009497089311480522, - -0.006415256764739752, - 0.023976502940058708, - 0.008534741587936878, - 0.024642933160066605, - 0.005944297183305025, - -0.06251084804534912, - 0.055301494896411896, - -0.06546376645565033, - 0.00193867611233145, - 0.02272355742752552, - -0.03286789730191231, - 0.06420274078845978, - -0.0025534105952829123, - -0.008454752154648304, - -0.03540773317217827, - -0.027233809232711792, - 0.022590868175029755, - 0.03118966519832611, - -0.03544211387634277, - 0.02776576764881611, - 0.009208066388964653, - 0.031304892152547836, - 0.03148844465613365, - -0.01705220341682434, - -0.00021590660617221147, - 0.05593250319361687, - -0.015561473555862904, - -0.024937596172094345, - -0.025176778435707092, - 0.049088675528764725, - -0.007490852847695351, - -0.02831689454615116, - 0.009519128128886223, - 0.005547249689698219, - -0.015410251915454865, - -0.01615542359650135, - -0.02801065891981125, - -0.06382467597723007, - -0.06637170165777206, - 0.003180221887305379, - -0.025272486731410027, - 0.025063686072826385, - 0.022493654862046242, - 0.006096544209867716, - -0.0625917986035347, - 0.030303722247481346, - -0.035027626901865005, - 0.05280965566635132, - -0.009280146099627018, - -0.03292974829673767, - 0.035065457224845886, - 0.04754626750946045, - 0.0384429432451725, - 0.03750963881611824, - -0.039183150976896286, - -0.04159984737634659, - -0.018830908462405205, - -0.003437978681176901, - -0.034320201724767685, - 0.04795364290475845, - -0.032227057963609695, - 0.03728616610169411, - -0.05122159793972969, - 0.011107193306088448, - 0.001230345107614994, - 0.02660415507853031, - -0.03312051296234131, - 0.04429064691066742, - 0.025250056758522987, - -0.02225230447947979, - -0.019868120551109314, - -0.004622646141797304, - 0.015964478254318237, - -0.012140940874814987, - -0.005271021276712418, - -0.04417719691991806, - -0.008836973458528519, - -0.01985839195549488, - 0.01438771840184927, - -0.05426889285445213, - 0.004801252856850624, - -0.032227449119091034, - -0.03455549106001854, - -0.0013448289828374982, - 0.01332621369510889, - -0.02960873767733574, - 0.0357929989695549, - 0.0062960549257695675, - -0.03888843208551407, - 0.043890468776226044, - -0.027121180668473244, - -0.008967895060777664, - 0.04637568071484566, - 0.05659542605280876, - -0.01866857148706913, - 0.02339891716837883, - -0.039214760065078735, - 0.09742870181798935, - 0.02456514723598957, - 0.019452352076768875, - 0.009586907923221588, - 0.02998150885105133, - 0.03705842047929764, - 0.01654098927974701, - -0.07505930960178375, - -0.0434543713927269, - -0.029102839529514313, - 0.005165805108845234, - -0.04940882697701454, - -0.028128622099757195, - 0.05604720115661621, - -0.02422865852713585, - 0.01497571263462305, - -0.017759691923856735, - 0.01273058820515871, - -0.011741937138140202, - -0.047867804765701294, - 0.00473345210775733, - 0.024863529950380325, - -0.012686744332313538, - -0.037471551448106766, - -0.040277253836393356, - 0.006212162785232067, - 0.018860945478081703, - 0.021480530500411987, - -0.022025292739272118, - 0.005858102813363075, - 0.00843774899840355, - 0.04087912663817406, - -0.05282086133956909, - 0.03498505800962448, - 0.04415362328290939, - -0.003506459528580308, - 0.033895984292030334, - 0.05209290236234665, - -0.06120959296822548, - -0.016440171748399734, - -0.04450145363807678, - -0.044808343052864075, - -0.023465286940336227, - -0.039000581949949265, - 0.029621869325637817, - 0.07939174771308899, - 0.005688108969479799, - 0.012900558300316334, - 0.036535050719976425, - 0.034416113048791885, - -0.03338963910937309, - 0.03977019339799881, - 0.025810671970248222, - -0.015850048512220383, - 0.022691400721669197, - 0.0339798703789711, - 0.03477761894464493, - -0.04180338606238365, - 0.021672502160072327, - 0.04897826537489891, - -0.009264335967600346, - -0.04478788375854492, - -0.025223160162568092, - -0.0880902111530304, - -0.07986559718847275, - 0.030004071071743965, - 0.07550054788589478, - 0.021352170035243034, - -0.06404036283493042, - 0.047331977635622025, - -0.009149362333118916, - -0.012558549642562866, - -0.02410043217241764, - 0.03873436897993088, - 0.06760793924331665, - 0.019703971222043037, - 0.01903701387345791, - 0.03146923705935478, - 0.011822045780718327, - 0.013820323161780834, - 0.046530965715646744, - 0.0057722534984350204, - -0.007235377561300993, - 0.04761214554309845, - 0.04502183198928833, - 0.0037566618993878365, - 0.06368622183799744, - 0.01884528622031212, - 0.009200004860758781, - 0.03209213539958, - -0.049618303775787354, - -0.001631803810596466, - 0.017066771164536476, - -0.051420994102954865, - -0.039120957255363464, - -0.016216013580560684, - -0.06606243550777435, - -0.030666237697005272, - 0.04780522733926773, - 0.01776711829006672, - 0.032893724739551544, - 0.0007131390739232302, - -0.03023766167461872, - -0.04811779782176018, - -0.014173793606460094, - -0.02817005105316639, - -0.012027849443256855, - -0.006429607514292002, - 0.0010882338974624872, - -0.006640622392296791, - -0.06267828494310379, - -0.03587674722075462, - 0.0014659170992672443, - -0.016443872824311256, - -0.013858063146471977, - 0.006184784695506096, - 0.024877779185771942, - -0.018648909404873848, - -0.07375568151473999, - 0.0165398009121418, - -0.02720850147306919, - 0.014025786891579628, - 0.013232937082648277, - -0.040296394377946854, - -0.07310345023870468, - 0.05166107043623924, - -0.01892232522368431, - -0.02467680722475052, - -0.04716251417994499, - 0.09342038631439209, - 0.032422665506601334, - 0.05799644812941551, - 0.014735671691596508, - -0.0010633908677846193, - -0.00030097499256953597, - 0.016880325973033905, - -0.05831112340092659, - 0.0347287543118, - -0.033527884632349014, - 0.016586508601903915, - 0.05693844333291054, - -0.04335648939013481, - 0.009776759892702103, - -0.0030053218360990286, - -0.057905733585357666, - -0.01696743257343769, - -0.03671075031161308, - 0.01225623395293951, - 0.0864834263920784, - 0.030828701332211494, - -0.026173219084739685, - -0.005269192159175873, - 0.013644417747855186, - -0.029657866805791855, - 0.013020635582506657, - -0.010077279061079025, - 0.0011919612297788262, - 0.08367036283016205, - -0.04244127497076988, - -0.019861971959471703, - -0.0322553850710392, - -0.007308498956263065, - 0.008620179258286953, - 0.04857302084565163, - 0.059778425842523575, - 0.041013363748788834, - -0.01425447128713131, - 0.007392296101897955, - -0.0021458230912685394, - -0.009496014565229416, - 0.06665940582752228, - -0.0015664458042010665, - 0.061947643756866455, - -0.05401550233364105, - 0.015551939606666565, - -0.03212275728583336, - 0.14326466619968414, - 0.07305418699979782, - 0.02432163991034031, - -0.03385386988520622, - -0.03096604347229004, - -0.010838611051440239, - -0.020759552717208862, - 0.08232907950878143, - -0.01849890686571598, - 0.0023236952256411314, - 0.02000279352068901, - -0.03543560951948166, - -0.02500309608876705, - -0.07544269412755966, - -0.03681257739663124, - -0.023356646299362183, - 0.02014840394258499, - -0.004308828618377447, - -0.021056678146123886, - -0.0340706892311573, - 0.005756992381066084, - 0.019031338393688202, - 0.0025014944840222597, - -0.051194388419389725, - 0.044678643345832825, - 0.0030806399881839752, - -0.009118152782320976, - 0.0064518870785832405, - 0.009612719528377056, - -0.040094658732414246, - 0.04688591510057449, - -0.11521675437688828, - 0.015795951709151268, - 0.04034894332289696, - -0.03824043273925781, - 0.023466847836971283, - 0.0214488934725523, - 0.06391274183988571, - 0.006672362796962261, - 0.04955239221453667, - -0.005667699966579676, - -0.000939805235248059, - 0.02220277301967144, - 0.005777365993708372, - 0.008846083655953407, - -0.0023736541625112295, - -0.017694205045700073, - 0.03048483096063137, - 0.04487602040171623, - 0.02107277326285839, - -0.002063559601083398, - -0.06016073748469353, - -0.03223465383052826, - -0.06645369529724121, - 0.04144921898841858, - 2.6023940661778378e-33, - -0.029112419113516808, - 0.027139173820614815, - -0.027569836005568504, - 0.030279556289315224, - -0.004434259608387947, - -0.048652634024620056, - -0.021458672359585762, - -0.01392059214413166, - 0.005342056974768639, - -0.05034767463803291, - -0.07521184533834457, - 0.019696811214089394, - 0.03127216920256615, - 0.009301777929067612, - 0.01008533500134945, - -0.012601974420249462, - -0.04459903761744499, - -0.07563737034797668, - -0.008699389174580574, - 0.005845831707119942, - -0.02474849671125412, - 0.015006870031356812, - 0.012887362390756607, - 0.06471296399831772, - 0.03896433487534523, - -0.006097625941038132, - -0.007055818568915129, - 0.014148968271911144, - 0.06677020341157913, - 0.008194589987397194, - -0.00843536015599966, - -0.0020477373618632555, - -0.032097749412059784, - -0.01069018803536892, - -0.07233092188835144, - 0.007518956903368235, - 0.012899922206997871, - -0.01816881075501442, - -0.0508074089884758, - -0.013811360113322735, - -0.026359902694821358, - -0.016759224236011505, - 0.01596258394420147, - 0.019943691790103912, - 0.05230144038796425, - -0.06904474645853043, - 0.01679394766688347, - -0.027789557352662086, - 0.005197923164814711, - 0.020424358546733856, - 0.039931897073984146, - 0.0226381104439497, - -0.002591995522379875, - 0.03434031456708908, - 0.02219429612159729, - -0.016339166089892387, - 0.012328250333666801, - -0.06449461728334427, - -0.01671026274561882, - -0.021590042859315872, - 0.01628253236413002, - -0.07683385163545609, - 0.03708987310528755, - 0.06953958421945572, - 0.038054585456848145, - -0.03682452440261841, - -0.06347202509641647, - -0.02653820812702179, - 0.05673739314079285, - -0.03711933270096779, - 0.009481999091804028, - 0.005265864543616772, - 0.06123204901814461, - -0.011175659485161304, - -0.028009656816720963, - 0.00023451069137081504, - -0.0016385375056415796, - 0.003676333697512746, - -0.005239939317107201, - 0.005395047832280397, - -0.009376623667776585, - 0.025685612112283707, - -0.0833197757601738, - 0.004798338748514652, - 0.03966202959418297, - -0.020798271521925926, - -0.036650702357292175, - -0.021408826112747192, - -0.008483895100653172, - 0.007455766201019287, - 0.01751876436173916, - -0.004837819375097752, - 0.043923210352659225, - 0.0020698371808975935, - -0.0064608873799443245, - 0.04691885784268379, - -0.03283268213272095, - -0.0014651546953245997, - 0.009402312338352203, - 0.013497631996870041, - 0.019221195951104164, - 0.009098423644900322, - -0.02054799348115921, - -0.0021446726750582457, - -0.007356501184403896, - 0.012563804164528847, - 0.02486245147883892, - -0.013305466622114182, - 0.03182007372379303, - -0.035584546625614166, - 0.022490326315164566, - 0.04556747525930405, - -0.004448640625923872, - -0.029569832608103752, - 0.03670313581824303, - 0.016944877803325653, - 0.007922742515802383, - -0.009226726368069649, - -0.11155203729867935, - 0.07871992886066437, - 0.021008841693401337, - -0.01743566244840622, - 0.035147588700056076, - 0.027405448257923126, - 0.028433548286557198, - 0.003829195164144039, - -0.0006103036575950682, - 0.03521190583705902, - 0.03589536249637604, - 0.016948552802205086, - -0.008009872399270535, - -0.039476118981838226, - -0.015803184360265732, - -0.01160280592739582, - -0.0654168650507927, - -0.0009439907735213637, - 0.01633564941585064, - -0.06537310034036636, - 0.004506586119532585, - -0.06770332157611847, - 0.00868937000632286, - 0.014138869009912014, - -0.024692071601748466, - 0.05028563365340233, - -0.022254884243011475, - -0.023609578609466553, - 0.06883847713470459, - -0.00590246869251132, - 0.05147001892328262, - -0.05654331296682358, - 0.007979866117238998, - 0.033850349485874176, - -0.07012176513671875, - 0.04099681228399277, - -0.06963951885700226, - -0.018162619322538376, - 0.045439817011356354, - 0.07018809765577316, - 0.005352327600121498, - 0.03470807522535324, - 0.006716700736433268, - 0.01109995599836111, - -0.03327262029051781, - 0.0750216618180275, - -0.006794843822717667, - -0.023908773437142372, - 0.02136465348303318, - 0.004486675374209881, - 0.00010750960791483521, - -0.042383208870887756, - 0.006999874021857977, - 0.029889337718486786, - 0.026991836726665497, - -0.008198073133826256, - 0.030653180554509163, - -0.02327040769159794, - 0.07274460792541504, - 0.0005662862677127123, - -0.07608013600111008, - 0.007077177055180073, - -0.06568139791488647, - -0.05316115915775299, - -0.03526247292757034, - -0.020170433446764946, - 0.03199014440178871, - -0.006314262747764587, - -0.012019787915050983, - -0.010583826340734959, - 0.0453849621117115, - 0.06132867932319641, - 0.021829668432474136, - 0.01626937836408615, - 0.0603715255856514, - -0.016888398677110672, - -0.028254995122551918, - -0.026342865079641342, - 0.07478868961334229, - -0.028341542929410934, - -0.02785210870206356, - 0.016427254304289818, - -0.021726803854107857, - -0.02016947977244854, - 0.03713537007570267, - -0.024262677878141403, - -0.06551951169967651, - -0.007407693192362785, - -0.01872149482369423, - -0.04042063280940056, - 0.03734245151281357, - -0.0354398638010025, - -0.005492678377777338, - -0.017799505963921547, - 0.03671438992023468, - 0.009855690412223339, - 0.007541081868112087, - 0.002123068319633603, - 0.02614397369325161, - 0.019680684432387352, - -0.015599251724779606, - -0.03180048614740372, - -0.0027479282580316067, - -0.003465427551418543, - -0.022585604339838028, - 0.04364408552646637, - 0.04590499401092529, - 0.03039989061653614, - -0.02501865290105343, - -0.018725760281085968, - -0.03841501101851463, - -0.03846999630331993, - -0.04733772203326225, - -0.02596689574420452, - 0.01923862285912037, - -0.0548657663166523, - 0.049230147153139114, - 0.05894150584936142, - 0.0614728145301342, - 0.05202079936861992, - 0.044498879462480545, - 0.01884595863521099, - -0.04909370467066765, - 0.032387979328632355, - 0.01943165808916092, - 0.005559650249779224, - -0.008502674289047718, - 0.028704054653644562, - -0.023885568603873253, - 0.01673683151602745, - -0.04476772993803024, - -0.028978601098060608, - -0.016595033928751945, - 0.025348611176013947, - 0.021823996677994728, - 0.03303432837128639, - -0.06657654792070389, - 0.011180645786225796, - -0.04453815892338753, - 0.002057461068034172, - 0.01483633928000927, - -0.05698612332344055, - -0.011611763387918472, - -0.008270759135484695, - 0.03396761044859886, - -0.012584727257490158, - -0.028426695615053177, - -0.02404310181736946, - 0.027377694845199585, - 0.040209174156188965, - -0.03167543560266495, - 0.022754568606615067, - -0.02133987285196781, - -0.0016616465291008353, - 0.01239469088613987 - ], - "img_vector": [ - 1.6060603857040405, - 0.023311417549848557, - 1.5992186069488525, - 0.24428938329219818, - 0.23620489239692688, - 0.7305210828781128, - 2.6585094928741455, - 0.56398606300354, - 1.238928198814392, - 3.6237173080444336, - 0.17512637376785278, - 1.004285216331482, - 0.27379342913627625, - 0.5485386848449707, - 0.17267373204231262, - 0.7927314639091492, - 0.5915138125419617, - 0.7549329996109009, - 0.2891375422477722, - 0.044890034943819046, - 0.7849643230438232, - 0.3444228768348694, - 1.5427168607711792, - 0.7024847269058228, - 1.9577040672302246, - 0.05392508581280708, - 0.6979166865348816, - 0.657534122467041, - 0.2386043518781662, - 1.2968523502349854, - 0.6002953052520752, - 0.6281573176383972, - 0.3771921992301941, - 2.258343458175659, - 1.5886999368667603, - 0.013888304121792316, - 1.9237171411514282, - 0.6578956842422485, - 3.3070313930511475, - 0.03344883397221565, - 0.040779221802949905, - 0.009543554857373238, - 0.10308908671140671, - 0.2483556717634201, - 0.7300630807876587, - 0.1418759822845459, - 1.9762786626815796, - 0.16385480761528015, - 0.12981082499027252, - 1.6922454833984375, - 0.6217420697212219, - 2.0591580867767334, - 0.7417920231819153, - 0.48015737533569336, - 1.9160137176513672, - 0.20557694137096405, - 0.42179447412490845, - 0.5475835800170898, - 1.4131569862365723, - 0.17968598008155823, - 0.41470009088516235, - 0.6715495586395264, - 0.004424240905791521, - 0.03476451709866524, - 0.14679187536239624, - 0.02477596327662468, - 0.19274598360061646, - 0.4267756938934326, - 3.002120018005371, - 0.053201012313365936, - 0.4220049977302551, - 2.2039341926574707, - 0.2633339762687683, - 0.7358637452125549, - 0.3891788721084595, - 0.18670202791690826, - 0.3857291042804718, - 0.3079127371311188, - 0.9794412851333618, - 0.29265838861465454, - 0.08062100410461426, - 3.8685548305511475, - 1.0757371187210083, - 0.28298553824424744, - 1.9911510944366455, - 0.30302122235298157, - 0.48161953687667847, - 0.9757227897644043, - 0.8554298877716064, - 0.26958680152893066, - 1.2203893661499023, - 0.19178716838359833, - 0.6936157941818237, - 0.1857844889163971, - 1.2806748151779175, - 2.822582721710205, - 1.7506636381149292, - 0.5258067846298218, - 0.12348953634500504, - 1.0646631717681885, - 0.1978907287120819, - 1.5614230632781982, - 0.26506033539772034, - 0.0060147675685584545, - 0.46644502878189087, - 3.204822540283203, - 0.767645001411438, - 0.21385683119297028, - 0.0416906513273716, - 2.973973512649536, - 0.5467687845230103, - 0.05251817777752876, - 0.7152663469314575, - 1.32183039188385, - 0.38034582138061523, - 0.896089494228363, - 1.2865360975265503, - 5.364962100982666, - 0.5069512128829956, - 0.8030731678009033, - 0.4308767020702362, - 1.0436382293701172, - 0.5071713924407959, - 0.013664341531693935, - 0.41897979378700256, - 0.28651049733161926, - 1.232376217842102, - 0.6509360671043396, - 0.6817529797554016, - 0.6253411173820496, - 0.5689865946769714, - 1.5946040153503418, - 0.4697061777114868, - 1.1851292848587036, - 0.10339945554733276, - 0.16823703050613403, - 1.3908051252365112, - 0.05650084465742111, - 0.8963669538497925, - 0.08991120010614395, - 1.7276122570037842, - 0.5304086804389954, - 0.15751291811466217, - 0.7798666954040527, - 0.8531783223152161, - 0.07579825073480606, - 0.02254975587129593, - 0.5722983479499817, - 0.3637908101081848, - 0.2113863080739975, - 0.4218485951423645, - 0.5964052677154541, - 1.098252296447754, - 0.24399873614311218, - 0.5031745433807373, - 1.7694472074508667, - 0.7445709705352783, - 0.026101643219590187, - 0.20490258932113647, - 1.0809136629104614, - 5.364598274230957, - 0.10500452667474747, - 0.028322434052824974, - 4.393288612365723, - 2.454454183578491, - 0.15388096868991852, - 0.04443923756480217, - 1.386675477027893, - 0.07155905663967133, - 0.33951857686042786, - 2.5874991416931152, - 0.10189835727214813, - 0.3037762939929962, - 0.5270680785179138, - 1.8049432039260864, - 0.4002498388290405, - 0.0, - 0.36352360248565674, - 0.1122952550649643, - 3.9193084239959717, - 1.022976279258728, - 0.18945834040641785, - 0.38455238938331604, - 1.604540467262268, - 0.20486967265605927, - 0.9759292602539062, - 0.023901350796222687, - 0.6389347910881042, - 0.3143121004104614, - 0.3337785005569458, - 0.2949604392051697, - 0.03339492902159691, - 1.3361395597457886, - 0.6338132619857788, - 0.11517766118049622, - 0.15511742234230042, - 1.9459213018417358, - 0.10533364117145538, - 1.7245819568634033, - 0.6566029787063599, - 0.2102874517440796, - 0.977824330329895, - 0.3738621771335602, - 0.14942370355129242, - 1.0115660429000854, - 0.8036091327667236, - 2.3727846145629883, - 0.19382667541503906, - 1.317394495010376, - 0.12315088510513306, - 0.04790612682700157, - 0.30056115984916687, - 0.051859915256500244, - 0.16330936551094055, - 0.3902614414691925, - 0.8400954604148865, - 1.3039026260375977, - 0.35030633211135864, - 0.005629597697407007, - 0.9061047434806824, - 0.875684380531311, - 0.6288579106330872, - 0.3180611729621887, - 0.4043000638484955, - 0.0, - 0.8290240168571472, - 0.08352002501487732, - 0.24920961260795593, - 0.15347686409950256, - 0.09582220017910004, - 0.5408208966255188, - 1.7414767742156982, - 1.3652604818344116, - 0.31055599451065063, - 0.6218233108520508, - 0.096509650349617, - 1.1218194961547852, - 0.7589020133018494, - 0.6382386088371277, - 1.4120192527770996, - 0.8366636037826538, - 0.08634627610445023, - 2.34159255027771, - 0.7971048951148987, - 0.12434011697769165, - 0.21753312647342682, - 0.35343459248542786, - 1.0159199237823486, - 4.873634338378906, - 0.2797590494155884, - 0.2863509953022003, - 0.647856593132019, - 0.9216055870056152, - 0.04012395069003105, - 0.3193407952785492, - 2.4193224906921387, - 0.3003430962562561, - 1.778892159461975, - 0.8514758348464966, - 0.015147564001381397, - 0.9429329037666321, - 3.015664577484131, - 0.027810975909233093, - 0.5146723985671997, - 0.15839818120002747, - 0.48258399963378906, - 0.26816558837890625, - 0.3736044466495514, - 0.7515292763710022, - 2.9619150161743164, - 0.568040132522583, - 0.018915098160505295, - 0.7167770266532898, - 1.3097935914993286, - 0.5368766188621521, - 0.47738325595855713, - 2.2792320251464844, - 0.08365587145090103, - 3.6707632541656494, - 1.114358901977539, - 1.7270783185958862, - 0.5547150373458862, - 0.1916281282901764, - 0.36046382784843445, - 3.404851198196411, - 0.018108496442437172, - 0.8048120737075806, - 0.8753102421760559, - 0.5185558795928955, - 0.4681185185909271, - 1.0220873355865479, - 0.03993622586131096, - 0.7356597185134888, - 0.34469106793403625, - 0.3270503580570221, - 1.1546738147735596, - 1.7357233762741089, - 0.35392025113105774, - 1.9712550640106201, - 0.3051522374153137, - 4.659305572509766, - 0.9718514084815979, - 0.6100807785987854, - 0.0785725861787796, - 0.391244500875473, - 0.11548355966806412, - 3.515791177749634, - 0.21507315337657928, - 0.7276331186294556, - 0.30519044399261475, - 0.4538881480693817, - 3.4201977252960205, - 0.03828118368983269, - 0.35589295625686646, - 1.8634214401245117, - 0.3320775628089905, - 0.6992347240447998, - 0.1949286162853241, - 0.58704674243927, - 0.5947393178939819, - 0.8339709639549255, - 1.7812957763671875, - 1.4620548486709595, - 0.29814985394477844, - 0.2399066686630249, - 0.5540988445281982, - 0.47884684801101685, - 1.6393197774887085, - 0.019417017698287964, - 0.12630312144756317, - 0.028104867786169052, - 0.012865184806287289, - 2.904207706451416, - 0.39732155203819275, - 1.8746265172958374, - 0.15251758694648743, - 0.1485610455274582, - 0.11073493957519531, - 0.23561647534370422, - 1.9043076038360596, - 0.1539708822965622, - 0.40040281414985657, - 0.36775103211402893, - 1.787960410118103, - 0.15985651314258575, - 0.05280723422765732, - 1.3120622634887695, - 1.0336921215057373, - 0.18516483902931213, - 1.2120698690414429, - 0.5979412794113159, - 2.651008367538452, - 0.20710958540439606, - 0.4899310767650604, - 0.9152653217315674, - 1.4556013345718384, - 1.7977503538131714, - 0.9995325207710266, - 0.11671250313520432, - 0.9690338373184204, - 1.1871520280838013, - 1.7501611709594727, - 3.4064013957977295, - 1.0542253255844116, - 1.8227778673171997, - 0.19713647663593292, - 1.4037928581237793, - 1.4500869512557983, - 2.601261615753174, - 3.248337984085083, - 0.06415573507547379, - 2.478783369064331, - 0.07138216495513916, - 1.951278567314148, - 1.4193190336227417, - 0.6458536386489868, - 0.07498359680175781, - 1.1215444803237915, - 0.2367917150259018, - 0.48600688576698303, - 0.6099836826324463, - 1.1967101097106934, - 0.3284856081008911, - 0.16726087033748627, - 0.007037023082375526, - 0.057962674647569656, - 0.7052373886108398, - 2.3377621173858643, - 0.13116194307804108, - 0.8777397871017456, - 0.7162390947341919, - 0.43820977210998535, - 0.10830049961805344, - 0.17373286187648773, - 0.23291008174419403, - 0.4541318416595459, - 0.5536465048789978, - 0.7602322101593018, - 2.699960470199585, - 1.0956249237060547, - 0.8737528324127197, - 0.6555755734443665, - 0.8438711166381836, - 0.7002922892570496, - 0.4335423707962036, - 0.08192634582519531, - 1.4609627723693848, - 0.08017786592245102, - 0.07634236663579941, - 1.128524899482727, - 0.3047429621219635, - 0.29571810364723206, - 0.30547991394996643, - 0.7010190486907959, - 0.04223880171775818, - 2.0985684394836426, - 0.9767540097236633, - 1.2138278484344482, - 0.40932098031044006, - 0.35035213828086853, - 0.06969039142131805, - 0.12594301998615265, - 0.23062466084957123, - 0.10362624377012253, - 0.6114252209663391, - 0.5678809285163879, - 0.5782231092453003, - 0.2890022099018097, - 0.031568169593811035, - 3.719416379928589, - 0.2750316858291626, - 2.2642037868499756, - 1.4262094497680664, - 0.5401033163070679, - 1.0348756313323975, - 0.24485263228416443, - 0.37098413705825806, - 0.4993506371974945, - 0.6425707936286926, - 0.0708153024315834, - 0.655907392501831, - 0.2669297158718109, - 0.9327427744865417, - 0.8548014163970947, - 0.08585119992494583, - 1.043649673461914, - 0.42825624346733093, - 0.054034583270549774, - 1.2727422714233398, - 0.17111805081367493, - 0.29886096715927124, - 0.34513986110687256, - 0.5792043209075928, - 1.0208455324172974, - 1.1045252084732056, - 1.2608152627944946, - 0.18253958225250244, - 0.3627760410308838, - 0.3966849446296692, - 0.7543349266052246, - 0.7898048162460327, - 0.8860621452331543, - 0.6010585427284241, - 1.2443572282791138, - 0.09230247139930725, - 1.322063684463501, - 0.2401014119386673, - 0.10430189222097397, - 0.6249082684516907, - 0.26299750804901123, - 0.003940347116440535, - 0.2516726851463318, - 2.076223373413086, - 0.6684199571609497, - 1.287322759628296, - 0.3987768888473511, - 0.707984983921051, - 0.17357932031154633, - 0.5594068169593811, - 0.9887188673019409, - 0.03568454086780548, - 1.7437864542007446, - 0.24299460649490356, - 0.13032035529613495, - 2.006112813949585, - 0.7195961475372314, - 0.26086491346359253, - 0.3743102550506592, - 0.4908822774887085, - 0.13479040563106537, - 0.680493175983429, - 0.008685790002346039, - 1.1826517581939697, - 0.683580219745636, - 0.0569118857383728, - 0.04791945219039917, - 0.9839538335800171, - 0.11316896975040436, - 0.030222930014133453, - 0.2739611566066742, - 0.5381839275360107, - 1.3884825706481934, - 0.050621408969163895, - 3.727792739868164, - 0.594207763671875, - 0.12932159006595612, - 0.03183061629533768, - 1.0757758617401123, - 0.8958529233932495, - 1.022218942642212, - 0.033143796026706696, - 0.09127800911664963 - ], - "product_id": 8110, - "product_metadata": { - "name": "Fastrack Men Economy 2 Analg Black Watch", - "gender": "Men", - "master_category": "Accessories", - "sub_category": "Watches", - "article_type": "Watches", - "base_color": "Black", - "season": "Winter", - "year": 2016, - "usage": "Casual", - "img_url": "http://assets.myntassets.com/v1/images/style/properties/112edfec7e1965c0f64ad9eb51cac579_images.jpg" - } - }, - { - "text_vector": [ - -0.03956003487110138, - -0.05192076042294502, - -0.016565263271331787, - -0.017883693799376488, - -0.04446249455213547, - 0.07840685546398163, - 0.022908033803105354, - 0.0297249723225832, - 0.021666724234819412, - -0.042004335671663284, - 0.036491334438323975, - -0.020826613530516624, - -0.011384925805032253, - -0.0344848558306694, - 0.01081444788724184, - 0.0299668088555336, - 0.07061894983053207, - 0.07840172946453094, - -0.022010738030076027, - -0.0417686365544796, - 0.04098844155669212, - 0.06144861876964569, - -0.017192916944622993, - 0.03961961716413498, - 0.008903353475034237, - -0.021294644102454185, - 0.06502147018909454, - -0.02258363924920559, - 0.03614065423607826, - 0.04043930396437645, - 0.0150381401181221, - 0.001416013459675014, - -0.014028999954462051, - 0.021732646971940994, - -0.013997831381857395, - -0.05819939076900482, - 0.01492339838296175, - -0.04468376934528351, - 0.012160065583884716, - -0.0076502482406795025, - 0.028832755982875824, - -0.005951658356934786, - 0.03970351442694664, - -0.004494499880820513, - 0.05108845606446266, - 0.001684092916548252, - 0.0008817344205453992, - 0.00411177147179842, - -0.02144204080104828, - -0.016585566103458405, - -0.016995076090097427, - -0.040488217025995255, - -0.03340740501880646, - -0.04477756842970848, - 0.009583275765180588, - -0.0041777896694839, - -0.009617364034056664, - 0.01585548184812069, - 0.019992783665657043, - 0.03840921074151993, - 0.02071666345000267, - 0.048083268105983734, - -0.02040758915245533, - 0.031000938266515732, - 0.06812821328639984, - 0.011646789498627186, - -0.013451592065393925, - 0.021772243082523346, - -0.02313109301030636, - -0.005434616003185511, - -0.021549349650740623, - -0.10607314109802246, - -0.036522530019283295, - -0.008935226127505302, - -0.00046331624616868794, - 0.002063275082036853, - -0.025387685745954514, - -0.062166258692741394, - -0.05370396375656128, - -0.031668320298194885, - 0.00983839575201273, - -0.019954970106482506, - 0.006308962125331163, - 0.007074798457324505, - -0.023327328264713287, - -0.023513520136475563, - 0.0017122860299423337, - 0.05278846621513367, - -0.04941856488585472, - 0.02338438294827938, - 0.048768550157547, - -0.03671479970216751, - 0.0022506334353238344, - 0.016642598435282707, - 0.04978928714990616, - 0.029524020850658417, - 0.004246348515152931, - -0.03375282883644104, - 0.005052380263805389, - -0.09444107115268707, - -0.021951669827103615, - 0.01118858065456152, - -0.06394816935062408, - -0.024740325286984444, - -0.047069650143384933, - -0.027928167954087257, - 0.03824741765856743, - 0.008375709876418114, - -0.04212179034948349, - -0.057052627205848694, - -0.008151791989803314, - 0.04589974507689476, - -0.003461139975115657, - 0.02935984916985035, - 0.02557174116373062, - 0.011775101535022259, - -0.05462843179702759, - 0.04555124789476395, - -0.0029484028927981853, - 0.03397729992866516, - 0.015107337385416031, - -0.003401111578568816, - -0.05916859954595566, - -0.02875794842839241, - -0.06419749557971954, - -0.02973351441323757, - -0.05374949797987938, - -0.04597564414143562, - -0.005265756044536829, - -0.009301926009356976, - -0.03200768679380417, - -0.09036583453416824, - 0.00596525939181447, - 0.01929308846592903, - -0.013600586913526058, - 0.008084025233983994, - 0.040482018142938614, - -0.026871684938669205, - 0.007261896505951881, - 0.0004182447446510196, - -0.06808318942785263, - -0.029019970446825027, - 0.05508573353290558, - 0.02634572982788086, - 0.01535020675510168, - -0.010003991425037384, - -0.008698824793100357, - -0.0002646228822413832, - -0.05140945687890053, - 0.032503534108400345, - 0.044848959892988205, - 0.058232903480529785, - -0.033173564821481705, - -0.009293976239860058, - -0.05428154021501541, - 0.020526200532913208, - 0.044397711753845215, - -0.004252791404724121, - 0.04932601377367973, - 0.012593874707818031, - -0.015860024839639664, - -0.047698624432086945, - 0.03696110472083092, - 0.011980089358985424, - 0.0882352888584137, - 0.028307363390922546, - -0.009236762300133705, - 0.04139421880245209, - -0.01428673043847084, - 0.009060285985469818, - 0.008297644555568695, - -0.055170029401779175, - 0.04544633999466896, - -0.04942453280091286, - -0.007710778620094061, - 0.028064457699656487, - -0.030963463708758354, - 0.07718689739704132, - 0.0027566237840801477, - -0.038773052394390106, - -0.015061534009873867, - -0.016916807740926743, - 0.010910352692008018, - -0.011073291301727295, - -0.02200395241379738, - 0.05179809406399727, - 0.006394921336323023, - 0.029666360467672348, - 0.008976570330560207, - -0.03630754351615906, - 0.021507438272237778, - 0.059086959809064865, - -0.01907721348106861, - -0.06743509322404861, - 0.007518804166465998, - 0.028413377702236176, - 0.022003235295414925, - -0.030189193785190582, - -0.008970558643341064, - 0.01926489733159542, - -0.028522029519081116, - -0.0193167794495821, - -0.017060134559869766, - -0.045428384095430374, - -0.044508494436740875, - -0.01804306171834469, - -0.03743087872862816, - 0.039115455001592636, - 0.03570073843002319, - -0.011416563764214516, - -0.07893043011426926, - -0.00017856041085906327, - -0.03673388436436653, - 0.029527951031923294, - 0.013893533498048782, - -0.04059378802776337, - 0.04404868930578232, - 0.05912346765398979, - -0.0014266785001382232, - 0.04332496598362923, - -0.034501731395721436, - -0.023464057594537735, - -0.03714970126748085, - -0.016034778207540512, - -0.0224074125289917, - 0.04273255914449692, - -0.02985221892595291, - 0.022388262674212456, - -0.03982994332909584, - 0.03242029622197151, - -0.012325557880103588, - 0.03556424379348755, - -0.04106668382883072, - 0.005439373664557934, - 0.021459177136421204, - -0.0029014211613684893, - -0.00997015368193388, - 0.007608452811837196, - -0.014376278966665268, - 0.01066827867180109, - 0.003606259124353528, - -0.015956250950694084, - -0.028990233317017555, - -0.00981700699776411, - 0.022149644792079926, - -0.040910061448812485, - 0.011101801879703999, - -0.035426340997219086, - -0.045448847115039825, - -0.019343417137861252, - 0.04644005000591278, - -0.04908820986747742, - 0.03372862562537193, - -1.5357936717919074e-05, - -0.017490990459918976, - 0.03395698219537735, - -0.03488814830780029, - -0.0026885552797466516, - 0.05528932437300682, - 0.028745420277118683, - -0.021850716322660446, - 0.007654757238924503, - -0.08122245222330093, - 0.06409380584955215, - 0.017351875081658363, - 0.0651145651936531, - 0.006867505144327879, - 0.03418561816215515, - 0.04023614898324013, - 0.014088406227529049, - -0.051756713539361954, - -0.04129195213317871, - -0.029904767870903015, - -0.024175116792321205, - -0.043152984231710434, - -0.026488255709409714, - 0.019789837300777435, - -0.000930867507122457, - -0.005714461673051119, - 0.01100038643926382, - -0.022661995142698288, - -0.007914056070148945, - 0.003336628433316946, - -0.006581802852451801, - 0.02294705994427204, - -0.028354482725262642, - -0.03277149796485901, - 0.025508716702461243, - 0.0004422290367074311, - 0.025802742689847946, - 0.009391884319484234, - -0.026124494150280952, - 0.03044079802930355, - 0.01530956570059061, - 0.009736836887896061, - -0.04797912389039993, - 0.05270855501294136, - 0.055098988115787506, - 0.016313651576638222, - 0.04324480891227722, - 0.06288357079029083, - -0.027349723502993584, - -0.030561428517103195, - -0.05802799388766289, - -0.017215121537446976, - -0.04114001616835594, - -0.053067129105329514, - 0.04155702143907547, - 0.04289903864264488, - 0.03753483295440674, - 0.0007087240810506046, - 0.018578344956040382, - 0.018868185579776764, - -0.06543438136577606, - 0.020044002681970596, - 0.058892060071229935, - 0.007617275230586529, - 0.029604831710457802, - 0.03405489772558212, - 0.03134297952055931, - -0.03529246523976326, - 0.03795549273490906, - 0.05348770320415497, - -0.013617906719446182, - -0.023200934752821922, - -0.008218797855079174, - -0.07394052296876907, - -0.03715420141816139, - 0.03513087332248688, - 0.042058855295181274, - 0.02620420604944229, - -0.06755802035331726, - 0.051118962466716766, - 0.010394330136477947, - -0.01278259139508009, - -0.00993038434535265, - 0.0308558139950037, - 0.07252795249223709, - 0.0220127385109663, - 0.0040824562311172485, - 0.0007463103393092752, - 0.023339498788118362, - -0.04487890377640724, - 0.026373937726020813, - 0.029762372374534607, - 0.003174752928316593, - 0.05934774503111839, - 0.03287826105952263, - 0.01308290846645832, - 0.06781511008739471, - 0.018234537914395332, - 0.01754545234143734, - 0.024301989004015923, - -0.05530458316206932, - 0.003774075536057353, - 0.02744685858488083, - -0.017314990982413292, - -0.08081077039241791, - -0.007002068683505058, - -0.07323342561721802, - -0.008447838015854359, - 0.04069642350077629, - -0.00932642724364996, - 0.032204050570726395, - -0.00659560551866889, - -0.004949540831148624, - -0.02603483945131302, - -0.029398318380117416, - -0.00928314495831728, - -0.02196144126355648, - 0.0018301015952602029, - -0.007904422469437122, - 0.0005092105711810291, - -0.07140916585922241, - -0.028058307245373726, - 0.03277812525629997, - -0.0073942504823207855, - -0.021603990346193314, - 0.09109500795602798, - 0.04317895695567131, - -0.016631418839097023, - -0.0802907720208168, - 0.008370758965611458, - -0.02433626353740692, - 0.013590562157332897, - 0.003019334515556693, - -0.052900638431310654, - -0.073338083922863, - 0.04442112147808075, - -0.010397600010037422, - -0.05481649190187454, - -0.024806730449199677, - 0.10984454303979874, - 0.039040643721818924, - 0.03666280210018158, - 0.013606199063360691, - -4.474953675526194e-05, - -0.01899411343038082, - 0.028372451663017273, - -0.0366457924246788, - 0.04137153550982475, - -0.00868742261081934, - 0.027902977541089058, - 0.04342607408761978, - -0.03017544187605381, - 0.002932980889454484, - -0.04826977103948593, - -0.02434515953063965, - -0.033879395574331284, - 0.010302910581231117, - -0.007286563515663147, - 0.07326517254114151, - 0.0401037260890007, - 0.00558432936668396, - -0.02631591446697712, - -0.000430387444794178, - -0.022164100781083107, - 0.004628400783985853, - -0.04068613424897194, - -0.015566384419798851, - 0.08617117255926132, - -0.0487537607550621, - -0.022408289834856987, - -0.006024583242833614, - 0.012579495087265968, - -0.007532813120633364, - 0.07973145693540573, - 0.06485648453235626, - 0.06120056286454201, - -0.0015694869216531515, - -0.024317918345332146, - -0.005312913563102484, - -0.030282847583293915, - 0.06815768778324127, - 0.0005326768732629716, - 0.0437849722802639, - -0.03810121864080429, - -0.005814483854919672, - -0.011266049928963184, - 0.10280797630548477, - 0.09189777076244354, - 0.021702326834201813, - -0.01264349464327097, - -0.028053050860762596, - 0.0009793220087885857, - -0.046445831656455994, - 0.0693051740527153, - -0.015621641650795937, - 8.636848360765725e-05, - 0.009677271358668804, - -0.04253571107983589, - -0.011456023901700974, - -0.058752208948135376, - -0.03249485790729523, - -0.01490005012601614, - 0.03026410937309265, - 0.014004429802298546, - -0.02266060560941696, - -0.021907877177000046, - 0.030311493203043938, - -0.010963384062051773, - -0.012667308561503887, - -0.031494732946157455, - 0.043011706322431564, - 0.019058914855122566, - -0.004501202143728733, - 0.01105163712054491, - -0.008308482356369495, - -0.060747940093278885, - 0.044928859919309616, - -0.11178917437791824, - -0.0014098059618845582, - 0.019301043823361397, - -0.04920295253396034, - 0.03295876830816269, - 0.029633186757564545, - 0.06770920008420944, - 0.015124795027077198, - 0.09169171005487442, - -0.02905994839966297, - 0.0034027236979454756, - 0.058476828038692474, - -0.01005456130951643, - -0.000158376875333488, - 0.003879532217979431, - -0.0301961712539196, - 0.05183778703212738, - 0.03158417344093323, - 0.002626537811011076, - -0.008326602168381214, - -0.06113799661397934, - -0.01786169223487377, - -0.0467352531850338, - 0.02326657436788082, - 2.3656717281122993e-33, - -0.028677860274910927, - 0.035635240375995636, - -0.028387198224663734, - -0.02743438258767128, - 0.01527384389191866, - -0.0385129451751709, - -0.020854907110333443, - -0.04454478994011879, - 0.007244074251502752, - -0.037942759692668915, - -0.08042734861373901, - 0.025716230273246765, - 0.025182103738188744, - 0.01697814278304577, - 0.006972965318709612, - 0.020797614008188248, - -0.00627667224034667, - -0.05542205646634102, - -0.0016238264506682754, - 0.012916574254631996, - -0.0018291305750608444, - 0.03003619611263275, - -0.014940589666366577, - 0.07038909196853638, - 0.05979009345173836, - 0.02160404436290264, - 0.014286847785115242, - -0.02266489341855049, - 0.05753885209560394, - -0.010777927935123444, - -0.009603074751794338, - 0.01375708170235157, - -0.03780260682106018, - 0.008290859870612621, - -0.05461787059903145, - 0.03700285032391548, - -0.004294147714972496, - -0.02837003581225872, - -0.023846115916967392, - 0.004466034006327391, - -0.019744660705327988, - -0.002924225525930524, - 0.04026307165622711, - 0.028615031391382217, - 0.044976864010095596, - -0.05278722941875458, - 5.385118129197508e-06, - -0.02870515175163746, - -0.024521712213754654, - 0.027570443227887154, - 0.016013355925679207, - 0.011553388088941574, - -0.012581265531480312, - 0.03274144232273102, - 0.02516329102218151, - -0.009276021271944046, - 0.029599158093333244, - -0.04184763506054878, - -0.03631838411092758, - -0.025860074907541275, - -0.003001891076564789, - -0.08493314683437347, - 0.02952473610639572, - 0.08161576092243195, - 0.0402715839445591, - -0.034087732434272766, - -0.08007760345935822, - -0.043079786002635956, - 0.08720294386148453, - -0.05059853568673134, - 0.0052619255147874355, - 0.010319202207028866, - 0.037685833871364594, - -0.007552167866379023, - 0.014637826941907406, - -0.0011432747123762965, - 0.005868519656360149, - 0.012429840862751007, - 0.010196229442954063, - 0.028840765357017517, - -0.006264987867325544, - 0.04905891418457031, - -0.06319470703601837, - 0.01260288991034031, - 0.014913097955286503, - -0.009293897077441216, - 0.003462578170001507, - 0.0001805968931876123, - 0.008305804803967476, - 0.008070412091910839, - -0.018847357481718063, - -0.0034087190870195627, - 0.07513313740491867, - 0.0014054011553525925, - 0.01277135219424963, - 0.038170233368873596, - -0.01808798313140869, - 0.0065773604437708855, - 0.013279357925057411, - 0.0018370486795902252, - 0.051548149436712265, - 0.024498948827385902, - -0.03463633731007576, - -0.005185497924685478, - 0.0014672870747745037, - 0.023402143269777298, - 0.06215527281165123, - -0.022442664951086044, - 0.0010364061454311013, - -0.03231532499194145, - 0.010091062635183334, - 0.03819097951054573, - -0.004580085631459951, - -0.020236315205693245, - 0.019944457337260246, - -0.0027927355840802193, - 0.038903381675481796, - -0.01039612852036953, - -0.11939845234155655, - 0.06172969192266464, - 0.04095638543367386, - -0.03659221529960632, - 0.04535942152142525, - 0.06896329671144485, - 0.011177311651408672, - -0.0039002778939902782, - 0.012844162993133068, - 0.025989897549152374, - -0.056616488844156265, - 0.003058888716623187, - 0.00906009878963232, - -0.04173022136092186, - 0.04562085494399071, - -0.02005867473781109, - -0.054382164031267166, - 0.007389802020043135, - 0.008663522079586983, - -0.03430453687906265, - -0.002784421667456627, - -0.0856945812702179, - -0.0036015009973198175, - -0.018625305965542793, - -0.023886365815997124, - 0.022476352751255035, - -0.01651320420205593, - -0.017765920609235764, - 0.06964459270238876, - -0.012316765263676643, - 0.05442800000309944, - -0.04688715189695358, - -0.010295277461409569, - 0.00968359224498272, - -0.026274345815181732, - 0.046209417283535004, - -0.05714612454175949, - -0.02214876003563404, - 0.021787982434034348, - 0.05518588796257973, - 0.01059794519096613, - 0.03816456347703934, - 0.006303540430963039, - -0.003514328505843878, - -0.03439072519540787, - 0.0773424580693245, - 0.028778867796063423, - -0.042821235954761505, - 0.010553059168159962, - -0.020202763378620148, - 0.02343585714697838, - -0.011736290529370308, - 0.043159857392311096, - 0.003763687564060092, - 0.012779084034264088, - 0.023794421926140785, - 0.03339771553874016, - -0.0394255705177784, - 0.0636887177824974, - -0.03930488973855972, - -0.042592719197273254, - -0.013996570371091366, - -0.07885351777076721, - -0.06991739571094513, - 0.011072161607444286, - -0.06076990067958832, - 0.023256590589880943, - -0.0019119804492220283, - -0.036017946898937225, - -0.018028782680630684, - 0.02710127644240856, - 0.029161972925066948, - 0.003853263333439827, - 0.029943156987428665, - 0.034356772899627686, - 0.015962539240717888, - -0.03488188609480858, - -0.032041653990745544, - 0.05547862499952316, - -0.06453918665647507, - -0.023464346304535866, - 0.03936050087213516, - 0.011054802685976028, - 0.000932927883695811, - 0.030312173068523407, - -0.017649976536631584, - -0.05459408089518547, - -0.005230151582509279, - -0.017772700637578964, - -0.053355395793914795, - 0.04476327821612358, - -0.034560006111860275, - -0.01259594690054655, - -0.003704596543684602, - 0.024273045361042023, - -0.01055475790053606, - -0.0007581421523354948, - 0.0003091568360105157, - -0.0030861031264066696, - 0.026297489181160927, - 0.01657555066049099, - -0.04986121132969856, - 0.002020491985604167, - -0.026467733085155487, - -0.011071037501096725, - 0.010809422470629215, - 0.04629097506403923, - 0.022463776171207428, - -0.0068094185553491116, - -0.00203889817930758, - -0.011706141754984856, - -0.015448829159140587, - -0.05611571669578552, - -0.003946317359805107, - 0.009573496878147125, - -0.0691712275147438, - 0.011461438611149788, - 0.026747412979602814, - 0.06403791159391403, - 0.08264223486185074, - 0.08029738068580627, - 0.027380097657442093, - -0.031971849501132965, - 0.031938254833221436, - -0.009089910425245762, - 0.005243627354502678, - 0.00019165391859132797, - 0.01904524303972721, - 0.03720887377858162, - 0.008953647688031197, - -0.0382532924413681, - -0.057662513107061386, - -0.010122004896402359, - 0.0056761158630251884, - -0.008714662864804268, - 0.041868068277835846, - -0.06813554465770721, - -0.02996354177594185, - 0.0026129817124456167, - 0.019943125545978546, - -0.012777391821146011, - -0.07619009912014008, - -0.0056306361220777035, - 0.011548282578587532, - 0.037620220333337784, - -0.059756286442279816, - 0.006323606241494417, - -0.008257483132183552, - 0.04157789424061775, - 0.029362956061959267, - -0.018854595720767975, - -0.0098319286480546, - 0.04549318179488182, - -0.005879865027964115, - 0.03167739510536194 - ], - "img_vector": [ - 1.4938853979110718, - 0.24139609932899475, - 1.131054162979126, - 0.1810753047466278, - 0.3637487590312958, - 0.6875102519989014, - 2.0224709510803223, - 0.2941369116306305, - 1.8726948499679565, - 2.7465879917144775, - 0.44412121176719666, - 0.6346420645713806, - 0.9876911640167236, - 0.821234405040741, - 0.005170317832380533, - 0.7949967384338379, - 0.04615236446261406, - 0.8767532706260681, - 0.3433084189891815, - 0.30413225293159485, - 0.8994442820549011, - 0.48238420486450195, - 1.8604705333709717, - 0.9210008382797241, - 0.40842205286026, - 0.28850340843200684, - 0.7270486950874329, - 1.154633641242981, - 0.6082801222801208, - 0.6392159461975098, - 0.28570401668548584, - 0.435669481754303, - 0.8858022689819336, - 1.973506212234497, - 0.5675477981567383, - 0.008614929392933846, - 1.1604024171829224, - 0.4109009802341461, - 1.3524186611175537, - 0.017363978549838066, - 0.024865763261914253, - 0.012908240780234337, - 0.004678706638514996, - 0.4119618833065033, - 0.2732241153717041, - 0.14510616660118103, - 0.6660646200180054, - 0.1148010641336441, - 0.2920435070991516, - 0.36072251200675964, - 1.2710176706314087, - 2.8436989784240723, - 0.5273248553276062, - 0.22220788896083832, - 2.2567269802093506, - 0.3823893666267395, - 0.038808539509773254, - 1.3385392427444458, - 1.2586040496826172, - 0.18111984431743622, - 0.047796864062547684, - 0.34817439317703247, - 0.018567292019724846, - 0.38849329948425293, - 0.16486267745494843, - 0.041021160781383514, - 0.28197813034057617, - 0.07154709845781326, - 0.5517598390579224, - 0.015888085588812828, - 0.3470703959465027, - 2.2582666873931885, - 0.38925793766975403, - 0.014621037989854813, - 1.105770230293274, - 0.41556447744369507, - 1.5077919960021973, - 0.5181179642677307, - 0.9355340003967285, - 0.12701475620269775, - 0.33716854453086853, - 3.8470511436462402, - 1.6164942979812622, - 0.061706479638814926, - 0.8683338761329651, - 0.027707582339644432, - 0.013184858486056328, - 0.41109007596969604, - 0.1106315404176712, - 0.24017579853534698, - 0.17355728149414062, - 0.352239727973938, - 0.4978903532028198, - 0.55988609790802, - 0.8547915816307068, - 1.1907637119293213, - 1.5348354578018188, - 0.09794571995735168, - 0.6044095158576965, - 0.013331381604075432, - 0.2327936738729477, - 2.221573829650879, - 0.1726379543542862, - 0.020145928487181664, - 0.42134132981300354, - 4.763510227203369, - 0.7185640335083008, - 0.03154059499502182, - 0.11734503507614136, - 3.1852903366088867, - 0.4653855264186859, - 0.48472750186920166, - 0.6504601240158081, - 1.880314826965332, - 0.20760998129844666, - 0.7506809830665588, - 0.5027838945388794, - 5.558551788330078, - 0.33432015776634216, - 0.06906022131443024, - 0.4678272604942322, - 1.2655304670333862, - 0.36804652214050293, - 0.0999298021197319, - 0.8990201950073242, - 0.0651337206363678, - 1.3693125247955322, - 0.7462950944900513, - 0.5252841114997864, - 0.8934602737426758, - 0.20053251087665558, - 1.745174765586853, - 0.2621590495109558, - 0.9130530953407288, - 0.22606196999549866, - 0.12764430046081543, - 1.4584379196166992, - 0.2747681438922882, - 0.9977239370346069, - 0.39415714144706726, - 0.9975500106811523, - 0.4457828402519226, - 0.49890264868736267, - 1.9690587520599365, - 1.1663585901260376, - 0.11856219172477722, - 0.06459268927574158, - 1.2313330173492432, - 0.15239554643630981, - 0.6989741325378418, - 0.4055025577545166, - 0.4913269281387329, - 0.9282734394073486, - 0.03393394872546196, - 0.0512971356511116, - 0.5724825263023376, - 0.6229320764541626, - 0.9174453020095825, - 0.18941769003868103, - 0.3969208896160126, - 2.7637522220611572, - 0.06034400686621666, - 0.1047993078827858, - 3.865389823913574, - 2.578909158706665, - 0.27485260367393494, - 0.77419513463974, - 2.0994646549224854, - 0.01585269160568714, - 0.9283961057662964, - 2.1078855991363525, - 0.020171815529465675, - 0.23450171947479248, - 0.2272941768169403, - 2.726775884628296, - 0.025467712432146072, - 0.0018708937568590045, - 0.3761393129825592, - 0.34419262409210205, - 0.9711661338806152, - 1.0305192470550537, - 0.39461660385131836, - 0.2857527732849121, - 0.46718448400497437, - 0.12061874568462372, - 0.23161852359771729, - 0.653630256652832, - 0.9762458205223083, - 0.03882816433906555, - 0.27001580595970154, - 2.286098003387451, - 0.010140842758119106, - 1.219992995262146, - 0.31628432869911194, - 0.05897148326039314, - 0.3317827880382538, - 0.654693067073822, - 0.792682409286499, - 0.4212881922721863, - 0.43955570459365845, - 0.050201479345560074, - 1.6883554458618164, - 0.8914614319801331, - 0.0, - 0.5062851309776306, - 0.20334354043006897, - 2.482614040374756, - 0.60190349817276, - 0.0857115387916565, - 0.2626751959323883, - 0.3886306583881378, - 0.5596953630447388, - 0.0034243050031363964, - 0.40611380338668823, - 0.048733681440353394, - 0.015632936730980873, - 1.7728796005249023, - 0.31308096647262573, - 0.05932054668664932, - 0.9837939739227295, - 0.3693715035915375, - 0.22048570215702057, - 0.917412519454956, - 0.8713879585266113, - 0.0006016638944856822, - 0.422598659992218, - 0.46377313137054443, - 0.12921059131622314, - 0.1378568708896637, - 0.043600354343652725, - 0.9465663433074951, - 1.4301570653915405, - 0.10690557956695557, - 0.019444884732365608, - 0.31817561388015747, - 0.0974576398730278, - 0.4335589110851288, - 1.4914262294769287, - 0.12609821557998657, - 0.7752360105514526, - 0.557702362537384, - 0.12304127216339111, - 3.187499761581421, - 0.4694543182849884, - 0.010506571270525455, - 0.25651559233665466, - 0.02736404724419117, - 0.6649688482284546, - 4.431206226348877, - 0.1988416165113449, - 0.7556383609771729, - 0.49852967262268066, - 0.9520439505577087, - 0.06960975378751755, - 0.48046889901161194, - 1.8312454223632812, - 0.07900815457105637, - 1.7756098508834839, - 0.18784523010253906, - 0.040981557220220566, - 0.7334564924240112, - 3.4111926555633545, - 0.0393139012157917, - 0.8263912796974182, - 0.1573135256767273, - 0.1513597071170807, - 0.34052351117134094, - 0.8103253841400146, - 0.655732274055481, - 2.249526262283325, - 0.10419811308383942, - 0.25299787521362305, - 0.6740222573280334, - 1.9716986417770386, - 0.6432756185531616, - 0.21635928750038147, - 1.57355797290802, - 0.25777941942214966, - 2.203857660293579, - 0.9070361256599426, - 1.1828185319900513, - 0.7377543449401855, - 0.7369240522384644, - 0.2669963538646698, - 2.9789092540740967, - 0.3545466959476471, - 0.13611581921577454, - 0.8029289245605469, - 0.8413907885551453, - 0.9169182181358337, - 0.34259486198425293, - 0.07380985468626022, - 0.5203127264976501, - 1.7527437210083008, - 0.34951314330101013, - 0.3516063988208771, - 0.6289893984794617, - 0.7310518622398376, - 1.2737241983413696, - 0.2716093957424164, - 4.232484817504883, - 0.9968029856681824, - 0.1278645396232605, - 0.003290054854005575, - 0.34459924697875977, - 0.02537645399570465, - 3.4949543476104736, - 0.059621650725603104, - 0.5571537613868713, - 0.3231731355190277, - 0.256262868642807, - 2.179823637008667, - 0.22787992656230927, - 0.13078656792640686, - 0.7623313069343567, - 0.16983948647975922, - 1.3611606359481812, - 0.0351678729057312, - 1.012725830078125, - 1.0911778211593628, - 0.13410203158855438, - 1.419508934020996, - 1.6845264434814453, - 0.021370956674218178, - 0.6053026914596558, - 0.09465710073709488, - 0.3254464864730835, - 0.45975276827812195, - 0.2243175506591797, - 0.18977338075637817, - 0.014142055995762348, - 0.011168931610882282, - 1.0240275859832764, - 1.1688612699508667, - 0.4141140878200531, - 0.3918728828430176, - 0.3855869472026825, - 0.11653701961040497, - 0.014498773962259293, - 1.3883904218673706, - 0.09559828788042068, - 1.9660215377807617, - 0.6778882145881653, - 1.0829894542694092, - 0.06397857517004013, - 0.01732052117586136, - 1.1504909992218018, - 1.3759924173355103, - 0.0627686083316803, - 0.42889153957366943, - 0.430999755859375, - 0.8407799601554871, - 0.07544046640396118, - 0.4796835482120514, - 0.5401620864868164, - 0.5974308848381042, - 2.0423712730407715, - 2.3662736415863037, - 0.1360752284526825, - 0.12918895483016968, - 1.2664458751678467, - 1.603205919265747, - 2.5599873065948486, - 1.6732289791107178, - 1.0271077156066895, - 0.18132364749908447, - 0.8940284252166748, - 0.8279848098754883, - 2.0483574867248535, - 2.041257858276367, - 0.09561240673065186, - 0.7693163156509399, - 0.025312675163149834, - 2.3041818141937256, - 1.809356689453125, - 0.32985764741897583, - 0.14901605248451233, - 0.8835480213165283, - 0.12754516303539276, - 1.3410577774047852, - 0.4222751557826996, - 0.6922367811203003, - 0.5369821786880493, - 0.3105478882789612, - 0.0, - 0.18506155908107758, - 1.130815029144287, - 1.971065640449524, - 0.4446471929550171, - 0.2073221057653427, - 1.4708002805709839, - 1.0431690216064453, - 0.1379164755344391, - 0.043842341750860214, - 0.28658008575439453, - 0.06018945947289467, - 0.09314017742872238, - 0.7134373784065247, - 2.0590012073516846, - 0.25134992599487305, - 0.43295997381210327, - 0.3844310939311981, - 0.315731942653656, - 1.2644526958465576, - 0.30650633573532104, - 0.0024292347952723503, - 1.6356632709503174, - 0.7341170310974121, - 0.2436022311449051, - 0.8456516861915588, - 0.08483622223138809, - 0.7762656807899475, - 0.9089807271957397, - 0.03320164978504181, - 0.7838379144668579, - 1.3481323719024658, - 1.283592700958252, - 1.1046751737594604, - 0.3032504916191101, - 0.8944272994995117, - 0.04955345392227173, - 0.8805413246154785, - 0.2880385220050812, - 0.6145410537719727, - 0.6912974715232849, - 0.1930430680513382, - 0.26780593395233154, - 0.9327908158302307, - 0.2276986986398697, - 3.0140249729156494, - 0.4428110718727112, - 1.1905831098556519, - 0.9928894639015198, - 1.0988762378692627, - 0.45524975657463074, - 0.3587692677974701, - 0.3822312355041504, - 0.323091983795166, - 0.8857821226119995, - 0.11823158711194992, - 1.062369465827942, - 0.3242979943752289, - 1.2425428628921509, - 0.025485660880804062, - 0.15931929647922516, - 0.8871098160743713, - 0.06915843486785889, - 0.2272469848394394, - 1.2359329462051392, - 0.010372296907007694, - 0.038248494267463684, - 0.03228116035461426, - 0.3128824532032013, - 0.4886026978492737, - 0.5953666567802429, - 0.9679567813873291, - 0.20759081840515137, - 0.6370733380317688, - 0.21096189320087433, - 0.2741597294807434, - 0.17469191551208496, - 0.5566078424453735, - 0.8737033009529114, - 0.7346972823143005, - 0.15648745000362396, - 1.750422716140747, - 0.008586949668824673, - 0.5328765511512756, - 0.9480359554290771, - 0.6931679248809814, - 0.06247229501605034, - 0.42257705330848694, - 1.472716212272644, - 0.6056021451950073, - 0.30037182569503784, - 1.1690608263015747, - 0.46925121545791626, - 0.048942744731903076, - 0.8650917410850525, - 0.5276799201965332, - 0.032549455761909485, - 0.3601825535297394, - 0.02722950652241707, - 0.4794684052467346, - 2.2764618396759033, - 0.8081153035163879, - 1.1730848550796509, - 0.19443339109420776, - 0.24625937640666962, - 0.10062640905380249, - 0.16277572512626648, - 0.012864487245678902, - 0.501074492931366, - 0.9416172504425049, - 0.04482325166463852, - 0.008391566574573517, - 0.4685932993888855, - 0.024174371734261513, - 0.10270687192678452, - 0.23297233879566193, - 1.4293732643127441, - 0.1546536684036255, - 0.09302748739719391, - 2.2711963653564453, - 0.2795150578022003, - 0.44962161779403687, - 0.36339086294174194, - 0.4967893362045288, - 1.0447256565093994, - 0.8269402384757996, - 0.21591688692569733, - 0.0 - ], - "product_id": 56670, - "product_metadata": { - "name": "Maxima Men Black Dial Watch", - "gender": "Men", - "master_category": "Accessories", - "sub_category": "Watches", - "article_type": "Watches", - "base_color": "Black", - "season": "Winter", - "year": 2016, - "usage": "Casual", - "img_url": "http://assets.myntassets.com/v1/images/style/properties/Maxima-Men-Black-Dial-Watch_c427a05e5f1d545b2b03ad86b4960427_images.jpg" - } - }, - { - "text_vector": [ - 0.0183278638869524, - -0.08557531982660294, - -0.01639784686267376, - 0.02346842549741268, - -0.04447575658559799, - 0.035850800573825836, - 0.04396527633070946, - 0.07349296659231186, - 0.06268049776554108, - -0.05232634395360947, - 0.01782047562301159, - -0.010913203470408916, - -0.0025780205614864826, - -0.04168076068162918, - -0.03205004334449768, - 0.03464997932314873, - 0.06643923372030258, - 0.049483995884656906, - -0.019035475328564644, - -0.015559760853648186, - 0.046482060104608536, - 0.04973935708403587, - 0.011547323316335678, - 0.07074014097452164, - 0.04821221902966499, - 0.0037262572441250086, - 0.019987130537629128, - -0.020384570583701134, - 0.020874228328466415, - 0.04923732578754425, - -0.042636942118406296, - -0.049207255244255066, - 0.023372309282422066, - 0.003453217912465334, - -0.0434214323759079, - -0.01994912326335907, - 0.038452908396720886, - -0.01601421646773815, - 0.07969017326831818, - 0.018299682065844536, - 0.040694329887628555, - -0.003977510612457991, - 0.06727933883666992, - -0.009639446623623371, - -0.009918653406202793, - 0.003530436661094427, - -0.002863094210624695, - 0.019610032439231873, - 0.0017718904418870807, - -0.05626828968524933, - -0.007691100239753723, - -0.07202600687742233, - 0.022678975015878677, - -0.0051254089921712875, - -0.024634385481476784, - 0.038630977272987366, - 0.012301089242100716, - -0.004852581769227982, - 0.008163674734532833, - 0.01873301900923252, - -0.0006467404309660196, - 0.10083527117967606, - 0.0007773932884447277, - 0.03311818465590477, - 0.027676159515976906, - -0.0062120272777974606, - -0.005190867930650711, - 0.014215715229511261, - -0.0347461961209774, - 0.03389207273721695, - -0.0039015512447804213, - 0.007164570037275553, - -0.027584699913859367, - 0.015538237988948822, - 0.006798513233661652, - -0.021373944357037544, - 0.053439244627952576, - -0.05118982121348381, - -0.09986051917076111, - -0.0218923669308424, - 0.015403950586915016, - 0.04642897844314575, - 0.007986582815647125, - 0.017908059060573578, - -0.06790448725223541, - -0.024380648508667946, - -0.01766284368932247, - -0.0036361345555633307, - -0.06017634645104408, - -0.001904766191728413, - 0.022068344056606293, - -0.10214364528656006, - -0.03226622939109802, - 0.006078142207115889, - 0.01945854164659977, - 0.02628893032670021, - -0.07679011672735214, - -0.045392852276563644, - 0.017468782141804695, - -0.07918298989534378, - 0.0008098791004158556, - -0.0304928719997406, - 0.002669526496902108, - -0.01702047325670719, - -0.05188878998160362, - 0.023659242317080498, - -0.025324003770947456, - 0.01083297561854124, - -0.019688740372657776, - -0.05325676128268242, - -0.027245057746767998, - 0.05770793557167053, - -0.0052609313279390335, - -0.0018099457956850529, - -0.003693910548463464, - 0.047722071409225464, - -0.0069903600960969925, - 0.05359112471342087, - -0.05140037462115288, - 0.05183808133006096, - 0.02641567401587963, - -0.007837040349841118, - -0.04235898703336716, - -0.04416070878505707, - 0.0353168286383152, - -0.01782234199345112, - -0.037064097821712494, - 0.02082264982163906, - 0.013730335049331188, - -0.008474173955619335, - -0.01846110261976719, - -0.03494376689195633, - 0.023081665858626366, - 0.043478671461343765, - 0.003958097193390131, - 0.031230289489030838, - 0.025325477123260498, - -0.015049143694341183, - -0.02230280637741089, - -0.04863940551877022, - -0.045947469770908356, - -0.07384620606899261, - 0.017736878246068954, - -0.004012310411781073, - 0.015916733071208, - -0.028816791251301765, - -0.01459841150790453, - 0.056307412683963776, - 0.0060439808294177055, - -0.056439127773046494, - -0.02268831804394722, - -0.03475048765540123, - 0.023143576458096504, - -0.0036008995957672596, - 0.023789923638105392, - 0.01669148914515972, - -0.033186133950948715, - -0.017886793240904808, - 0.09095565974712372, - 0.0009061623713932931, - -0.021965282037854195, - -0.07721830904483795, - 0.010647841729223728, - 0.001766208908520639, - 0.08275290578603745, - -0.013540989719331264, - -0.004876506049185991, - -0.006270037032663822, - -0.022532612085342407, - 0.001430183183401823, - -0.001404542475938797, - -0.04240868613123894, - 0.057646043598651886, - -0.05380043759942055, - 0.014124871231615543, - 0.040167201310396194, - -0.07077403366565704, - 0.016488434746861458, - 0.0006785857258364558, - -0.014187758788466454, - -0.07296887040138245, - 0.01701742224395275, - 0.02996133081614971, - 0.02202329784631729, - -0.007949523627758026, - 0.023809589445590973, - -0.03564988449215889, - 0.004810665734112263, - 0.0035483166575431824, - -0.009615768678486347, - 0.029309237375855446, - 0.04389377683401108, - -0.03922554850578308, - 0.03115563467144966, - -0.043333422392606735, - 0.03735969960689545, - -0.007226571906358004, - 0.004127812571823597, - 0.008898481726646423, - -0.0020907025318592787, - 0.009935172274708748, - -0.033700309693813324, - 0.023371247574687004, - -0.04550548270344734, - -0.0717545822262764, - -0.015112417750060558, - -0.036551591008901596, - 0.03087913803756237, - -0.0008238752488978207, - -0.001402894500643015, - -0.03456311672925949, - -0.023418618366122246, - -0.022316111251711845, - -0.0235427375882864, - 0.014887372963130474, - -0.04081474244594574, - 0.04530085250735283, - 0.06676586717367172, - -0.013828451745212078, - 0.016807598993182182, - -0.02406356856226921, - -0.005335431545972824, - -0.038991235196590424, - -0.022143058478832245, - -0.01861720345914364, - 0.019817745313048363, - 0.00241735577583313, - -0.012944117188453674, - -0.00899256020784378, - 0.036388177424669266, - -0.00045292743016034365, - -0.006683987099677324, - -0.03843281790614128, - -0.00955294631421566, - 0.030964065343141556, - -0.041956111788749695, - -0.05463062971830368, - -0.017400117591023445, - -0.022869423031806946, - 0.051699500530958176, - -0.0028473087586462498, - -0.02147676981985569, - 0.016629185527563095, - -0.0319463349878788, - 0.021846825256943703, - 0.014299665577709675, - 0.021350925788283348, - 0.02076391503214836, - -0.025106074288487434, - 0.059485774487257004, - 0.003144617425277829, - -0.019444499164819717, - -0.04235118627548218, - 0.0006749371532350779, - -0.08672863990068436, - 0.03704950585961342, - -0.04926178231835365, - 0.00622361758723855, - 0.03626594319939613, - 0.04405701160430908, - -0.005693275947123766, - -0.02023283950984478, - -0.05406714603304863, - 0.09144704043865204, - 0.008654670789837837, - 0.03185208886861801, - -0.03148077055811882, - -0.009005228988826275, - 0.03972728177905083, - 0.019106104969978333, - -0.03981325030326843, - -0.06340786069631577, - -0.014576331712305546, - -0.005337414797395468, - -0.010596995241940022, - -0.030954644083976746, - 0.09982352703809738, - 0.007078897673636675, - -0.021051088348031044, - 0.024343246594071388, - 0.0020763680804520845, - 0.05401410534977913, - 0.010327691212296486, - -0.025604575872421265, - 0.04889039695262909, - -0.03063907101750374, - -0.011179237626492977, - -0.0193896796554327, - -0.027571510523557663, - 0.01210660021752119, - -0.017734237015247345, - 0.04110557585954666, - 0.023082200437784195, - 0.0008907023584470153, - -0.030391687527298927, - -0.02104724571108818, - 0.05938413366675377, - 0.041880980134010315, - -0.006360464729368687, - 0.08025448024272919, - 0.020168988034129143, - 0.0013118934584781528, - -0.01829085312783718, - -0.020459318533539772, - 0.016080301254987717, - 0.0030012307688593864, - 0.000928244087845087, - 0.0014508015010505915, - 0.03850356861948967, - 0.04154375568032265, - -0.0161654744297266, - 0.05430403724312782, - 0.008814945816993713, - -0.03591149300336838, - 0.033305052667856216, - 0.03716545179486275, - 0.01825706474483013, - 0.04709524288773537, - 0.04102051630616188, - 0.019658399745821953, - -0.014208444394171238, - -0.006376851350069046, - 0.024370254948735237, - -0.007813869044184685, - -0.08648600429296494, - -0.03403620049357414, - 0.0291670560836792, - -0.03849663585424423, - 0.02369462512433529, - 0.048108212649822235, - 0.001878133974969387, - -0.03508971631526947, - 0.04280194267630577, - -0.03333287686109543, - -0.02177763544023037, - 0.010671540163457394, - 0.03972479701042175, - 0.079188771545887, - 0.03148414567112923, - 0.015064163133502007, - 0.030877413228154182, - 0.02366682142019272, - 0.034263741225004196, - 0.05088524520397186, - 0.026368098333477974, - 0.05606093630194664, - 0.07373474538326263, - -0.013078629970550537, - -0.019298873841762543, - 0.006265813019126654, - -0.03107643686234951, - -0.014144562184810638, - 0.02006424590945244, - 0.008283165283501148, - 0.010316642932593822, - 0.024152543395757675, - -0.03197363018989563, - -0.0028969983104616404, - -0.0047971042804419994, - -0.03117867186665535, - -0.00183815136551857, - 0.07147055119276047, - -0.008389076218008995, - 0.027554942294955254, - 0.010166490450501442, - -0.015292402356863022, - -0.02464534528553486, - 0.015069207176566124, - 0.026128362864255905, - 0.015938591212034225, - -0.010175530798733234, - -0.061801254749298096, - 0.007945163175463676, - 0.002627711743116379, - -0.04717644676566124, - -0.0017786540556699038, - -0.0020174700766801834, - -0.010545131750404835, - 0.014068122953176498, - 0.005539966747164726, - 0.02624160423874855, - -0.04852340370416641, - 0.0028258308302611113, - -0.002228067023679614, - 0.04166064411401749, - 0.034450408071279526, - -0.03978258743882179, - -0.07826315611600876, - -0.003705840790644288, - -0.061387766152620316, - -0.045448776334524155, - -0.007163676433265209, - 0.07734742760658264, - 0.023851439356803894, - 0.07986956089735031, - 0.024746689945459366, - -0.021377716213464737, - 0.03548015281558037, - -0.08263780176639557, - -0.0277362372726202, - 0.011457042768597603, - 0.008104542270302773, - 0.007727656047791243, - 0.06961733847856522, - -0.05583324283361435, - 0.014991270378232002, - 0.00823261309415102, - -0.04660917446017265, - -0.036464858800172806, - -0.020868748426437378, - 0.006777886301279068, - 0.0660518929362297, - 0.01308445818722248, - -0.02211332879960537, - -0.015200594440102577, - -0.007794510573148727, - -0.047047097235918045, - -0.08564605563879013, - -0.047107893973588943, - -0.029468640685081482, - 0.040037255734205246, - -0.03159831836819649, - 0.014037721790373325, - -0.00274373940192163, - 0.04860607907176018, - -0.015040924772620201, - 0.0298844613134861, - 0.07683723419904709, - 0.07795288413763046, - 0.04357053339481354, - 0.06872818619012833, - 0.012610365636646748, - -0.00020954801584593952, - 0.052484605461359024, - 0.025141775608062744, - 0.022129308432340622, - -0.040230926126241684, - -0.0014727351954206824, - -0.023774106055498123, - 0.08647941052913666, - 0.02003561146557331, - 0.016207056120038033, - 0.008097137324512005, - -0.04444299638271332, - -0.0205804705619812, - -6.753311754437163e-05, - -0.03338799625635147, - -0.008887667208909988, - 0.006482749246060848, - -0.019602617248892784, - 0.00030552534735761583, - 0.006111313123255968, - -0.09385306388139725, - -0.0650624930858612, - -0.03251264989376068, - 0.008160965517163277, - -0.002608125563710928, - -0.012109663337469101, - 0.011094792746007442, - 0.015582113526761532, - 0.04694809392094612, - 0.025582890957593918, - -0.012976945377886295, - 0.05071472004055977, - 0.05287140980362892, - -0.015838878229260445, - 0.012026030570268631, - 0.018277378752827644, - -0.021923229098320007, - 0.05436006560921669, - -0.11034297198057175, - 0.015374805778265, - 0.016437843441963196, - -0.00805028434842825, - -0.006506892386823893, - -0.017801426351070404, - 0.0350545197725296, - -0.049973901361227036, - 0.06945165246725082, - 0.0012498819269239902, - 0.01967363990843296, - 0.030175890773534775, - -0.0016369972145184875, - -0.01644076593220234, - 0.017056699842214584, - 0.0204275194555521, - 0.07796315848827362, - 0.0574352853000164, - -0.0048292456194758415, - -0.0017676736460998654, - -0.03185370936989784, - -0.07346700876951218, - -0.022038593888282776, - 0.054246850311756134, - 2.630661399237252e-33, - -0.0007876625168137252, - 0.024711377918720245, - 0.028263453394174576, - 0.038497671484947205, - -0.029503747820854187, - -0.047779832035303116, - 0.027024542912840843, - -0.04133862257003784, - 0.03019760735332966, - -0.05125850811600685, - -0.03708714246749878, - -0.010080607607960701, - 0.02395099774003029, - 0.011153537780046463, - 0.022210044786334038, - -0.014929835684597492, - -0.007625039666891098, - -0.026731057092547417, - -0.018162613734602928, - 0.0027316773775964975, - 0.009445802308619022, - -0.01717906817793846, - 0.019089022651314735, - -0.034599725157022476, - 0.03478742018342018, - -0.02079869993031025, - 0.02117849700152874, - -0.06173408031463623, - 0.03535124287009239, - 0.010899416171014309, - 0.03210896626114845, - -0.010628988035023212, - -0.03593757003545761, - -0.0043421415612101555, - -0.029418103396892548, - -0.007072690408676863, - -0.012125442735850811, - -0.010493642650544643, - -0.004884706344455481, - 0.012880418449640274, - -0.005943458992987871, - -0.04631143808364868, - 0.009311030618846416, - 0.07077532261610031, - 0.028052758425474167, - -0.09242375195026398, - -0.017878223210573196, - -0.04087190330028534, - -0.016821548342704773, - 0.05323490872979164, - 0.00021553572150878608, - 0.04130404070019722, - 0.029101213440299034, - -0.051760025322437286, - -0.029906712472438812, - -0.06049632281064987, - -0.005484390538185835, - -0.051773373037576675, - -0.02513473853468895, - -0.02125566452741623, - -0.014477051794528961, - -0.016667108982801437, - -0.029735155403614044, - 0.0524720773100853, - 0.0007396599394269288, - -0.0011976333335042, - -0.04671988636255264, - 0.017543671652674675, - 0.04998365044593811, - -0.009093948639929295, - 0.014882790856063366, - 0.00451275147497654, - 0.02709638699889183, - 0.017909929156303406, - -0.012215646915137768, - 0.0008179382421076298, - -0.0028897193260490894, - 0.00221558241173625, - 0.02652423083782196, - 0.050282351672649384, - -0.027550380676984787, - 0.046289484947919846, - -0.025119272992014885, - 0.05534017086029053, - 0.02580244466662407, - 0.010825780220329762, - -0.029935935512185097, - -0.03239613398909569, - -0.016259482130408287, - 0.021613359451293945, - -0.04431892931461334, - 0.01939059980213642, - 0.03692196309566498, - 0.0017046730499714613, - 0.06082543730735779, - 0.015725329518318176, - -0.027240820229053497, - 0.027085622772574425, - -0.0014792821602895856, - 0.0014459468657150865, - -0.020813602954149246, - -0.028041385114192963, - 0.0074644493870437145, - 0.02541331946849823, - -0.04287080094218254, - -0.04085218906402588, - 0.05725620314478874, - -0.0540098138153553, - 0.01089746505022049, - -0.009697220288217068, - -0.01277137827128172, - 0.029663534834980965, - -0.01567397266626358, - -0.024037115275859833, - 0.06379303336143494, - -0.0073900227434933186, - -0.039371103048324585, - -0.039317891001701355, - -0.10873675346374512, - 0.03714684024453163, - 0.015304616652429104, - -0.01968245580792427, - 0.04670121148228645, - 0.07289005815982819, - 0.03822429105639458, - 0.01035313867032528, - 0.019634488970041275, - 0.03612896054983139, - 0.05256352201104164, - -0.01531135942786932, - -0.023911133408546448, - -0.011641415767371655, - -0.04562469199299812, - -0.008091451600193977, - -0.03973282873630524, - -0.03166692331433296, - 0.0014925437280908227, - -0.06351883709430695, - -0.03135763108730316, - 0.002445954829454422, - 0.01136980950832367, - 0.022742893546819687, - 0.01582394726574421, - 0.031666409224271774, - -0.03176821023225784, - 0.02061661332845688, - 0.053817179054021835, - -0.015443995594978333, - 0.06768088787794113, - 0.0074053918942809105, - 0.004379879217594862, - -0.018036995083093643, - -0.12984386086463928, - 0.02727270871400833, - -0.06884685903787613, - 0.011283721774816513, - -0.006410351488739252, - -0.028043102473020554, - -0.038576390594244, - 0.0052632298320531845, - 3.704463233589195e-05, - 0.01170535758137703, - -0.034052468836307526, - 0.06972618401050568, - -0.0429469533264637, - -0.014463698491454124, - 0.054797060787677765, - -0.05508837848901749, - 0.005999674089252949, - 0.016210054978728294, - 0.030394185334444046, - 0.018814437091350555, - 0.011458942666649818, - 0.04426871985197067, - 0.027860751375555992, - -0.012702488340437412, - -0.03550449013710022, - -0.03747827187180519, - -0.007686143275350332, - -0.04973191022872925, - -0.015470781363546848, - -0.013912172988057137, - -0.035679347813129425, - -0.030531924217939377, - 0.013484183698892593, - 0.0064904517494142056, - -0.030875712633132935, - 0.04948468133807182, - 0.024434955790638924, - 0.01664743386209011, - 0.032749395817518234, - 0.005831102840602398, - 0.040503863245248795, - -0.0005025852005928755, - -0.020523525774478912, - -0.0955122709274292, - 0.05944440886378288, - -0.033352334052324295, - -0.01684003695845604, - 0.0047449758276343346, - -0.00577123649418354, - -0.014752757735550404, - 0.024754028767347336, - -0.03983451798558235, - -0.08202291280031204, - 0.007593686692416668, - -0.034717198461294174, - -0.09975818544626236, - 0.03999767825007439, - -0.05505223944783211, - -0.013194091618061066, - -0.011484015733003616, - 0.0076688057743012905, - -0.0023846011608839035, - -0.0060723149217665195, - -0.009577409364283085, - 0.011585021391510963, - 0.031143374741077423, - -0.006865524686872959, - -0.0029354176949709654, - 0.05149368941783905, - 0.015403643250465393, - 0.003574015572667122, - 0.03942521661520004, - 0.044310469180345535, - 0.0051728361286222935, - -0.010609363205730915, - 0.00956270843744278, - -0.035416096448898315, - -0.03166976571083069, - -0.053787194192409515, - -0.031123487278819084, - 0.03769956901669502, - -0.0331074558198452, - 0.006905605085194111, - -0.010122079402208328, - 0.030096963047981262, - 0.05383354052901268, - -0.027785638347268105, - -0.004835939966142178, - -0.0017756444867700338, - 0.018264617770910263, - 0.010783819481730461, - 0.032456208020448685, - 0.010847573168575764, - 0.03318186476826668, - -0.01696695387363434, - 0.004460322670638561, - -0.046072281897068024, - -0.03778168931603432, - -0.04794727638363838, - 0.02768581733107567, - 0.00416526198387146, - 0.10537614673376083, - -0.06325893849134445, - 0.012257200665771961, - 0.013712717220187187, - 0.005633390508592129, - 0.021950235590338707, - -0.03449268639087677, - -0.022267812862992287, - -0.036758020520210266, - 0.09976556152105331, - -0.006236811634153128, - 0.031599245965480804, - -0.007543627172708511, - 0.035366807132959366, - 0.04884527623653412, - 0.0011196520645171404, - 0.00026700846501626074, - -0.06519587337970734, - -0.05614931881427765, - 0.0030577462166547775 - ], - "img_vector": [ - 0.9219667911529541, - 0.0977284386754036, - 0.2025243639945984, - 0.061979711055755615, - 0.00619916245341301, - 0.7166117429733276, - 1.226834774017334, - 0.7886548638343811, - 1.6629389524459839, - 0.6918742060661316, - 0.13138777017593384, - 0.9593594670295715, - 0.030556082725524902, - 0.004831538535654545, - 0.004911307245492935, - 1.5104117393493652, - 0.4150170683860779, - 0.17264577746391296, - 0.7917525768280029, - 0.2468060404062271, - 0.16521388292312622, - 0.25357693433761597, - 1.26860773563385, - 0.026516491547226906, - 0.14757683873176575, - 0.299686074256897, - 0.5301297903060913, - 2.2013134956359863, - 0.03337598592042923, - 0.7740409970283508, - 0.17231249809265137, - 0.037611521780490875, - 0.33619436621665955, - 0.01188910473138094, - 0.5645614266395569, - 1.1860660314559937, - 0.05112733691930771, - 0.565477192401886, - 0.43701171875, - 0.0031664420384913683, - 0.6094490885734558, - 0.2998583912849426, - 0.4383941888809204, - 1.0439748764038086, - 0.8239830136299133, - 0.15286700427532196, - 0.5767776966094971, - 0.015460639260709286, - 0.7993848323822021, - 1.3868757486343384, - 2.440202474594116, - 0.28088441491127014, - 0.3520834445953369, - 0.9830549359321594, - 2.023775100708008, - 0.5663003921508789, - 0.3558732271194458, - 0.20145592093467712, - 1.0804108381271362, - 1.8070851564407349, - 0.7908445596694946, - 1.3074238300323486, - 0.9654034972190857, - 2.3403146266937256, - 0.21596920490264893, - 0.0, - 0.3495326042175293, - 0.9000163078308105, - 0.12149554491043091, - 0.7023366689682007, - 0.9547922611236572, - 2.000621795654297, - 0.8170233964920044, - 0.25692981481552124, - 4.821446418762207, - 0.621753990650177, - 1.1972953081130981, - 2.421661615371704, - 0.6477541327476501, - 1.9514731168746948, - 0.9740992188453674, - 2.0650877952575684, - 0.04050368070602417, - 0.15067158639431, - 2.5292654037475586, - 0.01149502582848072, - 0.9158427715301514, - 0.20454742014408112, - 3.383516788482666, - 0.7790547013282776, - 1.0918879508972168, - 2.5497515201568604, - 0.6509770154953003, - 1.3814074993133545, - 0.7000057697296143, - 0.8028034567832947, - 0.20132982730865479, - 1.9157652854919434, - 0.0015001065330579877, - 1.1913106441497803, - 0.0123528353869915, - 0.21103212237358093, - 0.7895367741584778, - 0.017607754096388817, - 2.330967426300049, - 3.8108913898468018, - 3.8300371170043945, - 0.3029964566230774, - 0.5450395345687866, - 0.07796750962734222, - 1.7670717239379883, - 0.2354506105184555, - 0.7570714950561523, - 0.1491096019744873, - 0.05821403115987778, - 0.5385217666625977, - 0.1016593873500824, - 1.7123498916625977, - 0.16868610680103302, - 0.0435841865837574, - 0.3666267693042755, - 0.06689354032278061, - 0.2398235946893692, - 0.3647685945034027, - 1.5938363075256348, - 0.6929879188537598, - 0.43484893441200256, - 1.2545394897460938, - 0.06485043466091156, - 0.018914982676506042, - 0.1343723088502884, - 0.5846444964408875, - 1.0340386629104614, - 0.019701018929481506, - 0.115897998213768, - 0.0, - 0.021337781101465225, - 0.23052164912223816, - 0.4662903845310211, - 0.3543117344379425, - 0.30442672967910767, - 0.41164514422416687, - 0.1871665120124817, - 0.06656026840209961, - 0.53532874584198, - 1.4690028429031372, - 1.1974058151245117, - 0.9184959530830383, - 0.3071364164352417, - 1.6057214736938477, - 0.020331650972366333, - 1.305146336555481, - 0.43180716037750244, - 1.2237268686294556, - 0.9838653802871704, - 0.03288237005472183, - 2.2211010456085205, - 0.003191199852153659, - 0.045853085815906525, - 0.6673545241355896, - 0.17913678288459778, - 0.0, - 0.021156102418899536, - 2.6671745777130127, - 0.3951849639415741, - 0.21547940373420715, - 0.7444193363189697, - 0.021806057542562485, - 0.43650689721107483, - 0.9880358576774597, - 0.6947245001792908, - 0.204078808426857, - 0.27878934144973755, - 0.08354326337575912, - 0.033924274146556854, - 0.20404884219169617, - 0.0, - 0.004306964576244354, - 1.0169310569763184, - 0.33883681893348694, - 1.006794810295105, - 0.05159502103924751, - 0.22930903732776642, - 1.6950254440307617, - 0.4446651339530945, - 0.817156195640564, - 1.3455827236175537, - 4.193704605102539, - 1.0937854051589966, - 0.15106827020645142, - 0.03320198506116867, - 0.12159176915884018, - 1.0395840406417847, - 0.4677858054637909, - 0.0, - 0.7315130233764648, - 3.8822643756866455, - 0.0, - 1.4436346292495728, - 0.029256971552968025, - 0.1190708801150322, - 4.659753799438477, - 0.5842269062995911, - 0.2396518886089325, - 0.1548650860786438, - 0.8187746405601501, - 0.47628429532051086, - 0.71957927942276, - 1.2416067123413086, - 0.19185639917850494, - 0.27450183033943176, - 0.29462772607803345, - 0.39662089943885803, - 0.28732529282569885, - 0.5161588788032532, - 0.9255109429359436, - 0.28638067841529846, - 0.1737833023071289, - 0.09301403909921646, - 2.036120891571045, - 0.05635102093219757, - 0.1268511563539505, - 0.5425705313682556, - 0.3804541230201721, - 0.2628117501735687, - 0.6499223709106445, - 0.11648540943861008, - 0.24499621987342834, - 0.09263883531093597, - 1.4478700160980225, - 0.35764989256858826, - 0.9699946045875549, - 0.4597409665584564, - 0.5973721146583557, - 0.378149151802063, - 1.6083810329437256, - 2.8285250663757324, - 0.6419071555137634, - 0.0, - 1.3998230695724487, - 0.2900331914424896, - 0.6480185985565186, - 0.18579572439193726, - 0.07663349062204361, - 0.023231757804751396, - 0.3678470849990845, - 0.6661166548728943, - 0.0075706597417593, - 1.558577299118042, - 0.0027428993489593267, - 0.4806918203830719, - 0.8155150413513184, - 2.1915347576141357, - 0.4428577423095703, - 1.127350926399231, - 1.0609691143035889, - 0.0, - 0.47014570236206055, - 0.4275362193584442, - 0.11808854341506958, - 0.9221603274345398, - 0.41620829701423645, - 0.13453620672225952, - 0.5105683207511902, - 0.07055539637804031, - 0.25330615043640137, - 0.06392434984445572, - 0.8561735153198242, - 0.5017433166503906, - 0.13940991461277008, - 0.09131714701652527, - 0.03330610692501068, - 1.038124680519104, - 0.42624613642692566, - 0.12857386469841003, - 0.6111430525779724, - 2.1555564403533936, - 0.8140982985496521, - 0.025179672986268997, - 0.029468847438693047, - 0.020997803658246994, - 0.666748046875, - 0.8947370648384094, - 1.790064811706543, - 0.17470449209213257, - 1.0847487449645996, - 1.6438019275665283, - 0.32067349553108215, - 1.8845561742782593, - 0.21915677189826965, - 1.239453673362732, - 2.7079784870147705, - 0.3060023784637451, - 1.255936622619629, - 0.06058673560619354, - 0.42905035614967346, - 0.19555869698524475, - 0.1728508621454239, - 2.4053051471710205, - 0.14267612993717194, - 2.4766340255737305, - 0.7263968586921692, - 2.2464189529418945, - 0.34810030460357666, - 0.177928626537323, - 0.0, - 1.5272282361984253, - 0.34094762802124023, - 0.507898211479187, - 1.34850013256073, - 0.5699977278709412, - 0.755067765712738, - 0.745111346244812, - 0.865845263004303, - 0.20630991458892822, - 0.22738926112651825, - 1.5491124941036105e-05, - 0.18155592679977417, - 0.07149824500083923, - 0.1025463193655014, - 1.5707306861877441, - 2.4894676208496094, - 0.06467421352863312, - 0.0, - 0.7276061773300171, - 1.847212791442871, - 0.0004023581277579069, - 0.05183253809809685, - 0.017870964482426643, - 0.21934057772159576, - 0.19645512104034424, - 0.3183145523071289, - 0.21909859776496887, - 0.3754763603210449, - 1.151180624961853, - 0.3146575689315796, - 0.6991398334503174, - 1.2100400924682617, - 0.07254288345575333, - 1.5646905899047852, - 0.8838477730751038, - 0.758152425289154, - 0.8778436779975891, - 0.8921359181404114, - 0.06647127121686935, - 0.1925186663866043, - 0.1930505335330963, - 0.2328001707792282, - 0.05820649862289429, - 1.4083501100540161, - 1.1012953519821167, - 1.5877500772476196, - 0.19487865269184113, - 0.008351004682481289, - 1.0013880729675293, - 0.23508340120315552, - 0.8750771284103394, - 0.20955131947994232, - 0.70330810546875, - 0.5014642477035522, - 0.514129102230072, - 0.01780667155981064, - 0.07945053279399872, - 0.3499833345413208, - 1.632199764251709, - 1.0881427526474, - 1.2904895544052124, - 1.915879249572754, - 0.8123466968536377, - 0.015614370815455914, - 0.35940560698509216, - 1.0142968893051147, - 0.27264049649238586, - 1.419723629951477, - 0.2512229382991791, - 1.4835264682769775, - 0.03467082604765892, - 0.410952091217041, - 0.23221638798713684, - 0.7286278605461121, - 0.3604239225387573, - 0.7925105690956116, - 1.3636013269424438, - 0.05214739218354225, - 0.13898122310638428, - 0.40420567989349365, - 0.9109073281288147, - 0.1058693528175354, - 0.3443826138973236, - 0.18441244959831238, - 0.6863353252410889, - 0.008236689493060112, - 0.5203438401222229, - 0.3153386414051056, - 0.0, - 0.0, - 1.1556472778320312, - 0.07548300921916962, - 0.13150207698345184, - 0.0, - 1.182020664215088, - 1.9359068870544434, - 0.014955342747271061, - 0.12378225475549698, - 0.2535657584667206, - 0.4078904390335083, - 0.14330130815505981, - 0.386712908744812, - 0.05129178613424301, - 0.7367648482322693, - 0.8375162482261658, - 0.3085392117500305, - 2.080819845199585, - 0.23476073145866394, - 0.25573432445526123, - 1.2985109090805054, - 1.1794553995132446, - 0.6585990190505981, - 0.6587132215499878, - 0.01768592931330204, - 0.20109432935714722, - 1.2516684532165527, - 0.11855360120534897, - 0.11475715041160583, - 1.322260856628418, - 0.002095646457746625, - 0.2910166084766388, - 0.15058103203773499, - 0.005918865092098713, - 0.577019214630127, - 0.9341602921485901, - 0.058176130056381226, - 0.3148823082447052, - 0.888588011264801, - 0.9166330695152283, - 0.91728675365448, - 2.2706422805786133, - 0.08544181287288666, - 0.0024535267148166895, - 0.1845971643924713, - 1.1000250577926636, - 1.0098135471343994, - 1.0376948118209839, - 0.14920414984226227, - 0.1896306872367859, - 0.2188720554113388, - 0.5626853108406067, - 0.8813859820365906, - 0.8824358582496643, - 0.8370124697685242, - 1.4444010257720947, - 0.33782821893692017, - 0.027532491832971573, - 0.4103843569755554, - 0.8604646921157837, - 0.5720173716545105, - 0.23864707350730896, - 0.3264397084712982, - 0.10232428461313248, - 1.1249735355377197, - 0.03594962880015373, - 0.25617334246635437, - 0.28383487462997437, - 0.12444400042295456, - 1.3461889028549194, - 0.20243783295154572, - 0.029978720471262932, - 0.4074413776397705, - 1.5426274538040161, - 0.7376505136489868, - 0.17576472461223602, - 0.4411477744579315, - 0.17897135019302368, - 0.8119418621063232, - 1.0999218225479126, - 0.6837776899337769, - 0.32099011540412903, - 0.3542003631591797, - 0.3345324993133545, - 0.18039555847644806, - 0.5184633135795593, - 1.2762041091918945, - 1.1735683679580688, - 0.2779421806335449, - 1.9010751247406006, - 0.06706434488296509, - 0.6018314361572266, - 1.4402341842651367, - 0.2219811975955963, - 0.0, - 0.10687195509672165, - 0.39939484000205994, - 0.8895093202590942, - 1.4667552709579468, - 0.009427358396351337, - 0.0, - 0.45210328698158264, - 1.4034292697906494, - 0.8327339291572571, - 0.0583820603787899, - 0.8471578359603882, - 0.6048324108123779, - 0.0, - 1.8178064823150635, - 1.9143019914627075, - 0.4151158630847931, - 0.029820218682289124, - 0.09978644549846649, - 1.12955641746521, - 0.5168150067329407, - 0.054348401725292206, - 0.21542352437973022 - ], - "product_id": 4943, - "product_metadata": { - "name": "Gini and Jony Boy's Kaleb White Brown Kidswear", - "gender": "Men", - "master_category": "Apparel", - "sub_category": "Topwear", - "article_type": "Shirts", - "base_color": "White", - "season": "Summer", - "year": 2011, - "usage": "Casual", - "img_url": "http://assets.myntassets.com/v1/images/style/properties/1aae016d0abb224cfc18e6bd9bb01ad1_images.jpg" - } - } -] \ No newline at end of file diff --git a/backend/pyproject.toml b/backend/pyproject.toml index e0c0a9f..db0ac70 100644 --- a/backend/pyproject.toml +++ b/backend/pyproject.toml @@ -17,7 +17,8 @@ cohere = "^5.5.8" openai = "^1.35.9" sentence-transformers = "^3.0.1" sentencepiece = "^0.2.0" - +redis = "^5.2.1" +asgi-lifespan = "^2.1.0" [tool.poetry.group.dev.dependencies] mypy = "1.9.0" From 25da3f2361485af66846b603e6935a0f2f9532cf Mon Sep 17 00:00:00 2001 From: Tyler Hutcherson Date: Mon, 24 Feb 2025 19:19:58 -0500 Subject: [PATCH 4/7] add missing files --- backend/productsearch/db/utils.py | 18 + backend/productsearch/main.py | 2 +- backend/productsearch/tests/conftest.py | 1 - backend/productsearch/tests/test_vectors.json | 3899 +++++++++++++++++ 4 files changed, 3918 insertions(+), 2 deletions(-) create mode 100644 backend/productsearch/db/utils.py create mode 100644 backend/productsearch/tests/test_vectors.json diff --git a/backend/productsearch/db/utils.py b/backend/productsearch/db/utils.py new file mode 100644 index 0000000..425a7ad --- /dev/null +++ b/backend/productsearch/db/utils.py @@ -0,0 +1,18 @@ +import logging +import os + +from fastapi import Request +from redisvl.index import AsyncSearchIndex +from redisvl.schema import IndexSchema + +logger = logging.getLogger(__name__) + + +def get_schema() -> IndexSchema: + dir_path = os.path.dirname(os.path.realpath(__file__)) + "/schema" + file_path = os.path.join(dir_path, "products.yml") + return IndexSchema.from_yaml(file_path) + + +def get_async_index(request: Request) -> AsyncSearchIndex: + return request.app.state.redis_index diff --git a/backend/productsearch/main.py b/backend/productsearch/main.py index 473d08e..490c0d9 100644 --- a/backend/productsearch/main.py +++ b/backend/productsearch/main.py @@ -28,7 +28,7 @@ async def lifespan(app: FastAPI): finally: # Dispose of them in shutdown logic await index.disconnect() - await client.close() + await client.aclose() # type: ignore app = FastAPI( diff --git a/backend/productsearch/tests/conftest.py b/backend/productsearch/tests/conftest.py index 4251b0a..d55eaf4 100644 --- a/backend/productsearch/tests/conftest.py +++ b/backend/productsearch/tests/conftest.py @@ -7,7 +7,6 @@ import pytest_asyncio from asgi_lifespan import LifespanManager from httpx import AsyncClient -from redis.asyncio import Redis from redisvl.index import SearchIndex from productsearch import config diff --git a/backend/productsearch/tests/test_vectors.json b/backend/productsearch/tests/test_vectors.json new file mode 100644 index 0000000..a9a8567 --- /dev/null +++ b/backend/productsearch/tests/test_vectors.json @@ -0,0 +1,3899 @@ +[ + { + "text_vector": [ + -0.03393559530377388, + -0.04990660026669502, + 0.016132276505231857, + -0.00846362765878439, + -0.05648665502667427, + 0.018785007297992706, + 0.00879194401204586, + 0.06382977217435837, + 0.00597847905009985, + -0.08251062780618668, + 0.0003185232635587454, + -5.0618360546650365e-05, + 0.005405772477388382, + -0.03111191652715206, + 0.004562561400234699, + -0.005532930139452219, + 0.10343310236930847, + 0.10447119921445847, + 0.016839593648910522, + -0.032953377813100815, + 0.04014723002910614, + 0.06387364864349365, + 0.016832515597343445, + 0.05888661742210388, + 0.07573509961366653, + -0.0033486674074083567, + 0.05588237941265106, + -0.016997838392853737, + 0.003693588310852647, + 0.024673664942383766, + -0.005483895540237427, + 0.019571328535676003, + 0.0046260058879852295, + 0.03906898945569992, + 0.019499169662594795, + -0.06892002373933792, + 0.01181041356176138, + -0.026075659319758415, + 0.03275682032108307, + -0.011539081111550331, + 0.07350470125675201, + -0.0591978095471859, + 0.06153172254562378, + -0.011098482646048069, + 0.03916731849312782, + -0.004853249993175268, + 0.01013807114213705, + 0.005201645661145449, + -0.025134054943919182, + -0.015050604939460754, + -0.07768465578556061, + -0.03046954795718193, + -0.0031400478910654783, + -0.02269473299384117, + -0.0005072109634056687, + -0.02397204376757145, + -0.016115568578243256, + -0.014321294613182545, + 0.003676225198432803, + 0.02955225296318531, + 0.014535190537571907, + 0.04973544925451279, + -0.05379035323858261, + 0.06832382082939148, + 0.06784015148878098, + 0.015294838696718216, + -0.009842496365308762, + 0.014504199847579002, + -0.03122352994978428, + -0.01613180711865425, + -0.025248529389500618, + -0.04231264442205429, + -0.016540318727493286, + 0.0001432958379155025, + -0.0056154076009988785, + 0.0097186965867877, + -0.031045211479067802, + -0.07173841446638107, + -0.0871841236948967, + -0.03233925253152847, + 0.017746875062584877, + 0.03401092812418938, + -0.020756222307682037, + 0.04251581430435181, + -0.0036885766312479973, + -0.04426254332065582, + 0.014653257094323635, + 0.03886453062295914, + -0.011128249578177929, + 0.0030326980631798506, + 0.043790675699710846, + -0.03719367831945419, + 0.03924649953842163, + 0.018893342465162277, + 0.04419995844364166, + 0.007890095002949238, + -0.0028986092656850815, + -0.033496830612421036, + 0.0030497724656015635, + -0.09353843331336975, + 0.011364402249455452, + 0.009714250452816486, + -0.028228309005498886, + -0.0034365204628556967, + -0.03337673470377922, + 0.011352911591529846, + 0.03699725493788719, + 0.0041985539719462395, + -0.043616682291030884, + -0.0613630972802639, + -0.0002867076836992055, + 0.06323304027318954, + 0.02979828603565693, + 0.005455720238387585, + 0.034946784377098083, + -0.005342879332602024, + -0.07164490967988968, + 0.022429214790463448, + -0.016895953565835953, + 0.04505882412195206, + 0.005202071741223335, + 0.001803889754228294, + -0.040522582828998566, + -0.00925680436193943, + -0.023505667224526405, + 0.005336982198059559, + -0.005406791344285011, + -0.033150553703308105, + 0.00014492358604911715, + -0.02251916378736496, + -0.03213442862033844, + -0.07870680093765259, + -0.017452707514166832, + 0.0067907157354056835, + -0.020899413153529167, + 0.0005868286825716496, + 0.021772351115942, + -0.05350570008158684, + 0.011851498857140541, + 0.00908143725246191, + -0.053206413984298706, + -0.008514701388776302, + 0.04554542526602745, + 0.03208543360233307, + 0.020564090460538864, + 0.03181111440062523, + -0.008712765760719776, + -0.016613414511084557, + -0.011637146584689617, + 0.016027018427848816, + 0.02783716283738613, + 0.019440852105617523, + -0.02984008938074112, + -0.024519801139831543, + -0.06927864253520966, + 0.018899686634540558, + 0.01639719493687153, + -0.043533872812986374, + 0.06363128125667572, + -0.010938062332570553, + -0.02175607904791832, + -0.05223378911614418, + 0.016116905957460403, + 0.004888846073299646, + 0.07678312808275223, + 0.009497089311480522, + -0.006415256764739752, + 0.023976502940058708, + 0.008534741587936878, + 0.024642933160066605, + 0.005944297183305025, + -0.06251084804534912, + 0.055301494896411896, + -0.06546376645565033, + 0.00193867611233145, + 0.02272355742752552, + -0.03286789730191231, + 0.06420274078845978, + -0.0025534105952829123, + -0.008454752154648304, + -0.03540773317217827, + -0.027233809232711792, + 0.022590868175029755, + 0.03118966519832611, + -0.03544211387634277, + 0.02776576764881611, + 0.009208066388964653, + 0.031304892152547836, + 0.03148844465613365, + -0.01705220341682434, + -0.00021590660617221147, + 0.05593250319361687, + -0.015561473555862904, + -0.024937596172094345, + -0.025176778435707092, + 0.049088675528764725, + -0.007490852847695351, + -0.02831689454615116, + 0.009519128128886223, + 0.005547249689698219, + -0.015410251915454865, + -0.01615542359650135, + -0.02801065891981125, + -0.06382467597723007, + -0.06637170165777206, + 0.003180221887305379, + -0.025272486731410027, + 0.025063686072826385, + 0.022493654862046242, + 0.006096544209867716, + -0.0625917986035347, + 0.030303722247481346, + -0.035027626901865005, + 0.05280965566635132, + -0.009280146099627018, + -0.03292974829673767, + 0.035065457224845886, + 0.04754626750946045, + 0.0384429432451725, + 0.03750963881611824, + -0.039183150976896286, + -0.04159984737634659, + -0.018830908462405205, + -0.003437978681176901, + -0.034320201724767685, + 0.04795364290475845, + -0.032227057963609695, + 0.03728616610169411, + -0.05122159793972969, + 0.011107193306088448, + 0.001230345107614994, + 0.02660415507853031, + -0.03312051296234131, + 0.04429064691066742, + 0.025250056758522987, + -0.02225230447947979, + -0.019868120551109314, + -0.004622646141797304, + 0.015964478254318237, + -0.012140940874814987, + -0.005271021276712418, + -0.04417719691991806, + -0.008836973458528519, + -0.01985839195549488, + 0.01438771840184927, + -0.05426889285445213, + 0.004801252856850624, + -0.032227449119091034, + -0.03455549106001854, + -0.0013448289828374982, + 0.01332621369510889, + -0.02960873767733574, + 0.0357929989695549, + 0.0062960549257695675, + -0.03888843208551407, + 0.043890468776226044, + -0.027121180668473244, + -0.008967895060777664, + 0.04637568071484566, + 0.05659542605280876, + -0.01866857148706913, + 0.02339891716837883, + -0.039214760065078735, + 0.09742870181798935, + 0.02456514723598957, + 0.019452352076768875, + 0.009586907923221588, + 0.02998150885105133, + 0.03705842047929764, + 0.01654098927974701, + -0.07505930960178375, + -0.0434543713927269, + -0.029102839529514313, + 0.005165805108845234, + -0.04940882697701454, + -0.028128622099757195, + 0.05604720115661621, + -0.02422865852713585, + 0.01497571263462305, + -0.017759691923856735, + 0.01273058820515871, + -0.011741937138140202, + -0.047867804765701294, + 0.00473345210775733, + 0.024863529950380325, + -0.012686744332313538, + -0.037471551448106766, + -0.040277253836393356, + 0.006212162785232067, + 0.018860945478081703, + 0.021480530500411987, + -0.022025292739272118, + 0.005858102813363075, + 0.00843774899840355, + 0.04087912663817406, + -0.05282086133956909, + 0.03498505800962448, + 0.04415362328290939, + -0.003506459528580308, + 0.033895984292030334, + 0.05209290236234665, + -0.06120959296822548, + -0.016440171748399734, + -0.04450145363807678, + -0.044808343052864075, + -0.023465286940336227, + -0.039000581949949265, + 0.029621869325637817, + 0.07939174771308899, + 0.005688108969479799, + 0.012900558300316334, + 0.036535050719976425, + 0.034416113048791885, + -0.03338963910937309, + 0.03977019339799881, + 0.025810671970248222, + -0.015850048512220383, + 0.022691400721669197, + 0.0339798703789711, + 0.03477761894464493, + -0.04180338606238365, + 0.021672502160072327, + 0.04897826537489891, + -0.009264335967600346, + -0.04478788375854492, + -0.025223160162568092, + -0.0880902111530304, + -0.07986559718847275, + 0.030004071071743965, + 0.07550054788589478, + 0.021352170035243034, + -0.06404036283493042, + 0.047331977635622025, + -0.009149362333118916, + -0.012558549642562866, + -0.02410043217241764, + 0.03873436897993088, + 0.06760793924331665, + 0.019703971222043037, + 0.01903701387345791, + 0.03146923705935478, + 0.011822045780718327, + 0.013820323161780834, + 0.046530965715646744, + 0.0057722534984350204, + -0.007235377561300993, + 0.04761214554309845, + 0.04502183198928833, + 0.0037566618993878365, + 0.06368622183799744, + 0.01884528622031212, + 0.009200004860758781, + 0.03209213539958, + -0.049618303775787354, + -0.001631803810596466, + 0.017066771164536476, + -0.051420994102954865, + -0.039120957255363464, + -0.016216013580560684, + -0.06606243550777435, + -0.030666237697005272, + 0.04780522733926773, + 0.01776711829006672, + 0.032893724739551544, + 0.0007131390739232302, + -0.03023766167461872, + -0.04811779782176018, + -0.014173793606460094, + -0.02817005105316639, + -0.012027849443256855, + -0.006429607514292002, + 0.0010882338974624872, + -0.006640622392296791, + -0.06267828494310379, + -0.03587674722075462, + 0.0014659170992672443, + -0.016443872824311256, + -0.013858063146471977, + 0.006184784695506096, + 0.024877779185771942, + -0.018648909404873848, + -0.07375568151473999, + 0.0165398009121418, + -0.02720850147306919, + 0.014025786891579628, + 0.013232937082648277, + -0.040296394377946854, + -0.07310345023870468, + 0.05166107043623924, + -0.01892232522368431, + -0.02467680722475052, + -0.04716251417994499, + 0.09342038631439209, + 0.032422665506601334, + 0.05799644812941551, + 0.014735671691596508, + -0.0010633908677846193, + -0.00030097499256953597, + 0.016880325973033905, + -0.05831112340092659, + 0.0347287543118, + -0.033527884632349014, + 0.016586508601903915, + 0.05693844333291054, + -0.04335648939013481, + 0.009776759892702103, + -0.0030053218360990286, + -0.057905733585357666, + -0.01696743257343769, + -0.03671075031161308, + 0.01225623395293951, + 0.0864834263920784, + 0.030828701332211494, + -0.026173219084739685, + -0.005269192159175873, + 0.013644417747855186, + -0.029657866805791855, + 0.013020635582506657, + -0.010077279061079025, + 0.0011919612297788262, + 0.08367036283016205, + -0.04244127497076988, + -0.019861971959471703, + -0.0322553850710392, + -0.007308498956263065, + 0.008620179258286953, + 0.04857302084565163, + 0.059778425842523575, + 0.041013363748788834, + -0.01425447128713131, + 0.007392296101897955, + -0.0021458230912685394, + -0.009496014565229416, + 0.06665940582752228, + -0.0015664458042010665, + 0.061947643756866455, + -0.05401550233364105, + 0.015551939606666565, + -0.03212275728583336, + 0.14326466619968414, + 0.07305418699979782, + 0.02432163991034031, + -0.03385386988520622, + -0.03096604347229004, + -0.010838611051440239, + -0.020759552717208862, + 0.08232907950878143, + -0.01849890686571598, + 0.0023236952256411314, + 0.02000279352068901, + -0.03543560951948166, + -0.02500309608876705, + -0.07544269412755966, + -0.03681257739663124, + -0.023356646299362183, + 0.02014840394258499, + -0.004308828618377447, + -0.021056678146123886, + -0.0340706892311573, + 0.005756992381066084, + 0.019031338393688202, + 0.0025014944840222597, + -0.051194388419389725, + 0.044678643345832825, + 0.0030806399881839752, + -0.009118152782320976, + 0.0064518870785832405, + 0.009612719528377056, + -0.040094658732414246, + 0.04688591510057449, + -0.11521675437688828, + 0.015795951709151268, + 0.04034894332289696, + -0.03824043273925781, + 0.023466847836971283, + 0.0214488934725523, + 0.06391274183988571, + 0.006672362796962261, + 0.04955239221453667, + -0.005667699966579676, + -0.000939805235248059, + 0.02220277301967144, + 0.005777365993708372, + 0.008846083655953407, + -0.0023736541625112295, + -0.017694205045700073, + 0.03048483096063137, + 0.04487602040171623, + 0.02107277326285839, + -0.002063559601083398, + -0.06016073748469353, + -0.03223465383052826, + -0.06645369529724121, + 0.04144921898841858, + 2.6023940661778378e-33, + -0.029112419113516808, + 0.027139173820614815, + -0.027569836005568504, + 0.030279556289315224, + -0.004434259608387947, + -0.048652634024620056, + -0.021458672359585762, + -0.01392059214413166, + 0.005342056974768639, + -0.05034767463803291, + -0.07521184533834457, + 0.019696811214089394, + 0.03127216920256615, + 0.009301777929067612, + 0.01008533500134945, + -0.012601974420249462, + -0.04459903761744499, + -0.07563737034797668, + -0.008699389174580574, + 0.005845831707119942, + -0.02474849671125412, + 0.015006870031356812, + 0.012887362390756607, + 0.06471296399831772, + 0.03896433487534523, + -0.006097625941038132, + -0.007055818568915129, + 0.014148968271911144, + 0.06677020341157913, + 0.008194589987397194, + -0.00843536015599966, + -0.0020477373618632555, + -0.032097749412059784, + -0.01069018803536892, + -0.07233092188835144, + 0.007518956903368235, + 0.012899922206997871, + -0.01816881075501442, + -0.0508074089884758, + -0.013811360113322735, + -0.026359902694821358, + -0.016759224236011505, + 0.01596258394420147, + 0.019943691790103912, + 0.05230144038796425, + -0.06904474645853043, + 0.01679394766688347, + -0.027789557352662086, + 0.005197923164814711, + 0.020424358546733856, + 0.039931897073984146, + 0.0226381104439497, + -0.002591995522379875, + 0.03434031456708908, + 0.02219429612159729, + -0.016339166089892387, + 0.012328250333666801, + -0.06449461728334427, + -0.01671026274561882, + -0.021590042859315872, + 0.01628253236413002, + -0.07683385163545609, + 0.03708987310528755, + 0.06953958421945572, + 0.038054585456848145, + -0.03682452440261841, + -0.06347202509641647, + -0.02653820812702179, + 0.05673739314079285, + -0.03711933270096779, + 0.009481999091804028, + 0.005265864543616772, + 0.06123204901814461, + -0.011175659485161304, + -0.028009656816720963, + 0.00023451069137081504, + -0.0016385375056415796, + 0.003676333697512746, + -0.005239939317107201, + 0.005395047832280397, + -0.009376623667776585, + 0.025685612112283707, + -0.0833197757601738, + 0.004798338748514652, + 0.03966202959418297, + -0.020798271521925926, + -0.036650702357292175, + -0.021408826112747192, + -0.008483895100653172, + 0.007455766201019287, + 0.01751876436173916, + -0.004837819375097752, + 0.043923210352659225, + 0.0020698371808975935, + -0.0064608873799443245, + 0.04691885784268379, + -0.03283268213272095, + -0.0014651546953245997, + 0.009402312338352203, + 0.013497631996870041, + 0.019221195951104164, + 0.009098423644900322, + -0.02054799348115921, + -0.0021446726750582457, + -0.007356501184403896, + 0.012563804164528847, + 0.02486245147883892, + -0.013305466622114182, + 0.03182007372379303, + -0.035584546625614166, + 0.022490326315164566, + 0.04556747525930405, + -0.004448640625923872, + -0.029569832608103752, + 0.03670313581824303, + 0.016944877803325653, + 0.007922742515802383, + -0.009226726368069649, + -0.11155203729867935, + 0.07871992886066437, + 0.021008841693401337, + -0.01743566244840622, + 0.035147588700056076, + 0.027405448257923126, + 0.028433548286557198, + 0.003829195164144039, + -0.0006103036575950682, + 0.03521190583705902, + 0.03589536249637604, + 0.016948552802205086, + -0.008009872399270535, + -0.039476118981838226, + -0.015803184360265732, + -0.01160280592739582, + -0.0654168650507927, + -0.0009439907735213637, + 0.01633564941585064, + -0.06537310034036636, + 0.004506586119532585, + -0.06770332157611847, + 0.00868937000632286, + 0.014138869009912014, + -0.024692071601748466, + 0.05028563365340233, + -0.022254884243011475, + -0.023609578609466553, + 0.06883847713470459, + -0.00590246869251132, + 0.05147001892328262, + -0.05654331296682358, + 0.007979866117238998, + 0.033850349485874176, + -0.07012176513671875, + 0.04099681228399277, + -0.06963951885700226, + -0.018162619322538376, + 0.045439817011356354, + 0.07018809765577316, + 0.005352327600121498, + 0.03470807522535324, + 0.006716700736433268, + 0.01109995599836111, + -0.03327262029051781, + 0.0750216618180275, + -0.006794843822717667, + -0.023908773437142372, + 0.02136465348303318, + 0.004486675374209881, + 0.00010750960791483521, + -0.042383208870887756, + 0.006999874021857977, + 0.029889337718486786, + 0.026991836726665497, + -0.008198073133826256, + 0.030653180554509163, + -0.02327040769159794, + 0.07274460792541504, + 0.0005662862677127123, + -0.07608013600111008, + 0.007077177055180073, + -0.06568139791488647, + -0.05316115915775299, + -0.03526247292757034, + -0.020170433446764946, + 0.03199014440178871, + -0.006314262747764587, + -0.012019787915050983, + -0.010583826340734959, + 0.0453849621117115, + 0.06132867932319641, + 0.021829668432474136, + 0.01626937836408615, + 0.0603715255856514, + -0.016888398677110672, + -0.028254995122551918, + -0.026342865079641342, + 0.07478868961334229, + -0.028341542929410934, + -0.02785210870206356, + 0.016427254304289818, + -0.021726803854107857, + -0.02016947977244854, + 0.03713537007570267, + -0.024262677878141403, + -0.06551951169967651, + -0.007407693192362785, + -0.01872149482369423, + -0.04042063280940056, + 0.03734245151281357, + -0.0354398638010025, + -0.005492678377777338, + -0.017799505963921547, + 0.03671438992023468, + 0.009855690412223339, + 0.007541081868112087, + 0.002123068319633603, + 0.02614397369325161, + 0.019680684432387352, + -0.015599251724779606, + -0.03180048614740372, + -0.0027479282580316067, + -0.003465427551418543, + -0.022585604339838028, + 0.04364408552646637, + 0.04590499401092529, + 0.03039989061653614, + -0.02501865290105343, + -0.018725760281085968, + -0.03841501101851463, + -0.03846999630331993, + -0.04733772203326225, + -0.02596689574420452, + 0.01923862285912037, + -0.0548657663166523, + 0.049230147153139114, + 0.05894150584936142, + 0.0614728145301342, + 0.05202079936861992, + 0.044498879462480545, + 0.01884595863521099, + -0.04909370467066765, + 0.032387979328632355, + 0.01943165808916092, + 0.005559650249779224, + -0.008502674289047718, + 0.028704054653644562, + -0.023885568603873253, + 0.01673683151602745, + -0.04476772993803024, + -0.028978601098060608, + -0.016595033928751945, + 0.025348611176013947, + 0.021823996677994728, + 0.03303432837128639, + -0.06657654792070389, + 0.011180645786225796, + -0.04453815892338753, + 0.002057461068034172, + 0.01483633928000927, + -0.05698612332344055, + -0.011611763387918472, + -0.008270759135484695, + 0.03396761044859886, + -0.012584727257490158, + -0.028426695615053177, + -0.02404310181736946, + 0.027377694845199585, + 0.040209174156188965, + -0.03167543560266495, + 0.022754568606615067, + -0.02133987285196781, + -0.0016616465291008353, + 0.01239469088613987 + ], + "img_vector": [ + 1.6060603857040405, + 0.023311417549848557, + 1.5992186069488525, + 0.24428938329219818, + 0.23620489239692688, + 0.7305210828781128, + 2.6585094928741455, + 0.56398606300354, + 1.238928198814392, + 3.6237173080444336, + 0.17512637376785278, + 1.004285216331482, + 0.27379342913627625, + 0.5485386848449707, + 0.17267373204231262, + 0.7927314639091492, + 0.5915138125419617, + 0.7549329996109009, + 0.2891375422477722, + 0.044890034943819046, + 0.7849643230438232, + 0.3444228768348694, + 1.5427168607711792, + 0.7024847269058228, + 1.9577040672302246, + 0.05392508581280708, + 0.6979166865348816, + 0.657534122467041, + 0.2386043518781662, + 1.2968523502349854, + 0.6002953052520752, + 0.6281573176383972, + 0.3771921992301941, + 2.258343458175659, + 1.5886999368667603, + 0.013888304121792316, + 1.9237171411514282, + 0.6578956842422485, + 3.3070313930511475, + 0.03344883397221565, + 0.040779221802949905, + 0.009543554857373238, + 0.10308908671140671, + 0.2483556717634201, + 0.7300630807876587, + 0.1418759822845459, + 1.9762786626815796, + 0.16385480761528015, + 0.12981082499027252, + 1.6922454833984375, + 0.6217420697212219, + 2.0591580867767334, + 0.7417920231819153, + 0.48015737533569336, + 1.9160137176513672, + 0.20557694137096405, + 0.42179447412490845, + 0.5475835800170898, + 1.4131569862365723, + 0.17968598008155823, + 0.41470009088516235, + 0.6715495586395264, + 0.004424240905791521, + 0.03476451709866524, + 0.14679187536239624, + 0.02477596327662468, + 0.19274598360061646, + 0.4267756938934326, + 3.002120018005371, + 0.053201012313365936, + 0.4220049977302551, + 2.2039341926574707, + 0.2633339762687683, + 0.7358637452125549, + 0.3891788721084595, + 0.18670202791690826, + 0.3857291042804718, + 0.3079127371311188, + 0.9794412851333618, + 0.29265838861465454, + 0.08062100410461426, + 3.8685548305511475, + 1.0757371187210083, + 0.28298553824424744, + 1.9911510944366455, + 0.30302122235298157, + 0.48161953687667847, + 0.9757227897644043, + 0.8554298877716064, + 0.26958680152893066, + 1.2203893661499023, + 0.19178716838359833, + 0.6936157941818237, + 0.1857844889163971, + 1.2806748151779175, + 2.822582721710205, + 1.7506636381149292, + 0.5258067846298218, + 0.12348953634500504, + 1.0646631717681885, + 0.1978907287120819, + 1.5614230632781982, + 0.26506033539772034, + 0.0060147675685584545, + 0.46644502878189087, + 3.204822540283203, + 0.767645001411438, + 0.21385683119297028, + 0.0416906513273716, + 2.973973512649536, + 0.5467687845230103, + 0.05251817777752876, + 0.7152663469314575, + 1.32183039188385, + 0.38034582138061523, + 0.896089494228363, + 1.2865360975265503, + 5.364962100982666, + 0.5069512128829956, + 0.8030731678009033, + 0.4308767020702362, + 1.0436382293701172, + 0.5071713924407959, + 0.013664341531693935, + 0.41897979378700256, + 0.28651049733161926, + 1.232376217842102, + 0.6509360671043396, + 0.6817529797554016, + 0.6253411173820496, + 0.5689865946769714, + 1.5946040153503418, + 0.4697061777114868, + 1.1851292848587036, + 0.10339945554733276, + 0.16823703050613403, + 1.3908051252365112, + 0.05650084465742111, + 0.8963669538497925, + 0.08991120010614395, + 1.7276122570037842, + 0.5304086804389954, + 0.15751291811466217, + 0.7798666954040527, + 0.8531783223152161, + 0.07579825073480606, + 0.02254975587129593, + 0.5722983479499817, + 0.3637908101081848, + 0.2113863080739975, + 0.4218485951423645, + 0.5964052677154541, + 1.098252296447754, + 0.24399873614311218, + 0.5031745433807373, + 1.7694472074508667, + 0.7445709705352783, + 0.026101643219590187, + 0.20490258932113647, + 1.0809136629104614, + 5.364598274230957, + 0.10500452667474747, + 0.028322434052824974, + 4.393288612365723, + 2.454454183578491, + 0.15388096868991852, + 0.04443923756480217, + 1.386675477027893, + 0.07155905663967133, + 0.33951857686042786, + 2.5874991416931152, + 0.10189835727214813, + 0.3037762939929962, + 0.5270680785179138, + 1.8049432039260864, + 0.4002498388290405, + 0.0, + 0.36352360248565674, + 0.1122952550649643, + 3.9193084239959717, + 1.022976279258728, + 0.18945834040641785, + 0.38455238938331604, + 1.604540467262268, + 0.20486967265605927, + 0.9759292602539062, + 0.023901350796222687, + 0.6389347910881042, + 0.3143121004104614, + 0.3337785005569458, + 0.2949604392051697, + 0.03339492902159691, + 1.3361395597457886, + 0.6338132619857788, + 0.11517766118049622, + 0.15511742234230042, + 1.9459213018417358, + 0.10533364117145538, + 1.7245819568634033, + 0.6566029787063599, + 0.2102874517440796, + 0.977824330329895, + 0.3738621771335602, + 0.14942370355129242, + 1.0115660429000854, + 0.8036091327667236, + 2.3727846145629883, + 0.19382667541503906, + 1.317394495010376, + 0.12315088510513306, + 0.04790612682700157, + 0.30056115984916687, + 0.051859915256500244, + 0.16330936551094055, + 0.3902614414691925, + 0.8400954604148865, + 1.3039026260375977, + 0.35030633211135864, + 0.005629597697407007, + 0.9061047434806824, + 0.875684380531311, + 0.6288579106330872, + 0.3180611729621887, + 0.4043000638484955, + 0.0, + 0.8290240168571472, + 0.08352002501487732, + 0.24920961260795593, + 0.15347686409950256, + 0.09582220017910004, + 0.5408208966255188, + 1.7414767742156982, + 1.3652604818344116, + 0.31055599451065063, + 0.6218233108520508, + 0.096509650349617, + 1.1218194961547852, + 0.7589020133018494, + 0.6382386088371277, + 1.4120192527770996, + 0.8366636037826538, + 0.08634627610445023, + 2.34159255027771, + 0.7971048951148987, + 0.12434011697769165, + 0.21753312647342682, + 0.35343459248542786, + 1.0159199237823486, + 4.873634338378906, + 0.2797590494155884, + 0.2863509953022003, + 0.647856593132019, + 0.9216055870056152, + 0.04012395069003105, + 0.3193407952785492, + 2.4193224906921387, + 0.3003430962562561, + 1.778892159461975, + 0.8514758348464966, + 0.015147564001381397, + 0.9429329037666321, + 3.015664577484131, + 0.027810975909233093, + 0.5146723985671997, + 0.15839818120002747, + 0.48258399963378906, + 0.26816558837890625, + 0.3736044466495514, + 0.7515292763710022, + 2.9619150161743164, + 0.568040132522583, + 0.018915098160505295, + 0.7167770266532898, + 1.3097935914993286, + 0.5368766188621521, + 0.47738325595855713, + 2.2792320251464844, + 0.08365587145090103, + 3.6707632541656494, + 1.114358901977539, + 1.7270783185958862, + 0.5547150373458862, + 0.1916281282901764, + 0.36046382784843445, + 3.404851198196411, + 0.018108496442437172, + 0.8048120737075806, + 0.8753102421760559, + 0.5185558795928955, + 0.4681185185909271, + 1.0220873355865479, + 0.03993622586131096, + 0.7356597185134888, + 0.34469106793403625, + 0.3270503580570221, + 1.1546738147735596, + 1.7357233762741089, + 0.35392025113105774, + 1.9712550640106201, + 0.3051522374153137, + 4.659305572509766, + 0.9718514084815979, + 0.6100807785987854, + 0.0785725861787796, + 0.391244500875473, + 0.11548355966806412, + 3.515791177749634, + 0.21507315337657928, + 0.7276331186294556, + 0.30519044399261475, + 0.4538881480693817, + 3.4201977252960205, + 0.03828118368983269, + 0.35589295625686646, + 1.8634214401245117, + 0.3320775628089905, + 0.6992347240447998, + 0.1949286162853241, + 0.58704674243927, + 0.5947393178939819, + 0.8339709639549255, + 1.7812957763671875, + 1.4620548486709595, + 0.29814985394477844, + 0.2399066686630249, + 0.5540988445281982, + 0.47884684801101685, + 1.6393197774887085, + 0.019417017698287964, + 0.12630312144756317, + 0.028104867786169052, + 0.012865184806287289, + 2.904207706451416, + 0.39732155203819275, + 1.8746265172958374, + 0.15251758694648743, + 0.1485610455274582, + 0.11073493957519531, + 0.23561647534370422, + 1.9043076038360596, + 0.1539708822965622, + 0.40040281414985657, + 0.36775103211402893, + 1.787960410118103, + 0.15985651314258575, + 0.05280723422765732, + 1.3120622634887695, + 1.0336921215057373, + 0.18516483902931213, + 1.2120698690414429, + 0.5979412794113159, + 2.651008367538452, + 0.20710958540439606, + 0.4899310767650604, + 0.9152653217315674, + 1.4556013345718384, + 1.7977503538131714, + 0.9995325207710266, + 0.11671250313520432, + 0.9690338373184204, + 1.1871520280838013, + 1.7501611709594727, + 3.4064013957977295, + 1.0542253255844116, + 1.8227778673171997, + 0.19713647663593292, + 1.4037928581237793, + 1.4500869512557983, + 2.601261615753174, + 3.248337984085083, + 0.06415573507547379, + 2.478783369064331, + 0.07138216495513916, + 1.951278567314148, + 1.4193190336227417, + 0.6458536386489868, + 0.07498359680175781, + 1.1215444803237915, + 0.2367917150259018, + 0.48600688576698303, + 0.6099836826324463, + 1.1967101097106934, + 0.3284856081008911, + 0.16726087033748627, + 0.007037023082375526, + 0.057962674647569656, + 0.7052373886108398, + 2.3377621173858643, + 0.13116194307804108, + 0.8777397871017456, + 0.7162390947341919, + 0.43820977210998535, + 0.10830049961805344, + 0.17373286187648773, + 0.23291008174419403, + 0.4541318416595459, + 0.5536465048789978, + 0.7602322101593018, + 2.699960470199585, + 1.0956249237060547, + 0.8737528324127197, + 0.6555755734443665, + 0.8438711166381836, + 0.7002922892570496, + 0.4335423707962036, + 0.08192634582519531, + 1.4609627723693848, + 0.08017786592245102, + 0.07634236663579941, + 1.128524899482727, + 0.3047429621219635, + 0.29571810364723206, + 0.30547991394996643, + 0.7010190486907959, + 0.04223880171775818, + 2.0985684394836426, + 0.9767540097236633, + 1.2138278484344482, + 0.40932098031044006, + 0.35035213828086853, + 0.06969039142131805, + 0.12594301998615265, + 0.23062466084957123, + 0.10362624377012253, + 0.6114252209663391, + 0.5678809285163879, + 0.5782231092453003, + 0.2890022099018097, + 0.031568169593811035, + 3.719416379928589, + 0.2750316858291626, + 2.2642037868499756, + 1.4262094497680664, + 0.5401033163070679, + 1.0348756313323975, + 0.24485263228416443, + 0.37098413705825806, + 0.4993506371974945, + 0.6425707936286926, + 0.0708153024315834, + 0.655907392501831, + 0.2669297158718109, + 0.9327427744865417, + 0.8548014163970947, + 0.08585119992494583, + 1.043649673461914, + 0.42825624346733093, + 0.054034583270549774, + 1.2727422714233398, + 0.17111805081367493, + 0.29886096715927124, + 0.34513986110687256, + 0.5792043209075928, + 1.0208455324172974, + 1.1045252084732056, + 1.2608152627944946, + 0.18253958225250244, + 0.3627760410308838, + 0.3966849446296692, + 0.7543349266052246, + 0.7898048162460327, + 0.8860621452331543, + 0.6010585427284241, + 1.2443572282791138, + 0.09230247139930725, + 1.322063684463501, + 0.2401014119386673, + 0.10430189222097397, + 0.6249082684516907, + 0.26299750804901123, + 0.003940347116440535, + 0.2516726851463318, + 2.076223373413086, + 0.6684199571609497, + 1.287322759628296, + 0.3987768888473511, + 0.707984983921051, + 0.17357932031154633, + 0.5594068169593811, + 0.9887188673019409, + 0.03568454086780548, + 1.7437864542007446, + 0.24299460649490356, + 0.13032035529613495, + 2.006112813949585, + 0.7195961475372314, + 0.26086491346359253, + 0.3743102550506592, + 0.4908822774887085, + 0.13479040563106537, + 0.680493175983429, + 0.008685790002346039, + 1.1826517581939697, + 0.683580219745636, + 0.0569118857383728, + 0.04791945219039917, + 0.9839538335800171, + 0.11316896975040436, + 0.030222930014133453, + 0.2739611566066742, + 0.5381839275360107, + 1.3884825706481934, + 0.050621408969163895, + 3.727792739868164, + 0.594207763671875, + 0.12932159006595612, + 0.03183061629533768, + 1.0757758617401123, + 0.8958529233932495, + 1.022218942642212, + 0.033143796026706696, + 0.09127800911664963 + ], + "product_id": 8110, + "product_metadata": { + "name": "Fastrack Men Economy 2 Analg Black Watch", + "gender": "Men", + "master_category": "Accessories", + "sub_category": "Watches", + "article_type": "Watches", + "base_color": "Black", + "season": "Winter", + "year": 2016, + "usage": "Casual", + "img_url": "http://assets.myntassets.com/v1/images/style/properties/112edfec7e1965c0f64ad9eb51cac579_images.jpg" + } + }, + { + "text_vector": [ + -0.03956003487110138, + -0.05192076042294502, + -0.016565263271331787, + -0.017883693799376488, + -0.04446249455213547, + 0.07840685546398163, + 0.022908033803105354, + 0.0297249723225832, + 0.021666724234819412, + -0.042004335671663284, + 0.036491334438323975, + -0.020826613530516624, + -0.011384925805032253, + -0.0344848558306694, + 0.01081444788724184, + 0.0299668088555336, + 0.07061894983053207, + 0.07840172946453094, + -0.022010738030076027, + -0.0417686365544796, + 0.04098844155669212, + 0.06144861876964569, + -0.017192916944622993, + 0.03961961716413498, + 0.008903353475034237, + -0.021294644102454185, + 0.06502147018909454, + -0.02258363924920559, + 0.03614065423607826, + 0.04043930396437645, + 0.0150381401181221, + 0.001416013459675014, + -0.014028999954462051, + 0.021732646971940994, + -0.013997831381857395, + -0.05819939076900482, + 0.01492339838296175, + -0.04468376934528351, + 0.012160065583884716, + -0.0076502482406795025, + 0.028832755982875824, + -0.005951658356934786, + 0.03970351442694664, + -0.004494499880820513, + 0.05108845606446266, + 0.001684092916548252, + 0.0008817344205453992, + 0.00411177147179842, + -0.02144204080104828, + -0.016585566103458405, + -0.016995076090097427, + -0.040488217025995255, + -0.03340740501880646, + -0.04477756842970848, + 0.009583275765180588, + -0.0041777896694839, + -0.009617364034056664, + 0.01585548184812069, + 0.019992783665657043, + 0.03840921074151993, + 0.02071666345000267, + 0.048083268105983734, + -0.02040758915245533, + 0.031000938266515732, + 0.06812821328639984, + 0.011646789498627186, + -0.013451592065393925, + 0.021772243082523346, + -0.02313109301030636, + -0.005434616003185511, + -0.021549349650740623, + -0.10607314109802246, + -0.036522530019283295, + -0.008935226127505302, + -0.00046331624616868794, + 0.002063275082036853, + -0.025387685745954514, + -0.062166258692741394, + -0.05370396375656128, + -0.031668320298194885, + 0.00983839575201273, + -0.019954970106482506, + 0.006308962125331163, + 0.007074798457324505, + -0.023327328264713287, + -0.023513520136475563, + 0.0017122860299423337, + 0.05278846621513367, + -0.04941856488585472, + 0.02338438294827938, + 0.048768550157547, + -0.03671479970216751, + 0.0022506334353238344, + 0.016642598435282707, + 0.04978928714990616, + 0.029524020850658417, + 0.004246348515152931, + -0.03375282883644104, + 0.005052380263805389, + -0.09444107115268707, + -0.021951669827103615, + 0.01118858065456152, + -0.06394816935062408, + -0.024740325286984444, + -0.047069650143384933, + -0.027928167954087257, + 0.03824741765856743, + 0.008375709876418114, + -0.04212179034948349, + -0.057052627205848694, + -0.008151791989803314, + 0.04589974507689476, + -0.003461139975115657, + 0.02935984916985035, + 0.02557174116373062, + 0.011775101535022259, + -0.05462843179702759, + 0.04555124789476395, + -0.0029484028927981853, + 0.03397729992866516, + 0.015107337385416031, + -0.003401111578568816, + -0.05916859954595566, + -0.02875794842839241, + -0.06419749557971954, + -0.02973351441323757, + -0.05374949797987938, + -0.04597564414143562, + -0.005265756044536829, + -0.009301926009356976, + -0.03200768679380417, + -0.09036583453416824, + 0.00596525939181447, + 0.01929308846592903, + -0.013600586913526058, + 0.008084025233983994, + 0.040482018142938614, + -0.026871684938669205, + 0.007261896505951881, + 0.0004182447446510196, + -0.06808318942785263, + -0.029019970446825027, + 0.05508573353290558, + 0.02634572982788086, + 0.01535020675510168, + -0.010003991425037384, + -0.008698824793100357, + -0.0002646228822413832, + -0.05140945687890053, + 0.032503534108400345, + 0.044848959892988205, + 0.058232903480529785, + -0.033173564821481705, + -0.009293976239860058, + -0.05428154021501541, + 0.020526200532913208, + 0.044397711753845215, + -0.004252791404724121, + 0.04932601377367973, + 0.012593874707818031, + -0.015860024839639664, + -0.047698624432086945, + 0.03696110472083092, + 0.011980089358985424, + 0.0882352888584137, + 0.028307363390922546, + -0.009236762300133705, + 0.04139421880245209, + -0.01428673043847084, + 0.009060285985469818, + 0.008297644555568695, + -0.055170029401779175, + 0.04544633999466896, + -0.04942453280091286, + -0.007710778620094061, + 0.028064457699656487, + -0.030963463708758354, + 0.07718689739704132, + 0.0027566237840801477, + -0.038773052394390106, + -0.015061534009873867, + -0.016916807740926743, + 0.010910352692008018, + -0.011073291301727295, + -0.02200395241379738, + 0.05179809406399727, + 0.006394921336323023, + 0.029666360467672348, + 0.008976570330560207, + -0.03630754351615906, + 0.021507438272237778, + 0.059086959809064865, + -0.01907721348106861, + -0.06743509322404861, + 0.007518804166465998, + 0.028413377702236176, + 0.022003235295414925, + -0.030189193785190582, + -0.008970558643341064, + 0.01926489733159542, + -0.028522029519081116, + -0.0193167794495821, + -0.017060134559869766, + -0.045428384095430374, + -0.044508494436740875, + -0.01804306171834469, + -0.03743087872862816, + 0.039115455001592636, + 0.03570073843002319, + -0.011416563764214516, + -0.07893043011426926, + -0.00017856041085906327, + -0.03673388436436653, + 0.029527951031923294, + 0.013893533498048782, + -0.04059378802776337, + 0.04404868930578232, + 0.05912346765398979, + -0.0014266785001382232, + 0.04332496598362923, + -0.034501731395721436, + -0.023464057594537735, + -0.03714970126748085, + -0.016034778207540512, + -0.0224074125289917, + 0.04273255914449692, + -0.02985221892595291, + 0.022388262674212456, + -0.03982994332909584, + 0.03242029622197151, + -0.012325557880103588, + 0.03556424379348755, + -0.04106668382883072, + 0.005439373664557934, + 0.021459177136421204, + -0.0029014211613684893, + -0.00997015368193388, + 0.007608452811837196, + -0.014376278966665268, + 0.01066827867180109, + 0.003606259124353528, + -0.015956250950694084, + -0.028990233317017555, + -0.00981700699776411, + 0.022149644792079926, + -0.040910061448812485, + 0.011101801879703999, + -0.035426340997219086, + -0.045448847115039825, + -0.019343417137861252, + 0.04644005000591278, + -0.04908820986747742, + 0.03372862562537193, + -1.5357936717919074e-05, + -0.017490990459918976, + 0.03395698219537735, + -0.03488814830780029, + -0.0026885552797466516, + 0.05528932437300682, + 0.028745420277118683, + -0.021850716322660446, + 0.007654757238924503, + -0.08122245222330093, + 0.06409380584955215, + 0.017351875081658363, + 0.0651145651936531, + 0.006867505144327879, + 0.03418561816215515, + 0.04023614898324013, + 0.014088406227529049, + -0.051756713539361954, + -0.04129195213317871, + -0.029904767870903015, + -0.024175116792321205, + -0.043152984231710434, + -0.026488255709409714, + 0.019789837300777435, + -0.000930867507122457, + -0.005714461673051119, + 0.01100038643926382, + -0.022661995142698288, + -0.007914056070148945, + 0.003336628433316946, + -0.006581802852451801, + 0.02294705994427204, + -0.028354482725262642, + -0.03277149796485901, + 0.025508716702461243, + 0.0004422290367074311, + 0.025802742689847946, + 0.009391884319484234, + -0.026124494150280952, + 0.03044079802930355, + 0.01530956570059061, + 0.009736836887896061, + -0.04797912389039993, + 0.05270855501294136, + 0.055098988115787506, + 0.016313651576638222, + 0.04324480891227722, + 0.06288357079029083, + -0.027349723502993584, + -0.030561428517103195, + -0.05802799388766289, + -0.017215121537446976, + -0.04114001616835594, + -0.053067129105329514, + 0.04155702143907547, + 0.04289903864264488, + 0.03753483295440674, + 0.0007087240810506046, + 0.018578344956040382, + 0.018868185579776764, + -0.06543438136577606, + 0.020044002681970596, + 0.058892060071229935, + 0.007617275230586529, + 0.029604831710457802, + 0.03405489772558212, + 0.03134297952055931, + -0.03529246523976326, + 0.03795549273490906, + 0.05348770320415497, + -0.013617906719446182, + -0.023200934752821922, + -0.008218797855079174, + -0.07394052296876907, + -0.03715420141816139, + 0.03513087332248688, + 0.042058855295181274, + 0.02620420604944229, + -0.06755802035331726, + 0.051118962466716766, + 0.010394330136477947, + -0.01278259139508009, + -0.00993038434535265, + 0.0308558139950037, + 0.07252795249223709, + 0.0220127385109663, + 0.0040824562311172485, + 0.0007463103393092752, + 0.023339498788118362, + -0.04487890377640724, + 0.026373937726020813, + 0.029762372374534607, + 0.003174752928316593, + 0.05934774503111839, + 0.03287826105952263, + 0.01308290846645832, + 0.06781511008739471, + 0.018234537914395332, + 0.01754545234143734, + 0.024301989004015923, + -0.05530458316206932, + 0.003774075536057353, + 0.02744685858488083, + -0.017314990982413292, + -0.08081077039241791, + -0.007002068683505058, + -0.07323342561721802, + -0.008447838015854359, + 0.04069642350077629, + -0.00932642724364996, + 0.032204050570726395, + -0.00659560551866889, + -0.004949540831148624, + -0.02603483945131302, + -0.029398318380117416, + -0.00928314495831728, + -0.02196144126355648, + 0.0018301015952602029, + -0.007904422469437122, + 0.0005092105711810291, + -0.07140916585922241, + -0.028058307245373726, + 0.03277812525629997, + -0.0073942504823207855, + -0.021603990346193314, + 0.09109500795602798, + 0.04317895695567131, + -0.016631418839097023, + -0.0802907720208168, + 0.008370758965611458, + -0.02433626353740692, + 0.013590562157332897, + 0.003019334515556693, + -0.052900638431310654, + -0.073338083922863, + 0.04442112147808075, + -0.010397600010037422, + -0.05481649190187454, + -0.024806730449199677, + 0.10984454303979874, + 0.039040643721818924, + 0.03666280210018158, + 0.013606199063360691, + -4.474953675526194e-05, + -0.01899411343038082, + 0.028372451663017273, + -0.0366457924246788, + 0.04137153550982475, + -0.00868742261081934, + 0.027902977541089058, + 0.04342607408761978, + -0.03017544187605381, + 0.002932980889454484, + -0.04826977103948593, + -0.02434515953063965, + -0.033879395574331284, + 0.010302910581231117, + -0.007286563515663147, + 0.07326517254114151, + 0.0401037260890007, + 0.00558432936668396, + -0.02631591446697712, + -0.000430387444794178, + -0.022164100781083107, + 0.004628400783985853, + -0.04068613424897194, + -0.015566384419798851, + 0.08617117255926132, + -0.0487537607550621, + -0.022408289834856987, + -0.006024583242833614, + 0.012579495087265968, + -0.007532813120633364, + 0.07973145693540573, + 0.06485648453235626, + 0.06120056286454201, + -0.0015694869216531515, + -0.024317918345332146, + -0.005312913563102484, + -0.030282847583293915, + 0.06815768778324127, + 0.0005326768732629716, + 0.0437849722802639, + -0.03810121864080429, + -0.005814483854919672, + -0.011266049928963184, + 0.10280797630548477, + 0.09189777076244354, + 0.021702326834201813, + -0.01264349464327097, + -0.028053050860762596, + 0.0009793220087885857, + -0.046445831656455994, + 0.0693051740527153, + -0.015621641650795937, + 8.636848360765725e-05, + 0.009677271358668804, + -0.04253571107983589, + -0.011456023901700974, + -0.058752208948135376, + -0.03249485790729523, + -0.01490005012601614, + 0.03026410937309265, + 0.014004429802298546, + -0.02266060560941696, + -0.021907877177000046, + 0.030311493203043938, + -0.010963384062051773, + -0.012667308561503887, + -0.031494732946157455, + 0.043011706322431564, + 0.019058914855122566, + -0.004501202143728733, + 0.01105163712054491, + -0.008308482356369495, + -0.060747940093278885, + 0.044928859919309616, + -0.11178917437791824, + -0.0014098059618845582, + 0.019301043823361397, + -0.04920295253396034, + 0.03295876830816269, + 0.029633186757564545, + 0.06770920008420944, + 0.015124795027077198, + 0.09169171005487442, + -0.02905994839966297, + 0.0034027236979454756, + 0.058476828038692474, + -0.01005456130951643, + -0.000158376875333488, + 0.003879532217979431, + -0.0301961712539196, + 0.05183778703212738, + 0.03158417344093323, + 0.002626537811011076, + -0.008326602168381214, + -0.06113799661397934, + -0.01786169223487377, + -0.0467352531850338, + 0.02326657436788082, + 2.3656717281122993e-33, + -0.028677860274910927, + 0.035635240375995636, + -0.028387198224663734, + -0.02743438258767128, + 0.01527384389191866, + -0.0385129451751709, + -0.020854907110333443, + -0.04454478994011879, + 0.007244074251502752, + -0.037942759692668915, + -0.08042734861373901, + 0.025716230273246765, + 0.025182103738188744, + 0.01697814278304577, + 0.006972965318709612, + 0.020797614008188248, + -0.00627667224034667, + -0.05542205646634102, + -0.0016238264506682754, + 0.012916574254631996, + -0.0018291305750608444, + 0.03003619611263275, + -0.014940589666366577, + 0.07038909196853638, + 0.05979009345173836, + 0.02160404436290264, + 0.014286847785115242, + -0.02266489341855049, + 0.05753885209560394, + -0.010777927935123444, + -0.009603074751794338, + 0.01375708170235157, + -0.03780260682106018, + 0.008290859870612621, + -0.05461787059903145, + 0.03700285032391548, + -0.004294147714972496, + -0.02837003581225872, + -0.023846115916967392, + 0.004466034006327391, + -0.019744660705327988, + -0.002924225525930524, + 0.04026307165622711, + 0.028615031391382217, + 0.044976864010095596, + -0.05278722941875458, + 5.385118129197508e-06, + -0.02870515175163746, + -0.024521712213754654, + 0.027570443227887154, + 0.016013355925679207, + 0.011553388088941574, + -0.012581265531480312, + 0.03274144232273102, + 0.02516329102218151, + -0.009276021271944046, + 0.029599158093333244, + -0.04184763506054878, + -0.03631838411092758, + -0.025860074907541275, + -0.003001891076564789, + -0.08493314683437347, + 0.02952473610639572, + 0.08161576092243195, + 0.0402715839445591, + -0.034087732434272766, + -0.08007760345935822, + -0.043079786002635956, + 0.08720294386148453, + -0.05059853568673134, + 0.0052619255147874355, + 0.010319202207028866, + 0.037685833871364594, + -0.007552167866379023, + 0.014637826941907406, + -0.0011432747123762965, + 0.005868519656360149, + 0.012429840862751007, + 0.010196229442954063, + 0.028840765357017517, + -0.006264987867325544, + 0.04905891418457031, + -0.06319470703601837, + 0.01260288991034031, + 0.014913097955286503, + -0.009293897077441216, + 0.003462578170001507, + 0.0001805968931876123, + 0.008305804803967476, + 0.008070412091910839, + -0.018847357481718063, + -0.0034087190870195627, + 0.07513313740491867, + 0.0014054011553525925, + 0.01277135219424963, + 0.038170233368873596, + -0.01808798313140869, + 0.0065773604437708855, + 0.013279357925057411, + 0.0018370486795902252, + 0.051548149436712265, + 0.024498948827385902, + -0.03463633731007576, + -0.005185497924685478, + 0.0014672870747745037, + 0.023402143269777298, + 0.06215527281165123, + -0.022442664951086044, + 0.0010364061454311013, + -0.03231532499194145, + 0.010091062635183334, + 0.03819097951054573, + -0.004580085631459951, + -0.020236315205693245, + 0.019944457337260246, + -0.0027927355840802193, + 0.038903381675481796, + -0.01039612852036953, + -0.11939845234155655, + 0.06172969192266464, + 0.04095638543367386, + -0.03659221529960632, + 0.04535942152142525, + 0.06896329671144485, + 0.011177311651408672, + -0.0039002778939902782, + 0.012844162993133068, + 0.025989897549152374, + -0.056616488844156265, + 0.003058888716623187, + 0.00906009878963232, + -0.04173022136092186, + 0.04562085494399071, + -0.02005867473781109, + -0.054382164031267166, + 0.007389802020043135, + 0.008663522079586983, + -0.03430453687906265, + -0.002784421667456627, + -0.0856945812702179, + -0.0036015009973198175, + -0.018625305965542793, + -0.023886365815997124, + 0.022476352751255035, + -0.01651320420205593, + -0.017765920609235764, + 0.06964459270238876, + -0.012316765263676643, + 0.05442800000309944, + -0.04688715189695358, + -0.010295277461409569, + 0.00968359224498272, + -0.026274345815181732, + 0.046209417283535004, + -0.05714612454175949, + -0.02214876003563404, + 0.021787982434034348, + 0.05518588796257973, + 0.01059794519096613, + 0.03816456347703934, + 0.006303540430963039, + -0.003514328505843878, + -0.03439072519540787, + 0.0773424580693245, + 0.028778867796063423, + -0.042821235954761505, + 0.010553059168159962, + -0.020202763378620148, + 0.02343585714697838, + -0.011736290529370308, + 0.043159857392311096, + 0.003763687564060092, + 0.012779084034264088, + 0.023794421926140785, + 0.03339771553874016, + -0.0394255705177784, + 0.0636887177824974, + -0.03930488973855972, + -0.042592719197273254, + -0.013996570371091366, + -0.07885351777076721, + -0.06991739571094513, + 0.011072161607444286, + -0.06076990067958832, + 0.023256590589880943, + -0.0019119804492220283, + -0.036017946898937225, + -0.018028782680630684, + 0.02710127644240856, + 0.029161972925066948, + 0.003853263333439827, + 0.029943156987428665, + 0.034356772899627686, + 0.015962539240717888, + -0.03488188609480858, + -0.032041653990745544, + 0.05547862499952316, + -0.06453918665647507, + -0.023464346304535866, + 0.03936050087213516, + 0.011054802685976028, + 0.000932927883695811, + 0.030312173068523407, + -0.017649976536631584, + -0.05459408089518547, + -0.005230151582509279, + -0.017772700637578964, + -0.053355395793914795, + 0.04476327821612358, + -0.034560006111860275, + -0.01259594690054655, + -0.003704596543684602, + 0.024273045361042023, + -0.01055475790053606, + -0.0007581421523354948, + 0.0003091568360105157, + -0.0030861031264066696, + 0.026297489181160927, + 0.01657555066049099, + -0.04986121132969856, + 0.002020491985604167, + -0.026467733085155487, + -0.011071037501096725, + 0.010809422470629215, + 0.04629097506403923, + 0.022463776171207428, + -0.0068094185553491116, + -0.00203889817930758, + -0.011706141754984856, + -0.015448829159140587, + -0.05611571669578552, + -0.003946317359805107, + 0.009573496878147125, + -0.0691712275147438, + 0.011461438611149788, + 0.026747412979602814, + 0.06403791159391403, + 0.08264223486185074, + 0.08029738068580627, + 0.027380097657442093, + -0.031971849501132965, + 0.031938254833221436, + -0.009089910425245762, + 0.005243627354502678, + 0.00019165391859132797, + 0.01904524303972721, + 0.03720887377858162, + 0.008953647688031197, + -0.0382532924413681, + -0.057662513107061386, + -0.010122004896402359, + 0.0056761158630251884, + -0.008714662864804268, + 0.041868068277835846, + -0.06813554465770721, + -0.02996354177594185, + 0.0026129817124456167, + 0.019943125545978546, + -0.012777391821146011, + -0.07619009912014008, + -0.0056306361220777035, + 0.011548282578587532, + 0.037620220333337784, + -0.059756286442279816, + 0.006323606241494417, + -0.008257483132183552, + 0.04157789424061775, + 0.029362956061959267, + -0.018854595720767975, + -0.0098319286480546, + 0.04549318179488182, + -0.005879865027964115, + 0.03167739510536194 + ], + "img_vector": [ + 1.4938853979110718, + 0.24139609932899475, + 1.131054162979126, + 0.1810753047466278, + 0.3637487590312958, + 0.6875102519989014, + 2.0224709510803223, + 0.2941369116306305, + 1.8726948499679565, + 2.7465879917144775, + 0.44412121176719666, + 0.6346420645713806, + 0.9876911640167236, + 0.821234405040741, + 0.005170317832380533, + 0.7949967384338379, + 0.04615236446261406, + 0.8767532706260681, + 0.3433084189891815, + 0.30413225293159485, + 0.8994442820549011, + 0.48238420486450195, + 1.8604705333709717, + 0.9210008382797241, + 0.40842205286026, + 0.28850340843200684, + 0.7270486950874329, + 1.154633641242981, + 0.6082801222801208, + 0.6392159461975098, + 0.28570401668548584, + 0.435669481754303, + 0.8858022689819336, + 1.973506212234497, + 0.5675477981567383, + 0.008614929392933846, + 1.1604024171829224, + 0.4109009802341461, + 1.3524186611175537, + 0.017363978549838066, + 0.024865763261914253, + 0.012908240780234337, + 0.004678706638514996, + 0.4119618833065033, + 0.2732241153717041, + 0.14510616660118103, + 0.6660646200180054, + 0.1148010641336441, + 0.2920435070991516, + 0.36072251200675964, + 1.2710176706314087, + 2.8436989784240723, + 0.5273248553276062, + 0.22220788896083832, + 2.2567269802093506, + 0.3823893666267395, + 0.038808539509773254, + 1.3385392427444458, + 1.2586040496826172, + 0.18111984431743622, + 0.047796864062547684, + 0.34817439317703247, + 0.018567292019724846, + 0.38849329948425293, + 0.16486267745494843, + 0.041021160781383514, + 0.28197813034057617, + 0.07154709845781326, + 0.5517598390579224, + 0.015888085588812828, + 0.3470703959465027, + 2.2582666873931885, + 0.38925793766975403, + 0.014621037989854813, + 1.105770230293274, + 0.41556447744369507, + 1.5077919960021973, + 0.5181179642677307, + 0.9355340003967285, + 0.12701475620269775, + 0.33716854453086853, + 3.8470511436462402, + 1.6164942979812622, + 0.061706479638814926, + 0.8683338761329651, + 0.027707582339644432, + 0.013184858486056328, + 0.41109007596969604, + 0.1106315404176712, + 0.24017579853534698, + 0.17355728149414062, + 0.352239727973938, + 0.4978903532028198, + 0.55988609790802, + 0.8547915816307068, + 1.1907637119293213, + 1.5348354578018188, + 0.09794571995735168, + 0.6044095158576965, + 0.013331381604075432, + 0.2327936738729477, + 2.221573829650879, + 0.1726379543542862, + 0.020145928487181664, + 0.42134132981300354, + 4.763510227203369, + 0.7185640335083008, + 0.03154059499502182, + 0.11734503507614136, + 3.1852903366088867, + 0.4653855264186859, + 0.48472750186920166, + 0.6504601240158081, + 1.880314826965332, + 0.20760998129844666, + 0.7506809830665588, + 0.5027838945388794, + 5.558551788330078, + 0.33432015776634216, + 0.06906022131443024, + 0.4678272604942322, + 1.2655304670333862, + 0.36804652214050293, + 0.0999298021197319, + 0.8990201950073242, + 0.0651337206363678, + 1.3693125247955322, + 0.7462950944900513, + 0.5252841114997864, + 0.8934602737426758, + 0.20053251087665558, + 1.745174765586853, + 0.2621590495109558, + 0.9130530953407288, + 0.22606196999549866, + 0.12764430046081543, + 1.4584379196166992, + 0.2747681438922882, + 0.9977239370346069, + 0.39415714144706726, + 0.9975500106811523, + 0.4457828402519226, + 0.49890264868736267, + 1.9690587520599365, + 1.1663585901260376, + 0.11856219172477722, + 0.06459268927574158, + 1.2313330173492432, + 0.15239554643630981, + 0.6989741325378418, + 0.4055025577545166, + 0.4913269281387329, + 0.9282734394073486, + 0.03393394872546196, + 0.0512971356511116, + 0.5724825263023376, + 0.6229320764541626, + 0.9174453020095825, + 0.18941769003868103, + 0.3969208896160126, + 2.7637522220611572, + 0.06034400686621666, + 0.1047993078827858, + 3.865389823913574, + 2.578909158706665, + 0.27485260367393494, + 0.77419513463974, + 2.0994646549224854, + 0.01585269160568714, + 0.9283961057662964, + 2.1078855991363525, + 0.020171815529465675, + 0.23450171947479248, + 0.2272941768169403, + 2.726775884628296, + 0.025467712432146072, + 0.0018708937568590045, + 0.3761393129825592, + 0.34419262409210205, + 0.9711661338806152, + 1.0305192470550537, + 0.39461660385131836, + 0.2857527732849121, + 0.46718448400497437, + 0.12061874568462372, + 0.23161852359771729, + 0.653630256652832, + 0.9762458205223083, + 0.03882816433906555, + 0.27001580595970154, + 2.286098003387451, + 0.010140842758119106, + 1.219992995262146, + 0.31628432869911194, + 0.05897148326039314, + 0.3317827880382538, + 0.654693067073822, + 0.792682409286499, + 0.4212881922721863, + 0.43955570459365845, + 0.050201479345560074, + 1.6883554458618164, + 0.8914614319801331, + 0.0, + 0.5062851309776306, + 0.20334354043006897, + 2.482614040374756, + 0.60190349817276, + 0.0857115387916565, + 0.2626751959323883, + 0.3886306583881378, + 0.5596953630447388, + 0.0034243050031363964, + 0.40611380338668823, + 0.048733681440353394, + 0.015632936730980873, + 1.7728796005249023, + 0.31308096647262573, + 0.05932054668664932, + 0.9837939739227295, + 0.3693715035915375, + 0.22048570215702057, + 0.917412519454956, + 0.8713879585266113, + 0.0006016638944856822, + 0.422598659992218, + 0.46377313137054443, + 0.12921059131622314, + 0.1378568708896637, + 0.043600354343652725, + 0.9465663433074951, + 1.4301570653915405, + 0.10690557956695557, + 0.019444884732365608, + 0.31817561388015747, + 0.0974576398730278, + 0.4335589110851288, + 1.4914262294769287, + 0.12609821557998657, + 0.7752360105514526, + 0.557702362537384, + 0.12304127216339111, + 3.187499761581421, + 0.4694543182849884, + 0.010506571270525455, + 0.25651559233665466, + 0.02736404724419117, + 0.6649688482284546, + 4.431206226348877, + 0.1988416165113449, + 0.7556383609771729, + 0.49852967262268066, + 0.9520439505577087, + 0.06960975378751755, + 0.48046889901161194, + 1.8312454223632812, + 0.07900815457105637, + 1.7756098508834839, + 0.18784523010253906, + 0.040981557220220566, + 0.7334564924240112, + 3.4111926555633545, + 0.0393139012157917, + 0.8263912796974182, + 0.1573135256767273, + 0.1513597071170807, + 0.34052351117134094, + 0.8103253841400146, + 0.655732274055481, + 2.249526262283325, + 0.10419811308383942, + 0.25299787521362305, + 0.6740222573280334, + 1.9716986417770386, + 0.6432756185531616, + 0.21635928750038147, + 1.57355797290802, + 0.25777941942214966, + 2.203857660293579, + 0.9070361256599426, + 1.1828185319900513, + 0.7377543449401855, + 0.7369240522384644, + 0.2669963538646698, + 2.9789092540740967, + 0.3545466959476471, + 0.13611581921577454, + 0.8029289245605469, + 0.8413907885551453, + 0.9169182181358337, + 0.34259486198425293, + 0.07380985468626022, + 0.5203127264976501, + 1.7527437210083008, + 0.34951314330101013, + 0.3516063988208771, + 0.6289893984794617, + 0.7310518622398376, + 1.2737241983413696, + 0.2716093957424164, + 4.232484817504883, + 0.9968029856681824, + 0.1278645396232605, + 0.003290054854005575, + 0.34459924697875977, + 0.02537645399570465, + 3.4949543476104736, + 0.059621650725603104, + 0.5571537613868713, + 0.3231731355190277, + 0.256262868642807, + 2.179823637008667, + 0.22787992656230927, + 0.13078656792640686, + 0.7623313069343567, + 0.16983948647975922, + 1.3611606359481812, + 0.0351678729057312, + 1.012725830078125, + 1.0911778211593628, + 0.13410203158855438, + 1.419508934020996, + 1.6845264434814453, + 0.021370956674218178, + 0.6053026914596558, + 0.09465710073709488, + 0.3254464864730835, + 0.45975276827812195, + 0.2243175506591797, + 0.18977338075637817, + 0.014142055995762348, + 0.011168931610882282, + 1.0240275859832764, + 1.1688612699508667, + 0.4141140878200531, + 0.3918728828430176, + 0.3855869472026825, + 0.11653701961040497, + 0.014498773962259293, + 1.3883904218673706, + 0.09559828788042068, + 1.9660215377807617, + 0.6778882145881653, + 1.0829894542694092, + 0.06397857517004013, + 0.01732052117586136, + 1.1504909992218018, + 1.3759924173355103, + 0.0627686083316803, + 0.42889153957366943, + 0.430999755859375, + 0.8407799601554871, + 0.07544046640396118, + 0.4796835482120514, + 0.5401620864868164, + 0.5974308848381042, + 2.0423712730407715, + 2.3662736415863037, + 0.1360752284526825, + 0.12918895483016968, + 1.2664458751678467, + 1.603205919265747, + 2.5599873065948486, + 1.6732289791107178, + 1.0271077156066895, + 0.18132364749908447, + 0.8940284252166748, + 0.8279848098754883, + 2.0483574867248535, + 2.041257858276367, + 0.09561240673065186, + 0.7693163156509399, + 0.025312675163149834, + 2.3041818141937256, + 1.809356689453125, + 0.32985764741897583, + 0.14901605248451233, + 0.8835480213165283, + 0.12754516303539276, + 1.3410577774047852, + 0.4222751557826996, + 0.6922367811203003, + 0.5369821786880493, + 0.3105478882789612, + 0.0, + 0.18506155908107758, + 1.130815029144287, + 1.971065640449524, + 0.4446471929550171, + 0.2073221057653427, + 1.4708002805709839, + 1.0431690216064453, + 0.1379164755344391, + 0.043842341750860214, + 0.28658008575439453, + 0.06018945947289467, + 0.09314017742872238, + 0.7134373784065247, + 2.0590012073516846, + 0.25134992599487305, + 0.43295997381210327, + 0.3844310939311981, + 0.315731942653656, + 1.2644526958465576, + 0.30650633573532104, + 0.0024292347952723503, + 1.6356632709503174, + 0.7341170310974121, + 0.2436022311449051, + 0.8456516861915588, + 0.08483622223138809, + 0.7762656807899475, + 0.9089807271957397, + 0.03320164978504181, + 0.7838379144668579, + 1.3481323719024658, + 1.283592700958252, + 1.1046751737594604, + 0.3032504916191101, + 0.8944272994995117, + 0.04955345392227173, + 0.8805413246154785, + 0.2880385220050812, + 0.6145410537719727, + 0.6912974715232849, + 0.1930430680513382, + 0.26780593395233154, + 0.9327908158302307, + 0.2276986986398697, + 3.0140249729156494, + 0.4428110718727112, + 1.1905831098556519, + 0.9928894639015198, + 1.0988762378692627, + 0.45524975657463074, + 0.3587692677974701, + 0.3822312355041504, + 0.323091983795166, + 0.8857821226119995, + 0.11823158711194992, + 1.062369465827942, + 0.3242979943752289, + 1.2425428628921509, + 0.025485660880804062, + 0.15931929647922516, + 0.8871098160743713, + 0.06915843486785889, + 0.2272469848394394, + 1.2359329462051392, + 0.010372296907007694, + 0.038248494267463684, + 0.03228116035461426, + 0.3128824532032013, + 0.4886026978492737, + 0.5953666567802429, + 0.9679567813873291, + 0.20759081840515137, + 0.6370733380317688, + 0.21096189320087433, + 0.2741597294807434, + 0.17469191551208496, + 0.5566078424453735, + 0.8737033009529114, + 0.7346972823143005, + 0.15648745000362396, + 1.750422716140747, + 0.008586949668824673, + 0.5328765511512756, + 0.9480359554290771, + 0.6931679248809814, + 0.06247229501605034, + 0.42257705330848694, + 1.472716212272644, + 0.6056021451950073, + 0.30037182569503784, + 1.1690608263015747, + 0.46925121545791626, + 0.048942744731903076, + 0.8650917410850525, + 0.5276799201965332, + 0.032549455761909485, + 0.3601825535297394, + 0.02722950652241707, + 0.4794684052467346, + 2.2764618396759033, + 0.8081153035163879, + 1.1730848550796509, + 0.19443339109420776, + 0.24625937640666962, + 0.10062640905380249, + 0.16277572512626648, + 0.012864487245678902, + 0.501074492931366, + 0.9416172504425049, + 0.04482325166463852, + 0.008391566574573517, + 0.4685932993888855, + 0.024174371734261513, + 0.10270687192678452, + 0.23297233879566193, + 1.4293732643127441, + 0.1546536684036255, + 0.09302748739719391, + 2.2711963653564453, + 0.2795150578022003, + 0.44962161779403687, + 0.36339086294174194, + 0.4967893362045288, + 1.0447256565093994, + 0.8269402384757996, + 0.21591688692569733, + 0.0 + ], + "product_id": 56670, + "product_metadata": { + "name": "Maxima Men Black Dial Watch", + "gender": "Men", + "master_category": "Accessories", + "sub_category": "Watches", + "article_type": "Watches", + "base_color": "Black", + "season": "Winter", + "year": 2016, + "usage": "Casual", + "img_url": "http://assets.myntassets.com/v1/images/style/properties/Maxima-Men-Black-Dial-Watch_c427a05e5f1d545b2b03ad86b4960427_images.jpg" + } + }, + { + "text_vector": [ + 0.0183278638869524, + -0.08557531982660294, + -0.01639784686267376, + 0.02346842549741268, + -0.04447575658559799, + 0.035850800573825836, + 0.04396527633070946, + 0.07349296659231186, + 0.06268049776554108, + -0.05232634395360947, + 0.01782047562301159, + -0.010913203470408916, + -0.0025780205614864826, + -0.04168076068162918, + -0.03205004334449768, + 0.03464997932314873, + 0.06643923372030258, + 0.049483995884656906, + -0.019035475328564644, + -0.015559760853648186, + 0.046482060104608536, + 0.04973935708403587, + 0.011547323316335678, + 0.07074014097452164, + 0.04821221902966499, + 0.0037262572441250086, + 0.019987130537629128, + -0.020384570583701134, + 0.020874228328466415, + 0.04923732578754425, + -0.042636942118406296, + -0.049207255244255066, + 0.023372309282422066, + 0.003453217912465334, + -0.0434214323759079, + -0.01994912326335907, + 0.038452908396720886, + -0.01601421646773815, + 0.07969017326831818, + 0.018299682065844536, + 0.040694329887628555, + -0.003977510612457991, + 0.06727933883666992, + -0.009639446623623371, + -0.009918653406202793, + 0.003530436661094427, + -0.002863094210624695, + 0.019610032439231873, + 0.0017718904418870807, + -0.05626828968524933, + -0.007691100239753723, + -0.07202600687742233, + 0.022678975015878677, + -0.0051254089921712875, + -0.024634385481476784, + 0.038630977272987366, + 0.012301089242100716, + -0.004852581769227982, + 0.008163674734532833, + 0.01873301900923252, + -0.0006467404309660196, + 0.10083527117967606, + 0.0007773932884447277, + 0.03311818465590477, + 0.027676159515976906, + -0.0062120272777974606, + -0.005190867930650711, + 0.014215715229511261, + -0.0347461961209774, + 0.03389207273721695, + -0.0039015512447804213, + 0.007164570037275553, + -0.027584699913859367, + 0.015538237988948822, + 0.006798513233661652, + -0.021373944357037544, + 0.053439244627952576, + -0.05118982121348381, + -0.09986051917076111, + -0.0218923669308424, + 0.015403950586915016, + 0.04642897844314575, + 0.007986582815647125, + 0.017908059060573578, + -0.06790448725223541, + -0.024380648508667946, + -0.01766284368932247, + -0.0036361345555633307, + -0.06017634645104408, + -0.001904766191728413, + 0.022068344056606293, + -0.10214364528656006, + -0.03226622939109802, + 0.006078142207115889, + 0.01945854164659977, + 0.02628893032670021, + -0.07679011672735214, + -0.045392852276563644, + 0.017468782141804695, + -0.07918298989534378, + 0.0008098791004158556, + -0.0304928719997406, + 0.002669526496902108, + -0.01702047325670719, + -0.05188878998160362, + 0.023659242317080498, + -0.025324003770947456, + 0.01083297561854124, + -0.019688740372657776, + -0.05325676128268242, + -0.027245057746767998, + 0.05770793557167053, + -0.0052609313279390335, + -0.0018099457956850529, + -0.003693910548463464, + 0.047722071409225464, + -0.0069903600960969925, + 0.05359112471342087, + -0.05140037462115288, + 0.05183808133006096, + 0.02641567401587963, + -0.007837040349841118, + -0.04235898703336716, + -0.04416070878505707, + 0.0353168286383152, + -0.01782234199345112, + -0.037064097821712494, + 0.02082264982163906, + 0.013730335049331188, + -0.008474173955619335, + -0.01846110261976719, + -0.03494376689195633, + 0.023081665858626366, + 0.043478671461343765, + 0.003958097193390131, + 0.031230289489030838, + 0.025325477123260498, + -0.015049143694341183, + -0.02230280637741089, + -0.04863940551877022, + -0.045947469770908356, + -0.07384620606899261, + 0.017736878246068954, + -0.004012310411781073, + 0.015916733071208, + -0.028816791251301765, + -0.01459841150790453, + 0.056307412683963776, + 0.0060439808294177055, + -0.056439127773046494, + -0.02268831804394722, + -0.03475048765540123, + 0.023143576458096504, + -0.0036008995957672596, + 0.023789923638105392, + 0.01669148914515972, + -0.033186133950948715, + -0.017886793240904808, + 0.09095565974712372, + 0.0009061623713932931, + -0.021965282037854195, + -0.07721830904483795, + 0.010647841729223728, + 0.001766208908520639, + 0.08275290578603745, + -0.013540989719331264, + -0.004876506049185991, + -0.006270037032663822, + -0.022532612085342407, + 0.001430183183401823, + -0.001404542475938797, + -0.04240868613123894, + 0.057646043598651886, + -0.05380043759942055, + 0.014124871231615543, + 0.040167201310396194, + -0.07077403366565704, + 0.016488434746861458, + 0.0006785857258364558, + -0.014187758788466454, + -0.07296887040138245, + 0.01701742224395275, + 0.02996133081614971, + 0.02202329784631729, + -0.007949523627758026, + 0.023809589445590973, + -0.03564988449215889, + 0.004810665734112263, + 0.0035483166575431824, + -0.009615768678486347, + 0.029309237375855446, + 0.04389377683401108, + -0.03922554850578308, + 0.03115563467144966, + -0.043333422392606735, + 0.03735969960689545, + -0.007226571906358004, + 0.004127812571823597, + 0.008898481726646423, + -0.0020907025318592787, + 0.009935172274708748, + -0.033700309693813324, + 0.023371247574687004, + -0.04550548270344734, + -0.0717545822262764, + -0.015112417750060558, + -0.036551591008901596, + 0.03087913803756237, + -0.0008238752488978207, + -0.001402894500643015, + -0.03456311672925949, + -0.023418618366122246, + -0.022316111251711845, + -0.0235427375882864, + 0.014887372963130474, + -0.04081474244594574, + 0.04530085250735283, + 0.06676586717367172, + -0.013828451745212078, + 0.016807598993182182, + -0.02406356856226921, + -0.005335431545972824, + -0.038991235196590424, + -0.022143058478832245, + -0.01861720345914364, + 0.019817745313048363, + 0.00241735577583313, + -0.012944117188453674, + -0.00899256020784378, + 0.036388177424669266, + -0.00045292743016034365, + -0.006683987099677324, + -0.03843281790614128, + -0.00955294631421566, + 0.030964065343141556, + -0.041956111788749695, + -0.05463062971830368, + -0.017400117591023445, + -0.022869423031806946, + 0.051699500530958176, + -0.0028473087586462498, + -0.02147676981985569, + 0.016629185527563095, + -0.0319463349878788, + 0.021846825256943703, + 0.014299665577709675, + 0.021350925788283348, + 0.02076391503214836, + -0.025106074288487434, + 0.059485774487257004, + 0.003144617425277829, + -0.019444499164819717, + -0.04235118627548218, + 0.0006749371532350779, + -0.08672863990068436, + 0.03704950585961342, + -0.04926178231835365, + 0.00622361758723855, + 0.03626594319939613, + 0.04405701160430908, + -0.005693275947123766, + -0.02023283950984478, + -0.05406714603304863, + 0.09144704043865204, + 0.008654670789837837, + 0.03185208886861801, + -0.03148077055811882, + -0.009005228988826275, + 0.03972728177905083, + 0.019106104969978333, + -0.03981325030326843, + -0.06340786069631577, + -0.014576331712305546, + -0.005337414797395468, + -0.010596995241940022, + -0.030954644083976746, + 0.09982352703809738, + 0.007078897673636675, + -0.021051088348031044, + 0.024343246594071388, + 0.0020763680804520845, + 0.05401410534977913, + 0.010327691212296486, + -0.025604575872421265, + 0.04889039695262909, + -0.03063907101750374, + -0.011179237626492977, + -0.0193896796554327, + -0.027571510523557663, + 0.01210660021752119, + -0.017734237015247345, + 0.04110557585954666, + 0.023082200437784195, + 0.0008907023584470153, + -0.030391687527298927, + -0.02104724571108818, + 0.05938413366675377, + 0.041880980134010315, + -0.006360464729368687, + 0.08025448024272919, + 0.020168988034129143, + 0.0013118934584781528, + -0.01829085312783718, + -0.020459318533539772, + 0.016080301254987717, + 0.0030012307688593864, + 0.000928244087845087, + 0.0014508015010505915, + 0.03850356861948967, + 0.04154375568032265, + -0.0161654744297266, + 0.05430403724312782, + 0.008814945816993713, + -0.03591149300336838, + 0.033305052667856216, + 0.03716545179486275, + 0.01825706474483013, + 0.04709524288773537, + 0.04102051630616188, + 0.019658399745821953, + -0.014208444394171238, + -0.006376851350069046, + 0.024370254948735237, + -0.007813869044184685, + -0.08648600429296494, + -0.03403620049357414, + 0.0291670560836792, + -0.03849663585424423, + 0.02369462512433529, + 0.048108212649822235, + 0.001878133974969387, + -0.03508971631526947, + 0.04280194267630577, + -0.03333287686109543, + -0.02177763544023037, + 0.010671540163457394, + 0.03972479701042175, + 0.079188771545887, + 0.03148414567112923, + 0.015064163133502007, + 0.030877413228154182, + 0.02366682142019272, + 0.034263741225004196, + 0.05088524520397186, + 0.026368098333477974, + 0.05606093630194664, + 0.07373474538326263, + -0.013078629970550537, + -0.019298873841762543, + 0.006265813019126654, + -0.03107643686234951, + -0.014144562184810638, + 0.02006424590945244, + 0.008283165283501148, + 0.010316642932593822, + 0.024152543395757675, + -0.03197363018989563, + -0.0028969983104616404, + -0.0047971042804419994, + -0.03117867186665535, + -0.00183815136551857, + 0.07147055119276047, + -0.008389076218008995, + 0.027554942294955254, + 0.010166490450501442, + -0.015292402356863022, + -0.02464534528553486, + 0.015069207176566124, + 0.026128362864255905, + 0.015938591212034225, + -0.010175530798733234, + -0.061801254749298096, + 0.007945163175463676, + 0.002627711743116379, + -0.04717644676566124, + -0.0017786540556699038, + -0.0020174700766801834, + -0.010545131750404835, + 0.014068122953176498, + 0.005539966747164726, + 0.02624160423874855, + -0.04852340370416641, + 0.0028258308302611113, + -0.002228067023679614, + 0.04166064411401749, + 0.034450408071279526, + -0.03978258743882179, + -0.07826315611600876, + -0.003705840790644288, + -0.061387766152620316, + -0.045448776334524155, + -0.007163676433265209, + 0.07734742760658264, + 0.023851439356803894, + 0.07986956089735031, + 0.024746689945459366, + -0.021377716213464737, + 0.03548015281558037, + -0.08263780176639557, + -0.0277362372726202, + 0.011457042768597603, + 0.008104542270302773, + 0.007727656047791243, + 0.06961733847856522, + -0.05583324283361435, + 0.014991270378232002, + 0.00823261309415102, + -0.04660917446017265, + -0.036464858800172806, + -0.020868748426437378, + 0.006777886301279068, + 0.0660518929362297, + 0.01308445818722248, + -0.02211332879960537, + -0.015200594440102577, + -0.007794510573148727, + -0.047047097235918045, + -0.08564605563879013, + -0.047107893973588943, + -0.029468640685081482, + 0.040037255734205246, + -0.03159831836819649, + 0.014037721790373325, + -0.00274373940192163, + 0.04860607907176018, + -0.015040924772620201, + 0.0298844613134861, + 0.07683723419904709, + 0.07795288413763046, + 0.04357053339481354, + 0.06872818619012833, + 0.012610365636646748, + -0.00020954801584593952, + 0.052484605461359024, + 0.025141775608062744, + 0.022129308432340622, + -0.040230926126241684, + -0.0014727351954206824, + -0.023774106055498123, + 0.08647941052913666, + 0.02003561146557331, + 0.016207056120038033, + 0.008097137324512005, + -0.04444299638271332, + -0.0205804705619812, + -6.753311754437163e-05, + -0.03338799625635147, + -0.008887667208909988, + 0.006482749246060848, + -0.019602617248892784, + 0.00030552534735761583, + 0.006111313123255968, + -0.09385306388139725, + -0.0650624930858612, + -0.03251264989376068, + 0.008160965517163277, + -0.002608125563710928, + -0.012109663337469101, + 0.011094792746007442, + 0.015582113526761532, + 0.04694809392094612, + 0.025582890957593918, + -0.012976945377886295, + 0.05071472004055977, + 0.05287140980362892, + -0.015838878229260445, + 0.012026030570268631, + 0.018277378752827644, + -0.021923229098320007, + 0.05436006560921669, + -0.11034297198057175, + 0.015374805778265, + 0.016437843441963196, + -0.00805028434842825, + -0.006506892386823893, + -0.017801426351070404, + 0.0350545197725296, + -0.049973901361227036, + 0.06945165246725082, + 0.0012498819269239902, + 0.01967363990843296, + 0.030175890773534775, + -0.0016369972145184875, + -0.01644076593220234, + 0.017056699842214584, + 0.0204275194555521, + 0.07796315848827362, + 0.0574352853000164, + -0.0048292456194758415, + -0.0017676736460998654, + -0.03185370936989784, + -0.07346700876951218, + -0.022038593888282776, + 0.054246850311756134, + 2.630661399237252e-33, + -0.0007876625168137252, + 0.024711377918720245, + 0.028263453394174576, + 0.038497671484947205, + -0.029503747820854187, + -0.047779832035303116, + 0.027024542912840843, + -0.04133862257003784, + 0.03019760735332966, + -0.05125850811600685, + -0.03708714246749878, + -0.010080607607960701, + 0.02395099774003029, + 0.011153537780046463, + 0.022210044786334038, + -0.014929835684597492, + -0.007625039666891098, + -0.026731057092547417, + -0.018162613734602928, + 0.0027316773775964975, + 0.009445802308619022, + -0.01717906817793846, + 0.019089022651314735, + -0.034599725157022476, + 0.03478742018342018, + -0.02079869993031025, + 0.02117849700152874, + -0.06173408031463623, + 0.03535124287009239, + 0.010899416171014309, + 0.03210896626114845, + -0.010628988035023212, + -0.03593757003545761, + -0.0043421415612101555, + -0.029418103396892548, + -0.007072690408676863, + -0.012125442735850811, + -0.010493642650544643, + -0.004884706344455481, + 0.012880418449640274, + -0.005943458992987871, + -0.04631143808364868, + 0.009311030618846416, + 0.07077532261610031, + 0.028052758425474167, + -0.09242375195026398, + -0.017878223210573196, + -0.04087190330028534, + -0.016821548342704773, + 0.05323490872979164, + 0.00021553572150878608, + 0.04130404070019722, + 0.029101213440299034, + -0.051760025322437286, + -0.029906712472438812, + -0.06049632281064987, + -0.005484390538185835, + -0.051773373037576675, + -0.02513473853468895, + -0.02125566452741623, + -0.014477051794528961, + -0.016667108982801437, + -0.029735155403614044, + 0.0524720773100853, + 0.0007396599394269288, + -0.0011976333335042, + -0.04671988636255264, + 0.017543671652674675, + 0.04998365044593811, + -0.009093948639929295, + 0.014882790856063366, + 0.00451275147497654, + 0.02709638699889183, + 0.017909929156303406, + -0.012215646915137768, + 0.0008179382421076298, + -0.0028897193260490894, + 0.00221558241173625, + 0.02652423083782196, + 0.050282351672649384, + -0.027550380676984787, + 0.046289484947919846, + -0.025119272992014885, + 0.05534017086029053, + 0.02580244466662407, + 0.010825780220329762, + -0.029935935512185097, + -0.03239613398909569, + -0.016259482130408287, + 0.021613359451293945, + -0.04431892931461334, + 0.01939059980213642, + 0.03692196309566498, + 0.0017046730499714613, + 0.06082543730735779, + 0.015725329518318176, + -0.027240820229053497, + 0.027085622772574425, + -0.0014792821602895856, + 0.0014459468657150865, + -0.020813602954149246, + -0.028041385114192963, + 0.0074644493870437145, + 0.02541331946849823, + -0.04287080094218254, + -0.04085218906402588, + 0.05725620314478874, + -0.0540098138153553, + 0.01089746505022049, + -0.009697220288217068, + -0.01277137827128172, + 0.029663534834980965, + -0.01567397266626358, + -0.024037115275859833, + 0.06379303336143494, + -0.0073900227434933186, + -0.039371103048324585, + -0.039317891001701355, + -0.10873675346374512, + 0.03714684024453163, + 0.015304616652429104, + -0.01968245580792427, + 0.04670121148228645, + 0.07289005815982819, + 0.03822429105639458, + 0.01035313867032528, + 0.019634488970041275, + 0.03612896054983139, + 0.05256352201104164, + -0.01531135942786932, + -0.023911133408546448, + -0.011641415767371655, + -0.04562469199299812, + -0.008091451600193977, + -0.03973282873630524, + -0.03166692331433296, + 0.0014925437280908227, + -0.06351883709430695, + -0.03135763108730316, + 0.002445954829454422, + 0.01136980950832367, + 0.022742893546819687, + 0.01582394726574421, + 0.031666409224271774, + -0.03176821023225784, + 0.02061661332845688, + 0.053817179054021835, + -0.015443995594978333, + 0.06768088787794113, + 0.0074053918942809105, + 0.004379879217594862, + -0.018036995083093643, + -0.12984386086463928, + 0.02727270871400833, + -0.06884685903787613, + 0.011283721774816513, + -0.006410351488739252, + -0.028043102473020554, + -0.038576390594244, + 0.0052632298320531845, + 3.704463233589195e-05, + 0.01170535758137703, + -0.034052468836307526, + 0.06972618401050568, + -0.0429469533264637, + -0.014463698491454124, + 0.054797060787677765, + -0.05508837848901749, + 0.005999674089252949, + 0.016210054978728294, + 0.030394185334444046, + 0.018814437091350555, + 0.011458942666649818, + 0.04426871985197067, + 0.027860751375555992, + -0.012702488340437412, + -0.03550449013710022, + -0.03747827187180519, + -0.007686143275350332, + -0.04973191022872925, + -0.015470781363546848, + -0.013912172988057137, + -0.035679347813129425, + -0.030531924217939377, + 0.013484183698892593, + 0.0064904517494142056, + -0.030875712633132935, + 0.04948468133807182, + 0.024434955790638924, + 0.01664743386209011, + 0.032749395817518234, + 0.005831102840602398, + 0.040503863245248795, + -0.0005025852005928755, + -0.020523525774478912, + -0.0955122709274292, + 0.05944440886378288, + -0.033352334052324295, + -0.01684003695845604, + 0.0047449758276343346, + -0.00577123649418354, + -0.014752757735550404, + 0.024754028767347336, + -0.03983451798558235, + -0.08202291280031204, + 0.007593686692416668, + -0.034717198461294174, + -0.09975818544626236, + 0.03999767825007439, + -0.05505223944783211, + -0.013194091618061066, + -0.011484015733003616, + 0.0076688057743012905, + -0.0023846011608839035, + -0.0060723149217665195, + -0.009577409364283085, + 0.011585021391510963, + 0.031143374741077423, + -0.006865524686872959, + -0.0029354176949709654, + 0.05149368941783905, + 0.015403643250465393, + 0.003574015572667122, + 0.03942521661520004, + 0.044310469180345535, + 0.0051728361286222935, + -0.010609363205730915, + 0.00956270843744278, + -0.035416096448898315, + -0.03166976571083069, + -0.053787194192409515, + -0.031123487278819084, + 0.03769956901669502, + -0.0331074558198452, + 0.006905605085194111, + -0.010122079402208328, + 0.030096963047981262, + 0.05383354052901268, + -0.027785638347268105, + -0.004835939966142178, + -0.0017756444867700338, + 0.018264617770910263, + 0.010783819481730461, + 0.032456208020448685, + 0.010847573168575764, + 0.03318186476826668, + -0.01696695387363434, + 0.004460322670638561, + -0.046072281897068024, + -0.03778168931603432, + -0.04794727638363838, + 0.02768581733107567, + 0.00416526198387146, + 0.10537614673376083, + -0.06325893849134445, + 0.012257200665771961, + 0.013712717220187187, + 0.005633390508592129, + 0.021950235590338707, + -0.03449268639087677, + -0.022267812862992287, + -0.036758020520210266, + 0.09976556152105331, + -0.006236811634153128, + 0.031599245965480804, + -0.007543627172708511, + 0.035366807132959366, + 0.04884527623653412, + 0.0011196520645171404, + 0.00026700846501626074, + -0.06519587337970734, + -0.05614931881427765, + 0.0030577462166547775 + ], + "img_vector": [ + 0.9219667911529541, + 0.0977284386754036, + 0.2025243639945984, + 0.061979711055755615, + 0.00619916245341301, + 0.7166117429733276, + 1.226834774017334, + 0.7886548638343811, + 1.6629389524459839, + 0.6918742060661316, + 0.13138777017593384, + 0.9593594670295715, + 0.030556082725524902, + 0.004831538535654545, + 0.004911307245492935, + 1.5104117393493652, + 0.4150170683860779, + 0.17264577746391296, + 0.7917525768280029, + 0.2468060404062271, + 0.16521388292312622, + 0.25357693433761597, + 1.26860773563385, + 0.026516491547226906, + 0.14757683873176575, + 0.299686074256897, + 0.5301297903060913, + 2.2013134956359863, + 0.03337598592042923, + 0.7740409970283508, + 0.17231249809265137, + 0.037611521780490875, + 0.33619436621665955, + 0.01188910473138094, + 0.5645614266395569, + 1.1860660314559937, + 0.05112733691930771, + 0.565477192401886, + 0.43701171875, + 0.0031664420384913683, + 0.6094490885734558, + 0.2998583912849426, + 0.4383941888809204, + 1.0439748764038086, + 0.8239830136299133, + 0.15286700427532196, + 0.5767776966094971, + 0.015460639260709286, + 0.7993848323822021, + 1.3868757486343384, + 2.440202474594116, + 0.28088441491127014, + 0.3520834445953369, + 0.9830549359321594, + 2.023775100708008, + 0.5663003921508789, + 0.3558732271194458, + 0.20145592093467712, + 1.0804108381271362, + 1.8070851564407349, + 0.7908445596694946, + 1.3074238300323486, + 0.9654034972190857, + 2.3403146266937256, + 0.21596920490264893, + 0.0, + 0.3495326042175293, + 0.9000163078308105, + 0.12149554491043091, + 0.7023366689682007, + 0.9547922611236572, + 2.000621795654297, + 0.8170233964920044, + 0.25692981481552124, + 4.821446418762207, + 0.621753990650177, + 1.1972953081130981, + 2.421661615371704, + 0.6477541327476501, + 1.9514731168746948, + 0.9740992188453674, + 2.0650877952575684, + 0.04050368070602417, + 0.15067158639431, + 2.5292654037475586, + 0.01149502582848072, + 0.9158427715301514, + 0.20454742014408112, + 3.383516788482666, + 0.7790547013282776, + 1.0918879508972168, + 2.5497515201568604, + 0.6509770154953003, + 1.3814074993133545, + 0.7000057697296143, + 0.8028034567832947, + 0.20132982730865479, + 1.9157652854919434, + 0.0015001065330579877, + 1.1913106441497803, + 0.0123528353869915, + 0.21103212237358093, + 0.7895367741584778, + 0.017607754096388817, + 2.330967426300049, + 3.8108913898468018, + 3.8300371170043945, + 0.3029964566230774, + 0.5450395345687866, + 0.07796750962734222, + 1.7670717239379883, + 0.2354506105184555, + 0.7570714950561523, + 0.1491096019744873, + 0.05821403115987778, + 0.5385217666625977, + 0.1016593873500824, + 1.7123498916625977, + 0.16868610680103302, + 0.0435841865837574, + 0.3666267693042755, + 0.06689354032278061, + 0.2398235946893692, + 0.3647685945034027, + 1.5938363075256348, + 0.6929879188537598, + 0.43484893441200256, + 1.2545394897460938, + 0.06485043466091156, + 0.018914982676506042, + 0.1343723088502884, + 0.5846444964408875, + 1.0340386629104614, + 0.019701018929481506, + 0.115897998213768, + 0.0, + 0.021337781101465225, + 0.23052164912223816, + 0.4662903845310211, + 0.3543117344379425, + 0.30442672967910767, + 0.41164514422416687, + 0.1871665120124817, + 0.06656026840209961, + 0.53532874584198, + 1.4690028429031372, + 1.1974058151245117, + 0.9184959530830383, + 0.3071364164352417, + 1.6057214736938477, + 0.020331650972366333, + 1.305146336555481, + 0.43180716037750244, + 1.2237268686294556, + 0.9838653802871704, + 0.03288237005472183, + 2.2211010456085205, + 0.003191199852153659, + 0.045853085815906525, + 0.6673545241355896, + 0.17913678288459778, + 0.0, + 0.021156102418899536, + 2.6671745777130127, + 0.3951849639415741, + 0.21547940373420715, + 0.7444193363189697, + 0.021806057542562485, + 0.43650689721107483, + 0.9880358576774597, + 0.6947245001792908, + 0.204078808426857, + 0.27878934144973755, + 0.08354326337575912, + 0.033924274146556854, + 0.20404884219169617, + 0.0, + 0.004306964576244354, + 1.0169310569763184, + 0.33883681893348694, + 1.006794810295105, + 0.05159502103924751, + 0.22930903732776642, + 1.6950254440307617, + 0.4446651339530945, + 0.817156195640564, + 1.3455827236175537, + 4.193704605102539, + 1.0937854051589966, + 0.15106827020645142, + 0.03320198506116867, + 0.12159176915884018, + 1.0395840406417847, + 0.4677858054637909, + 0.0, + 0.7315130233764648, + 3.8822643756866455, + 0.0, + 1.4436346292495728, + 0.029256971552968025, + 0.1190708801150322, + 4.659753799438477, + 0.5842269062995911, + 0.2396518886089325, + 0.1548650860786438, + 0.8187746405601501, + 0.47628429532051086, + 0.71957927942276, + 1.2416067123413086, + 0.19185639917850494, + 0.27450183033943176, + 0.29462772607803345, + 0.39662089943885803, + 0.28732529282569885, + 0.5161588788032532, + 0.9255109429359436, + 0.28638067841529846, + 0.1737833023071289, + 0.09301403909921646, + 2.036120891571045, + 0.05635102093219757, + 0.1268511563539505, + 0.5425705313682556, + 0.3804541230201721, + 0.2628117501735687, + 0.6499223709106445, + 0.11648540943861008, + 0.24499621987342834, + 0.09263883531093597, + 1.4478700160980225, + 0.35764989256858826, + 0.9699946045875549, + 0.4597409665584564, + 0.5973721146583557, + 0.378149151802063, + 1.6083810329437256, + 2.8285250663757324, + 0.6419071555137634, + 0.0, + 1.3998230695724487, + 0.2900331914424896, + 0.6480185985565186, + 0.18579572439193726, + 0.07663349062204361, + 0.023231757804751396, + 0.3678470849990845, + 0.6661166548728943, + 0.0075706597417593, + 1.558577299118042, + 0.0027428993489593267, + 0.4806918203830719, + 0.8155150413513184, + 2.1915347576141357, + 0.4428577423095703, + 1.127350926399231, + 1.0609691143035889, + 0.0, + 0.47014570236206055, + 0.4275362193584442, + 0.11808854341506958, + 0.9221603274345398, + 0.41620829701423645, + 0.13453620672225952, + 0.5105683207511902, + 0.07055539637804031, + 0.25330615043640137, + 0.06392434984445572, + 0.8561735153198242, + 0.5017433166503906, + 0.13940991461277008, + 0.09131714701652527, + 0.03330610692501068, + 1.038124680519104, + 0.42624613642692566, + 0.12857386469841003, + 0.6111430525779724, + 2.1555564403533936, + 0.8140982985496521, + 0.025179672986268997, + 0.029468847438693047, + 0.020997803658246994, + 0.666748046875, + 0.8947370648384094, + 1.790064811706543, + 0.17470449209213257, + 1.0847487449645996, + 1.6438019275665283, + 0.32067349553108215, + 1.8845561742782593, + 0.21915677189826965, + 1.239453673362732, + 2.7079784870147705, + 0.3060023784637451, + 1.255936622619629, + 0.06058673560619354, + 0.42905035614967346, + 0.19555869698524475, + 0.1728508621454239, + 2.4053051471710205, + 0.14267612993717194, + 2.4766340255737305, + 0.7263968586921692, + 2.2464189529418945, + 0.34810030460357666, + 0.177928626537323, + 0.0, + 1.5272282361984253, + 0.34094762802124023, + 0.507898211479187, + 1.34850013256073, + 0.5699977278709412, + 0.755067765712738, + 0.745111346244812, + 0.865845263004303, + 0.20630991458892822, + 0.22738926112651825, + 1.5491124941036105e-05, + 0.18155592679977417, + 0.07149824500083923, + 0.1025463193655014, + 1.5707306861877441, + 2.4894676208496094, + 0.06467421352863312, + 0.0, + 0.7276061773300171, + 1.847212791442871, + 0.0004023581277579069, + 0.05183253809809685, + 0.017870964482426643, + 0.21934057772159576, + 0.19645512104034424, + 0.3183145523071289, + 0.21909859776496887, + 0.3754763603210449, + 1.151180624961853, + 0.3146575689315796, + 0.6991398334503174, + 1.2100400924682617, + 0.07254288345575333, + 1.5646905899047852, + 0.8838477730751038, + 0.758152425289154, + 0.8778436779975891, + 0.8921359181404114, + 0.06647127121686935, + 0.1925186663866043, + 0.1930505335330963, + 0.2328001707792282, + 0.05820649862289429, + 1.4083501100540161, + 1.1012953519821167, + 1.5877500772476196, + 0.19487865269184113, + 0.008351004682481289, + 1.0013880729675293, + 0.23508340120315552, + 0.8750771284103394, + 0.20955131947994232, + 0.70330810546875, + 0.5014642477035522, + 0.514129102230072, + 0.01780667155981064, + 0.07945053279399872, + 0.3499833345413208, + 1.632199764251709, + 1.0881427526474, + 1.2904895544052124, + 1.915879249572754, + 0.8123466968536377, + 0.015614370815455914, + 0.35940560698509216, + 1.0142968893051147, + 0.27264049649238586, + 1.419723629951477, + 0.2512229382991791, + 1.4835264682769775, + 0.03467082604765892, + 0.410952091217041, + 0.23221638798713684, + 0.7286278605461121, + 0.3604239225387573, + 0.7925105690956116, + 1.3636013269424438, + 0.05214739218354225, + 0.13898122310638428, + 0.40420567989349365, + 0.9109073281288147, + 0.1058693528175354, + 0.3443826138973236, + 0.18441244959831238, + 0.6863353252410889, + 0.008236689493060112, + 0.5203438401222229, + 0.3153386414051056, + 0.0, + 0.0, + 1.1556472778320312, + 0.07548300921916962, + 0.13150207698345184, + 0.0, + 1.182020664215088, + 1.9359068870544434, + 0.014955342747271061, + 0.12378225475549698, + 0.2535657584667206, + 0.4078904390335083, + 0.14330130815505981, + 0.386712908744812, + 0.05129178613424301, + 0.7367648482322693, + 0.8375162482261658, + 0.3085392117500305, + 2.080819845199585, + 0.23476073145866394, + 0.25573432445526123, + 1.2985109090805054, + 1.1794553995132446, + 0.6585990190505981, + 0.6587132215499878, + 0.01768592931330204, + 0.20109432935714722, + 1.2516684532165527, + 0.11855360120534897, + 0.11475715041160583, + 1.322260856628418, + 0.002095646457746625, + 0.2910166084766388, + 0.15058103203773499, + 0.005918865092098713, + 0.577019214630127, + 0.9341602921485901, + 0.058176130056381226, + 0.3148823082447052, + 0.888588011264801, + 0.9166330695152283, + 0.91728675365448, + 2.2706422805786133, + 0.08544181287288666, + 0.0024535267148166895, + 0.1845971643924713, + 1.1000250577926636, + 1.0098135471343994, + 1.0376948118209839, + 0.14920414984226227, + 0.1896306872367859, + 0.2188720554113388, + 0.5626853108406067, + 0.8813859820365906, + 0.8824358582496643, + 0.8370124697685242, + 1.4444010257720947, + 0.33782821893692017, + 0.027532491832971573, + 0.4103843569755554, + 0.8604646921157837, + 0.5720173716545105, + 0.23864707350730896, + 0.3264397084712982, + 0.10232428461313248, + 1.1249735355377197, + 0.03594962880015373, + 0.25617334246635437, + 0.28383487462997437, + 0.12444400042295456, + 1.3461889028549194, + 0.20243783295154572, + 0.029978720471262932, + 0.4074413776397705, + 1.5426274538040161, + 0.7376505136489868, + 0.17576472461223602, + 0.4411477744579315, + 0.17897135019302368, + 0.8119418621063232, + 1.0999218225479126, + 0.6837776899337769, + 0.32099011540412903, + 0.3542003631591797, + 0.3345324993133545, + 0.18039555847644806, + 0.5184633135795593, + 1.2762041091918945, + 1.1735683679580688, + 0.2779421806335449, + 1.9010751247406006, + 0.06706434488296509, + 0.6018314361572266, + 1.4402341842651367, + 0.2219811975955963, + 0.0, + 0.10687195509672165, + 0.39939484000205994, + 0.8895093202590942, + 1.4667552709579468, + 0.009427358396351337, + 0.0, + 0.45210328698158264, + 1.4034292697906494, + 0.8327339291572571, + 0.0583820603787899, + 0.8471578359603882, + 0.6048324108123779, + 0.0, + 1.8178064823150635, + 1.9143019914627075, + 0.4151158630847931, + 0.029820218682289124, + 0.09978644549846649, + 1.12955641746521, + 0.5168150067329407, + 0.054348401725292206, + 0.21542352437973022 + ], + "product_id": 4943, + "product_metadata": { + "name": "Gini and Jony Boy's Kaleb White Brown Kidswear", + "gender": "Men", + "master_category": "Apparel", + "sub_category": "Topwear", + "article_type": "Shirts", + "base_color": "White", + "season": "Summer", + "year": 2011, + "usage": "Casual", + "img_url": "http://assets.myntassets.com/v1/images/style/properties/1aae016d0abb224cfc18e6bd9bb01ad1_images.jpg" + } + } +] \ No newline at end of file From 30411b62d5ef0e26e015df909ea49bea3ed26054 Mon Sep 17 00:00:00 2001 From: Tyler Hutcherson Date: Mon, 24 Feb 2025 21:51:47 -0500 Subject: [PATCH 5/7] clean up --- backend/poetry.lock | 17 +---------------- backend/productsearch/api/routes/product.py | 17 +++++------------ backend/productsearch/db/load.py | 1 - backend/productsearch/db/utils.py | 13 ++++++++++--- backend/productsearch/main.py | 17 +++-------------- backend/productsearch/tests/conftest.py | 12 +++++------- backend/pyproject.toml | 1 - 7 files changed, 24 insertions(+), 54 deletions(-) diff --git a/backend/poetry.lock b/backend/poetry.lock index 5a3adcf..139e0c9 100644 --- a/backend/poetry.lock +++ b/backend/poetry.lock @@ -34,21 +34,6 @@ doc = ["Sphinx (>=7)", "packaging", "sphinx-autodoc-typehints (>=1.2.0)", "sphin test = ["anyio[trio]", "coverage[toml] (>=7)", "exceptiongroup (>=1.2.0)", "hypothesis (>=4.0)", "psutil (>=5.9)", "pytest (>=7.0)", "pytest-mock (>=3.6.1)", "trustme", "uvloop (>=0.17)"] trio = ["trio (>=0.23)"] -[[package]] -name = "asgi-lifespan" -version = "2.1.0" -description = "Programmatic startup/shutdown of ASGI apps." -optional = false -python-versions = ">=3.7" -groups = ["main"] -files = [ - {file = "asgi-lifespan-2.1.0.tar.gz", hash = "sha256:5e2effaf0bfe39829cf2d64e7ecc47c7d86d676a6599f7afba378c31f5e3a308"}, - {file = "asgi_lifespan-2.1.0-py3-none-any.whl", hash = "sha256:ed840706680e28428c01e14afb3875d7d76d3206f3d5b2f2294e059b5c23804f"}, -] - -[package.dependencies] -sniffio = "*" - [[package]] name = "astroid" version = "3.1.0" @@ -3653,4 +3638,4 @@ files = [ [metadata] lock-version = "2.1" python-versions = ">=3.11,<3.14" -content-hash = "fcb47752b1815b59975b114ef84ba5d96b362f4f6f30ea8e5e2b02947f20aab3" +content-hash = "cbe78d78d88977ec839f33d3a730e47af7f8fa45e74f06d16d8eff78203aef7e" diff --git a/backend/productsearch/api/routes/product.py b/backend/productsearch/api/routes/product.py index 6591da8..60826d9 100644 --- a/backend/productsearch/api/routes/product.py +++ b/backend/productsearch/api/routes/product.py @@ -1,11 +1,10 @@ import asyncio import numpy as np -from fastapi import APIRouter, Depends, Request -from redis.commands.search.query import Query +from fastapi import APIRouter, Depends from redisvl.index import AsyncSearchIndex from redisvl.query import CountQuery, FilterQuery, VectorQuery -from redisvl.query.filter import FilterExpression, Tag +from redisvl.query.filter import Tag from productsearch import config from productsearch.api.schema.product import ( @@ -25,11 +24,11 @@ operation_id="get_products_samples", ) async def get_products( - request: Request, limit: int = 20, skip: int = 0, gender: str = "", category: str = "", + index: AsyncSearchIndex = Depends(utils.get_async_index), ) -> ProductSearchResponse: """Fetch and return products based on gender and category fields @@ -42,8 +41,6 @@ async def get_products( Returns: ProductSearchResponse: Pydantic model containing products and total count """ - index = utils.get_async_index(request) - # Build query filter_expression = (Tag("gender") == gender) & (Tag("category") == category) filter_query = FilterQuery(return_fields=[], filter_expression=filter_expression) @@ -61,8 +58,8 @@ async def get_products( operation_id="compute_image_similarity", ) async def find_products_by_image( - request: Request, similarity_request: SimilarityRequest, + index: AsyncSearchIndex = Depends(utils.get_async_index), ) -> ProductVectorSearchResponse: """Fetch and return products based on image similarity @@ -85,8 +82,6 @@ async def find_products_by_image( text_vector (str): Text vector for similarity computation img_vector (str): Image vector for similarity computation """ - index = utils.get_async_index(request) - # Fetch paper key and the vector from the HASH, cast to numpy array product = await index.fetch(similarity_request.product_id) product_img_vector = np.frombuffer(product["img_vector"], dtype=np.float32) @@ -121,8 +116,8 @@ async def find_products_by_image( operation_id="compute_text_similarity", ) async def find_products_by_text( - request: Request, similarity_request: SimilarityRequest, + index: AsyncSearchIndex = Depends(utils.get_async_index), ) -> ProductVectorSearchResponse: """Fetch and return products based on image similarity @@ -145,8 +140,6 @@ async def find_products_by_text( text_vector (str): Text vector for similarity computation img_vector (str): Image vector for similarity computation """ - index = utils.get_async_index(request) - # Fetch paper key and the vector from the HASH, cast to numpy array product = await index.fetch(similarity_request.product_id) product_text_vector = np.frombuffer(product["text_vector"], dtype=np.float32) diff --git a/backend/productsearch/db/load.py b/backend/productsearch/db/load.py index db438a7..8afc1bf 100644 --- a/backend/productsearch/db/load.py +++ b/backend/productsearch/db/load.py @@ -1,7 +1,6 @@ #!/usr/bin/env python3 import asyncio import json -import os from typing import List import numpy as np diff --git a/backend/productsearch/db/utils.py b/backend/productsearch/db/utils.py index 425a7ad..de72891 100644 --- a/backend/productsearch/db/utils.py +++ b/backend/productsearch/db/utils.py @@ -1,12 +1,16 @@ import logging import os -from fastapi import Request from redisvl.index import AsyncSearchIndex from redisvl.schema import IndexSchema +from productsearch import config + logger = logging.getLogger(__name__) +# global search index +_global_index = None + def get_schema() -> IndexSchema: dir_path = os.path.dirname(os.path.realpath(__file__)) + "/schema" @@ -14,5 +18,8 @@ def get_schema() -> IndexSchema: return IndexSchema.from_yaml(file_path) -def get_async_index(request: Request) -> AsyncSearchIndex: - return request.app.state.redis_index +async def get_async_index(): + global _global_index + if not _global_index: + _global_index = AsyncSearchIndex(get_schema(), redis_url=config.REDIS_URL) + return _global_index diff --git a/backend/productsearch/main.py b/backend/productsearch/main.py index 490c0d9..b5be2e4 100644 --- a/backend/productsearch/main.py +++ b/backend/productsearch/main.py @@ -4,31 +4,20 @@ import uvicorn from fastapi import FastAPI from fastapi.staticfiles import StaticFiles -from redis.asyncio import Redis from redisvl.index import AsyncSearchIndex from starlette.middleware.cors import CORSMiddleware from productsearch import config from productsearch.api.main import api_router -from productsearch.db.utils import get_schema +from productsearch.db.utils import get_async_index from productsearch.spa import SinglePageApplication @asynccontextmanager async def lifespan(app: FastAPI): - # Create your async resource(s) in startup logic - client = await Redis.from_url(config.REDIS_URL) - index = AsyncSearchIndex(schema=get_schema(), redis_client=client) - # Store them on app.state - app.state.redis_client = client - app.state.redis_index = index - try: - # Let the application run + index = await get_async_index() + async with index: yield - finally: - # Dispose of them in shutdown logic - await index.disconnect() - await client.aclose() # type: ignore app = FastAPI( diff --git a/backend/productsearch/tests/conftest.py b/backend/productsearch/tests/conftest.py index d55eaf4..4aa384c 100644 --- a/backend/productsearch/tests/conftest.py +++ b/backend/productsearch/tests/conftest.py @@ -5,7 +5,6 @@ import numpy as np import pytest import pytest_asyncio -from asgi_lifespan import LifespanManager from httpx import AsyncClient from redisvl.index import SearchIndex @@ -46,14 +45,13 @@ def test_data(index): parsed["product_id"] = product["product_id"] parsed_products.append(parsed) - keys = index.load(data=parsed_products, id_field="product_id") + _ = index.load(data=parsed_products, id_field="product_id") return parsed_products @pytest_asyncio.fixture(scope="session") async def async_client(): - async with LifespanManager(app): - async with AsyncClient( - transport=httpx.ASGITransport(app=app), base_url="http://test/api/v1/" - ) as client: - yield client + async with AsyncClient( + transport=httpx.ASGITransport(app=app), base_url="http://test/api/v1/" # type: ignore + ) as client: + yield client diff --git a/backend/pyproject.toml b/backend/pyproject.toml index db0ac70..63b626a 100644 --- a/backend/pyproject.toml +++ b/backend/pyproject.toml @@ -18,7 +18,6 @@ openai = "^1.35.9" sentence-transformers = "^3.0.1" sentencepiece = "^0.2.0" redis = "^5.2.1" -asgi-lifespan = "^2.1.0" [tool.poetry.group.dev.dependencies] mypy = "1.9.0" From 49ad34fceb32c1eecd1e50c76919c3950bb3a61e Mon Sep 17 00:00:00 2001 From: Tyler Hutcherson Date: Mon, 24 Feb 2025 21:56:34 -0500 Subject: [PATCH 6/7] remove import --- backend/productsearch/main.py | 1 - 1 file changed, 1 deletion(-) diff --git a/backend/productsearch/main.py b/backend/productsearch/main.py index b5be2e4..d325fac 100644 --- a/backend/productsearch/main.py +++ b/backend/productsearch/main.py @@ -4,7 +4,6 @@ import uvicorn from fastapi import FastAPI from fastapi.staticfiles import StaticFiles -from redisvl.index import AsyncSearchIndex from starlette.middleware.cors import CORSMiddleware from productsearch import config From 8dd925942c46ddbb050fc84a3b222053074dbf93 Mon Sep 17 00:00:00 2001 From: Tyler Hutcherson Date: Tue, 25 Feb 2025 14:53:18 -0500 Subject: [PATCH 7/7] add lifespan manager for tests --- backend/poetry.lock | 17 ++++++++++++++++- backend/productsearch/tests/conftest.py | 12 +++++++----- backend/pyproject.toml | 1 + 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/backend/poetry.lock b/backend/poetry.lock index 139e0c9..5a3adcf 100644 --- a/backend/poetry.lock +++ b/backend/poetry.lock @@ -34,6 +34,21 @@ doc = ["Sphinx (>=7)", "packaging", "sphinx-autodoc-typehints (>=1.2.0)", "sphin test = ["anyio[trio]", "coverage[toml] (>=7)", "exceptiongroup (>=1.2.0)", "hypothesis (>=4.0)", "psutil (>=5.9)", "pytest (>=7.0)", "pytest-mock (>=3.6.1)", "trustme", "uvloop (>=0.17)"] trio = ["trio (>=0.23)"] +[[package]] +name = "asgi-lifespan" +version = "2.1.0" +description = "Programmatic startup/shutdown of ASGI apps." +optional = false +python-versions = ">=3.7" +groups = ["main"] +files = [ + {file = "asgi-lifespan-2.1.0.tar.gz", hash = "sha256:5e2effaf0bfe39829cf2d64e7ecc47c7d86d676a6599f7afba378c31f5e3a308"}, + {file = "asgi_lifespan-2.1.0-py3-none-any.whl", hash = "sha256:ed840706680e28428c01e14afb3875d7d76d3206f3d5b2f2294e059b5c23804f"}, +] + +[package.dependencies] +sniffio = "*" + [[package]] name = "astroid" version = "3.1.0" @@ -3638,4 +3653,4 @@ files = [ [metadata] lock-version = "2.1" python-versions = ">=3.11,<3.14" -content-hash = "cbe78d78d88977ec839f33d3a730e47af7f8fa45e74f06d16d8eff78203aef7e" +content-hash = "fcb47752b1815b59975b114ef84ba5d96b362f4f6f30ea8e5e2b02947f20aab3" diff --git a/backend/productsearch/tests/conftest.py b/backend/productsearch/tests/conftest.py index 4aa384c..07031b1 100644 --- a/backend/productsearch/tests/conftest.py +++ b/backend/productsearch/tests/conftest.py @@ -5,6 +5,7 @@ import numpy as np import pytest import pytest_asyncio +from asgi_lifespan import LifespanManager from httpx import AsyncClient from redisvl.index import SearchIndex @@ -13,7 +14,7 @@ from productsearch.main import app -@pytest_asyncio.fixture(scope="session") +@pytest.fixture(scope="session") def index(): index = SearchIndex(schema=get_schema(), redis_url=config.REDIS_URL) index.create() @@ -51,7 +52,8 @@ def test_data(index): @pytest_asyncio.fixture(scope="session") async def async_client(): - async with AsyncClient( - transport=httpx.ASGITransport(app=app), base_url="http://test/api/v1/" # type: ignore - ) as client: - yield client + async with LifespanManager(app=app) as lifespan: + async with AsyncClient( + transport=httpx.ASGITransport(app=app), base_url="http://test/api/v1/" # type: ignore + ) as client: + yield client diff --git a/backend/pyproject.toml b/backend/pyproject.toml index 63b626a..db0ac70 100644 --- a/backend/pyproject.toml +++ b/backend/pyproject.toml @@ -18,6 +18,7 @@ openai = "^1.35.9" sentence-transformers = "^3.0.1" sentencepiece = "^0.2.0" redis = "^5.2.1" +asgi-lifespan = "^2.1.0" [tool.poetry.group.dev.dependencies] mypy = "1.9.0"