Skip to content

Commit 2fad748

Browse files
committed
chore:fmt
1 parent 5d67f16 commit 2fad748

File tree

2 files changed

+7
-15
lines changed

2 files changed

+7
-15
lines changed

packages/dbgpt-ext/src/dbgpt_ext/storage/vector_store/elastic_store.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import logging
66
import os
77
from dataclasses import dataclass, field
8-
from typing import List, Optional, Any
8+
from typing import Any, List, Optional
99

1010
from dbgpt.core import Chunk, Embeddings
1111
from dbgpt.core.awel.flow import Parameter, ResourceCategory, register_resource

packages/dbgpt-ext/src/dbgpt_ext/storage/vector_store/milvus_store.py

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -288,11 +288,11 @@ def __init__(
288288
def create_collection(self, collection_name: str, **kwargs) -> Any:
289289
"""Create a Milvus collection.
290290
291-
Create a Milvus collection, indexes it with HNSW, load document
292-
Args:
293-
collection_name (str): your collection name.
294-
Returns:
295-
List[str]: document ids.
291+
Create a Milvus collection, indexes it with HNSW, load document
292+
Args:
293+
collection_name (str): your collection name.
294+
Returns:
295+
List[str]: document ids.
296296
"""
297297
try:
298298
from pymilvus import (
@@ -365,12 +365,7 @@ def _load_documents(self, documents) -> List[str]:
365365
"""
366366
try:
367367
from pymilvus import (
368-
Collection,
369-
CollectionSchema,
370368
DataType,
371-
FieldSchema,
372-
connections,
373-
utility,
374369
)
375370
from pymilvus.orm.types import infer_dtype_bydata # noqa: F401
376371
except ImportError:
@@ -387,10 +382,7 @@ def _load_documents(self, documents) -> List[str]:
387382
self.fields.remove(x.name)
388383
if x.is_primary:
389384
self.primary_field = x.name
390-
if (
391-
x.dtype == DataType.FLOAT_VECTOR
392-
or x.dtype == DataType.BINARY_VECTOR
393-
):
385+
if x.dtype == DataType.FLOAT_VECTOR or x.dtype == DataType.BINARY_VECTOR:
394386
self.vector_field = x.name
395387
return self._add_documents(texts, metadatas)
396388

0 commit comments

Comments
 (0)