orztv
commited on
Commit
·
8d1e48a
1
Parent(s):
6e3f2ed
update
Browse files
run.sh
CHANGED
@@ -132,8 +132,71 @@ EOF
|
|
132 |
# 输出版本和状态信息
|
133 |
echo "Qdrant version:"
|
134 |
curl -s http://localhost:6333/version
|
135 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
136 |
curl -s http://localhost:6333/collections
|
|
|
137 |
return 0
|
138 |
fi
|
139 |
echo "Waiting for Qdrant to start..."
|
|
|
132 |
# 输出版本和状态信息
|
133 |
echo "Qdrant version:"
|
134 |
curl -s http://localhost:6333/version
|
135 |
+
|
136 |
+
# 预创建常用集合
|
137 |
+
echo "Creating default collections..."
|
138 |
+
|
139 |
+
# 创建文本向量集合 (768维,适用于多数文本嵌入模型)
|
140 |
+
curl -X PUT 'http://localhost:6333/collections/text_vectors' \
|
141 |
+
-H 'Content-Type: application/json' \
|
142 |
+
-d '{
|
143 |
+
"vectors": {
|
144 |
+
"size": 768,
|
145 |
+
"distance": "Cosine"
|
146 |
+
},
|
147 |
+
"optimizers_config": {
|
148 |
+
"default_segment_number": 2,
|
149 |
+
"indexing_threshold": 20000
|
150 |
+
},
|
151 |
+
"hnsw_config": {
|
152 |
+
"m": 16,
|
153 |
+
"ef_construct": 100,
|
154 |
+
"full_scan_threshold": 10000
|
155 |
+
}
|
156 |
+
}'
|
157 |
+
|
158 |
+
# 创建图像向量集合 (512维,适用于多数图像嵌入模型)
|
159 |
+
curl -X PUT 'http://localhost:6333/collections/image_vectors' \
|
160 |
+
-H 'Content-Type: application/json' \
|
161 |
+
-d '{
|
162 |
+
"vectors": {
|
163 |
+
"size": 512,
|
164 |
+
"distance": "Cosine"
|
165 |
+
},
|
166 |
+
"optimizers_config": {
|
167 |
+
"default_segment_number": 2,
|
168 |
+
"indexing_threshold": 20000
|
169 |
+
},
|
170 |
+
"hnsw_config": {
|
171 |
+
"m": 16,
|
172 |
+
"ef_construct": 100,
|
173 |
+
"full_scan_threshold": 10000
|
174 |
+
}
|
175 |
+
}'
|
176 |
+
|
177 |
+
# 创建通用向量集合 (1536维,适用于 OpenAI 的嵌入模型)
|
178 |
+
curl -X PUT 'http://localhost:6333/collections/openai_vectors' \
|
179 |
+
-H 'Content-Type: application/json' \
|
180 |
+
-d '{
|
181 |
+
"vectors": {
|
182 |
+
"size": 1536,
|
183 |
+
"distance": "Cosine"
|
184 |
+
},
|
185 |
+
"optimizers_config": {
|
186 |
+
"default_segment_number": 2,
|
187 |
+
"indexing_threshold": 20000
|
188 |
+
},
|
189 |
+
"hnsw_config": {
|
190 |
+
"m": 16,
|
191 |
+
"ef_construct": 100,
|
192 |
+
"full_scan_threshold": 10000
|
193 |
+
}
|
194 |
+
}'
|
195 |
+
|
196 |
+
# 验证集合创建状态
|
197 |
+
echo -e "\nVerifying collections:"
|
198 |
curl -s http://localhost:6333/collections
|
199 |
+
|
200 |
return 0
|
201 |
fi
|
202 |
echo "Waiting for Qdrant to start..."
|