mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-09-10 05:19:44 +00:00
style:fmt and v0.5.7 tag (#1584)
This commit is contained in:
@@ -1 +1 @@
|
|||||||
version = "0.5.6"
|
version = "0.5.7"
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
|
import datetime
|
||||||
import logging
|
import logging
|
||||||
from decimal import Decimal
|
from decimal import Decimal
|
||||||
from typing import List
|
from typing import List
|
||||||
import datetime
|
|
||||||
|
|
||||||
from dbgpt._private.config import Config
|
from dbgpt._private.config import Config
|
||||||
from dbgpt.app.scene.chat_dashboard.data_preparation.report_schma import ValueItem
|
from dbgpt.app.scene.chat_dashboard.data_preparation.report_schma import ValueItem
|
||||||
|
@@ -15,6 +15,7 @@ from ..retriever.bm25 import BM25Retriever
|
|||||||
|
|
||||||
class BM25Assembler(BaseAssembler):
|
class BM25Assembler(BaseAssembler):
|
||||||
"""BM25 Assembler.
|
"""BM25 Assembler.
|
||||||
|
|
||||||
refer https://www.elastic.co/guide/en/elasticsearch/reference/8.9/index-
|
refer https://www.elastic.co/guide/en/elasticsearch/reference/8.9/index-
|
||||||
modules-similarity.html
|
modules-similarity.html
|
||||||
TF/IDF based similarity that has built-in tf normalization and is supposed to
|
TF/IDF based similarity that has built-in tf normalization and is supposed to
|
||||||
@@ -43,7 +44,7 @@ class BM25Assembler(BaseAssembler):
|
|||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
knowledge: Knowledge,
|
knowledge: Knowledge,
|
||||||
es_config: ElasticsearchVectorConfig = None,
|
es_config: ElasticsearchVectorConfig,
|
||||||
k1: Optional[float] = 2.0,
|
k1: Optional[float] = 2.0,
|
||||||
b: Optional[float] = 0.75,
|
b: Optional[float] = 0.75,
|
||||||
chunk_parameters: Optional[ChunkParameters] = None,
|
chunk_parameters: Optional[ChunkParameters] = None,
|
||||||
@@ -122,7 +123,7 @@ class BM25Assembler(BaseAssembler):
|
|||||||
def load_from_knowledge(
|
def load_from_knowledge(
|
||||||
cls,
|
cls,
|
||||||
knowledge: Knowledge,
|
knowledge: Knowledge,
|
||||||
es_config: ElasticsearchVectorConfig = None,
|
es_config: ElasticsearchVectorConfig,
|
||||||
k1: Optional[float] = 2.0,
|
k1: Optional[float] = 2.0,
|
||||||
b: Optional[float] = 0.75,
|
b: Optional[float] = 0.75,
|
||||||
chunk_parameters: Optional[ChunkParameters] = None,
|
chunk_parameters: Optional[ChunkParameters] = None,
|
||||||
@@ -152,7 +153,7 @@ class BM25Assembler(BaseAssembler):
|
|||||||
async def aload_from_knowledge(
|
async def aload_from_knowledge(
|
||||||
cls,
|
cls,
|
||||||
knowledge: Knowledge,
|
knowledge: Knowledge,
|
||||||
es_config: ElasticsearchVectorConfig = None,
|
es_config: ElasticsearchVectorConfig,
|
||||||
k1: Optional[float] = 2.0,
|
k1: Optional[float] = 2.0,
|
||||||
b: Optional[float] = 0.75,
|
b: Optional[float] = 0.75,
|
||||||
chunk_parameters: Optional[ChunkParameters] = None,
|
chunk_parameters: Optional[ChunkParameters] = None,
|
||||||
|
@@ -14,16 +14,17 @@ from dbgpt.util.executor_utils import blocking_func_to_async
|
|||||||
|
|
||||||
class BM25Retriever(BaseRetriever):
|
class BM25Retriever(BaseRetriever):
|
||||||
"""BM25 retriever.
|
"""BM25 retriever.
|
||||||
refer https://www.elastic.co/guide/en/elasticsearch/reference/8.9/index-
|
|
||||||
modules-similarity.html
|
refer https://www.elastic.co/guide/en/elasticsearch/reference/8.9/
|
||||||
|
index-modules-similarity.html;
|
||||||
TF/IDF based similarity that has built-in tf normalization and is supposed to
|
TF/IDF based similarity that has built-in tf normalization and is supposed to
|
||||||
work better for short fields (like names). See Okapi_BM25 for more details.
|
work better for short fields (like names). See Okapi_BM25 for more details.
|
||||||
This similarity has the following options:"""
|
"""
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
top_k: int = 4,
|
top_k: int = 4,
|
||||||
es_index: str = None,
|
es_index: str = "dbgpt",
|
||||||
es_client: Any = None,
|
es_client: Any = None,
|
||||||
query_rewrite: Optional[QueryRewrite] = None,
|
query_rewrite: Optional[QueryRewrite] = None,
|
||||||
rerank: Optional[Ranker] = None,
|
rerank: Optional[Ranker] = None,
|
||||||
|
2
setup.py
2
setup.py
@@ -19,7 +19,7 @@ with open("README.md", mode="r", encoding="utf-8") as fh:
|
|||||||
IS_DEV_MODE = os.getenv("IS_DEV_MODE", "true").lower() == "true"
|
IS_DEV_MODE = os.getenv("IS_DEV_MODE", "true").lower() == "true"
|
||||||
# If you modify the version, please modify the version in the following files:
|
# If you modify the version, please modify the version in the following files:
|
||||||
# dbgpt/_version.py
|
# dbgpt/_version.py
|
||||||
DB_GPT_VERSION = os.getenv("DB_GPT_VERSION", "0.5.6")
|
DB_GPT_VERSION = os.getenv("DB_GPT_VERSION", "0.5.7")
|
||||||
|
|
||||||
BUILD_NO_CACHE = os.getenv("BUILD_NO_CACHE", "true").lower() == "true"
|
BUILD_NO_CACHE = os.getenv("BUILD_NO_CACHE", "true").lower() == "true"
|
||||||
LLAMA_CPP_GPU_ACCELERATION = (
|
LLAMA_CPP_GPU_ACCELERATION = (
|
||||||
|
Reference in New Issue
Block a user