chore: 添加虚拟环境到仓库

- 添加 backend_service/venv 虚拟环境
- 包含所有Python依赖包
- 注意:虚拟环境约393MB,包含12655个文件
This commit is contained in:
2025-12-03 10:19:25 +08:00
parent a6c2027caa
commit c4f851d387
12655 changed files with 3009376 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
from typing import List
import numpy as np
from chromadb.api import ServerAPI
from chromadb.api.models.Collection import Collection
def test_many_collections(client: ServerAPI) -> None:
"""Test that we can create a large number of collections and that the system
# remains responsive."""
client.reset()
N = 10
D = 10
metadata = None
if client.get_settings().is_persistent:
metadata = {"hnsw:batch_size": 3, "hnsw:sync_threshold": 3}
else:
# We only want to test persistent configurations in this way, since the main
# point is to test the file handle limit
return
num_collections = 10000
collections: List[Collection] = []
for i in range(num_collections):
new_collection = client.create_collection(
f"test_collection_{i}",
metadata=metadata,
)
collections.append(new_collection)
# Add a few embeddings to each collection
data = np.random.rand(N, D).tolist()
ids = [f"test_id_{i}" for i in range(N)]
for i in range(num_collections):
collections[i].add(ids, data)