Spaces:
Runtime error
Runtime error
File size: 9,308 Bytes
859e525 0b20fed 859e525 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 |
{
"cells": [
{
"cell_type": "code",
"execution_count": 24,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"69050aa19c302b38e5698575eaa553bf137b0cd391c976a74c6767f6c46ced66\n"
]
}
],
"source": [
"!docker run -p \"6333:6333\" -p \"6334:6334\" --name \"rag-traversaal-qdrant\" --rm -d qdrant/qdrant:latest"
]
},
{
"cell_type": "code",
"execution_count": 25,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"CollectionsResponse(collections=[])"
]
},
"execution_count": 25,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import qdrant_client\n",
"\n",
"client = qdrant_client.QdrantClient(host=\"localhost\", port=6333, grpc_port=6334, prefer_grpc=True)\n",
"client.get_collections()"
]
},
{
"cell_type": "code",
"execution_count": 26,
"metadata": {},
"outputs": [],
"source": [
"with open(\"summ_texts.txt\", \"r\", encoding=\"utf-8\") as file:\n",
" document = file.readlines()"
]
},
{
"cell_type": "code",
"execution_count": 27,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"['ff28097a3c8042709239c0a1e8fffc4a',\n",
" 'de3388302b014f1ab426ea3866427d60',\n",
" 'bb5de6ec82514482aa37ef44770bd257',\n",
" '834c9eab4bae4547a3a3b8aa358515a5',\n",
" 'ec3166e01c73412b9fc1b24b8c57c9e6',\n",
" 'b40463e5a239408b847659f7b2c8366d',\n",
" '99d22d7496ae4c2a90bfa9ee977c8cbc',\n",
" 'd9e7d5ec895d46ad9ff27c49fff3a050',\n",
" '2df69728537e48feacb46a742c287c1a',\n",
" '92726c2c71b54c4f921ea4194c4670cb',\n",
" 'c16efe98b3794e5784632d75910147d7',\n",
" '8f2e64940f334bb1859afd1b6d4114a6',\n",
" 'b8fdbe23c9c44eeea06ae6ac20255be7',\n",
" '317ce638016b48089d88a81304305661',\n",
" 'e601117dc69f438490387410859e4297',\n",
" '96a52598250040ec8138dff13f90e177',\n",
" '8dd908fb4b4e40b3a658c0c01a928e01',\n",
" 'b7a4b9d24c1c4f798ff89a21c96d872c',\n",
" '9b20e619b52549829c407098b583b2b1',\n",
" '458255ce061e4dfdb8dafbb169d3af5a',\n",
" '3bafa59f470c4e66b37235e88b23a421',\n",
" '30c70ae5ece0422fbe2af109bcf21148',\n",
" 'e01fa78eda63462197837d1c022576ab',\n",
" '725e9572aa7341a9add96b7f6f097ae6',\n",
" 'de408b004d0a4bceb9abf0932fe3fdb0',\n",
" '65b32277941f4f6993d9aa697fd1c055',\n",
" 'd92c6426374042b39d61878b30d9deb6',\n",
" '9759ebba518140e7bfc1c074cd7d40b0',\n",
" 'faefbe75bbaf465c8ef7d688723e203b',\n",
" '8057e84b85a548d6b8085fba6263b2d4',\n",
" '5528128e4a8e4721b2d1fb1a55f257b3',\n",
" '98360cef639843248403c8384d63b191',\n",
" '24bd92f5821f4d4ba36e458a0288bbc4',\n",
" '4a179d2341484ef6a56407c32fbed9f1',\n",
" '08ffbf99f4ec491da29379974a7be874',\n",
" 'e0b858f99d394be89b56b8e31a97bcfe',\n",
" '02e78c34c903459aabf150df97a963ed',\n",
" 'af5065326960419c9e793d75e5dfe4a5',\n",
" 'aaadc30929eb4332b6c7762dbb43d776',\n",
" '70ddc2c5b8f942b88e96d4585994b1f0',\n",
" '30ecb167dc764071bb1f27ad43c7da1a',\n",
" '9835e95e5f6b4654af87c9fab89847ab',\n",
" '887580e83e534456a70378863a56c0a9',\n",
" '074e5abb5e0f4596b0178154950bddc5',\n",
" '3c9baf3ecfa74af78e75fdf697b36045',\n",
" 'c469fe8d08464194a94df7fb9afd4ac1',\n",
" '16fb4c4b6db44d9ab82671c221420669',\n",
" '6cf270acb16b41f0b7bf331967f53856',\n",
" '86c870b8879b44f194f3236e49eca001',\n",
" '8f873d0fc8ec4d1893ea38c0a3d2d81e',\n",
" 'f31228b0b0a5476c932c8ac1b88fe0b9',\n",
" 'b544701028824a34800b77cb5c53246c',\n",
" 'e6f95a4872514134aba698bef5d86653',\n",
" 'e1d2275010f2480d964a77dabf0a415e',\n",
" '984b2e67337e448eb4e2d2aaa2e2fcb2',\n",
" '4c0071417470414fb4ceb81c52f36fec',\n",
" 'b9bccd8b68074859ac1c63cfd8823598',\n",
" '26b43f09fbeb4f39bd7992e5c0b8ae91',\n",
" 'cae6882091a64b3ab9e2c4005bcc19e0',\n",
" 'cc80148a7aaf466486a6414614bc348a',\n",
" 'fee528dd7fbb4828ab1f0874ce0f986f',\n",
" '6cbbe048deeb4dfb998ac0cbce5abd93',\n",
" '15e80c4ce2324718873401f30ab574a3',\n",
" '408f2af8b8b54c2d8c492e635898792c',\n",
" '5965677a947a4d94be0675007d823b99',\n",
" 'a8ac15b012c842aabe0013c0ef73d4a7',\n",
" '6efc03bf46884981b0e7ab24e6089b92',\n",
" 'ff2f44ebc936411e91e6319fd0fb59af',\n",
" '40a043c3b90c4d7e85951c86422749b9',\n",
" '480dcc3e72d94ee8ae99eca49a23a1a2',\n",
" 'f70f75ee9fae4a66838d52881ec57dee',\n",
" 'a3ce4e10893b488596f1118e03a95571',\n",
" '30a597c36cb340659b325d0a3cb655a9',\n",
" '0d9942fe8e2e455fbc67f25f928e9834',\n",
" '5cfe489d3b0d4e27b62b76569e001aa5',\n",
" 'e446ef1316b744419a6eadb3d177d8a0',\n",
" 'eeb5980a2939410593d61f66eae218e6',\n",
" 'de3e0f7c2da248aebd0c913f41549646',\n",
" '0abc431cb5654a8b80d0ea07d5753e71',\n",
" '4d8831f416ac4a779b471b4c167d0d10',\n",
" '36d92838f2d34e24a1bb831a4410bad2',\n",
" '204686a5eb264950a79a79822d425e51',\n",
" '755dd4a9c60649c4a1e1428c7542d460',\n",
" '4944700b83f84b0fb49bfce6885db86b',\n",
" '62c73abebc6b40c886623b75ae78be18',\n",
" '9d2db58c01f4487aabfb65907c5df78f',\n",
" 'ea99f861734849b5bb9687958c0c3721',\n",
" '70aa9afc6e7e45a9a05170913275e2ea',\n",
" '1983acd0f5474cb2a5dbcbd4f177c663',\n",
" 'daada3b6357d4778ae6328710c7b28fc',\n",
" '5614b79e12714a38a48bc6d13a2c3411',\n",
" '65c8ffb55e8748f886c73a4c5d622edd',\n",
" 'cab739b7e7974f859fa5822cc854ae40',\n",
" '7cff242c7e7c45979820f09c028b8fa2',\n",
" 'd85d3fdfb9674b4e9c52ffd0ac58d74e',\n",
" '81b7865fdfb04113a2313966c4e48cff',\n",
" '7c8632b2a3ff4d6aaa8dea3d35e08cff',\n",
" 'cb54baa054f542068cedb83fb231b7cc',\n",
" '8a65e13b2ae948bf97b220172b2c9fca',\n",
" '52c67e5cfc494506b720295e4cc02355',\n",
" '98a2fede91f744c78f23ea649d755a21',\n",
" '825f2b3ec2924cc0b653b6e2cbbf4e22',\n",
" '44a46f1b2eb74be69dd29ca6d5410a0f',\n",
" 'bc09d73ff0e645fd8cf20149cf0e4cd5',\n",
" 'f4a5ed52d3c04a6384cf7e24ba15a367',\n",
" '025f2d19df4c49e8a1476673463a120b',\n",
" 'aaee61aaf3f54e428278c0f7b643106a',\n",
" 'c7fb620c19984baa95b56c0533912585',\n",
" 'f716ac9ce6f244758bcecc6412554b1c',\n",
" '6e7c28c93c0f45fabf359a37558450a7',\n",
" '1e6c708f7e024f4ea9c4114aba3d39eb',\n",
" 'd63ceec42e1d4188ace96187b2de2491',\n",
" '35a3ebe08b74448dbd3d425fd92182a6',\n",
" 'f949266e46ba457984bd968394e23983',\n",
" 'd08e7c4cc3904af48b81d0a9cdbe99ab',\n",
" '23e52cd551754101a800b8be42b8d30d',\n",
" 'bd83e712f96c42c6aaef5f1ef7ccd508',\n",
" '7967214a196949d5be133e36a4a7893f',\n",
" '8d101c958c554ad98adf5464e8205ce2',\n",
" '6cbdbf243701460aa8730de3d7597c0c',\n",
" '6853b03d0c21430cb2f83a5adb958dfa',\n",
" '5848b5ecd63e41e1823e4295764b4bf4',\n",
" '6d394fdbf729441188acf40693686e23',\n",
" '64e7ef83b6e24d9fba29d6897aa2841b',\n",
" 'e400c6799db24c6aa24e63b3591ce314',\n",
" '7effb05dcab446eebf67c59b04a7b302',\n",
" '32e7572888784769ad2cf55a63421ad1',\n",
" 'cdd1c7d4b0844562b325081db6ab412a',\n",
" '9b8f34ca57e74c0ca4e4305df5f65e97',\n",
" '075c9f42a8a64662a28a3cfe612fd30e',\n",
" '21f78d3aa41d47bf86a351807227de89',\n",
" '75e2b201947c4ae09fb9698b01f90fa7',\n",
" 'dcc672f90a0d49a3abde47b1085ca029',\n",
" '678180e014b3482b9fa7d0cbfaeba594',\n",
" 'c2fc4ebcfb7247e0bd168ddfb07e240e',\n",
" 'ec876b83046a45f69e97b29750b869f1',\n",
" 'b612d0b9412f4e75b6d3de22c530b1d0',\n",
" 'fb0a02073c854bb896811928d15d14db',\n",
" 'd7c4580ed3f24013b7b2ff8009edeaa9',\n",
" 'd2b4eff37c8c4ce894842e16d8b13218',\n",
" '638a3bcd233048ec87ab51cf326f1638',\n",
" 'e18f89c58ff749d8a12430e7765dba60',\n",
" '4069ccc54643465c84fcf64a066d9cd6',\n",
" 'fcd55d6bd8df4ebf85f59ba52fef925a',\n",
" '47477dc9b2414f17998c9fc4e8ca24c8',\n",
" '1ce77e75f0b14618aa740159246f9921',\n",
" 'd9248d6b26e0439c8cb5ee0960a86512',\n",
" '1a8282698e7346e5a9a81f381e496b08']"
]
},
"execution_count": 27,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"client.add(\n",
" collection_name=\"knowledge-base\",\n",
" documents=document\n",
")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.4"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
|