Skip to content

Commit

Permalink
Merge branch 'feat/dev-0.6' of https://github.com/eosphoros-ai/DB-GPT
Browse files Browse the repository at this point in the history
…into dev_0.6
  • Loading branch information
Aries-ckt committed Aug 21, 2024
2 parents fde8805 + b0adabb commit 2382661
Show file tree
Hide file tree
Showing 69 changed files with 117 additions and 124 deletions.
7 changes: 2 additions & 5 deletions dbgpt/app/knowledge/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
ChunkEditRequest,
ChunkQueryRequest,
DocumentQueryRequest,
DocumentRecallTestRequest,
DocumentSummaryRequest,
DocumentSyncRequest,
EntityExtractRequest,
Expand All @@ -19,8 +20,6 @@
KnowledgeQueryRequest,
KnowledgeSpaceRequest,
SpaceArgumentRequest,
ChunkEditRequest,
DocumentRecallTestRequest,
)
from dbgpt.app.knowledge.request.response import (
ChunkQueryResponse,
Expand Down Expand Up @@ -157,9 +156,7 @@ def recursively_find_subclasses(cls):
except Exception as e:
logger.error(f"Error calling name method on {retriever_cls}: {e}")

return Result.succ(
list(retriever_names.keys())
)
return Result.succ(list(retriever_names.keys()))
except Exception as e:
return Result.failed(
code="E000X", msg=f"{space_id} get_recall_retrievers error {e}"
Expand Down
19 changes: 9 additions & 10 deletions dbgpt/app/knowledge/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,15 @@
KnowledgeDocumentDao,
KnowledgeDocumentEntity,
)
from dbgpt.rag.retriever.rerank import RerankEmbeddingsRanker

from dbgpt.app.knowledge.request.request import (
ChunkEditRequest,
ChunkQueryRequest,
DocumentQueryRequest,
DocumentRecallTestRequest,
DocumentSummaryRequest,
KnowledgeDocumentRequest,
KnowledgeSpaceRequest,
SpaceArgumentRequest,
ChunkEditRequest,
DocumentRecallTestRequest,
)
from dbgpt.app.knowledge.request.response import (
ChunkQueryResponse,
Expand All @@ -40,6 +38,7 @@
from dbgpt.rag.embedding.embedding_factory import EmbeddingFactory
from dbgpt.rag.knowledge.base import KnowledgeType
from dbgpt.rag.knowledge.factory import KnowledgeFactory
from dbgpt.rag.retriever.rerank import RerankEmbeddingsRanker
from dbgpt.serve.rag.connector import VectorStoreConnector
from dbgpt.serve.rag.models.models import KnowledgeSpaceDao, KnowledgeSpaceEntity
from dbgpt.serve.rag.retriever.knowledge_space import KnowledgeSpaceRetriever
Expand Down Expand Up @@ -310,11 +309,12 @@ def get_knowledge_space_by_ids(self, ids):
"""
return knowledge_space_dao.get_knowledge_space_by_ids(ids)

def recall_test(self, space_name, doc_recall_test_request: DocumentRecallTestRequest):
def recall_test(
self, space_name, doc_recall_test_request: DocumentRecallTestRequest
):
logger.info(f"recall_test {space_name}, {doc_recall_test_request}")
from dbgpt.rag.embedding.embedding_factory import (
RerankEmbeddingFactory,
)
from dbgpt.rag.embedding.embedding_factory import RerankEmbeddingFactory

try:
start_time = timeit.default_timer()
question = doc_recall_test_request.question
Expand Down Expand Up @@ -353,8 +353,7 @@ def recall_test(self, space_name, doc_recall_test_request: DocumentRecallTestReq
rerank_embeddings = RerankEmbeddingFactory.get_instance(
CFG.SYSTEM_APP
).create()
reranker = RerankEmbeddingsRanker(rerank_embeddings,
topk=recall_top_k)
reranker = RerankEmbeddingsRanker(rerank_embeddings, topk=recall_top_k)
chunks = reranker.rank(candidates_with_scores=chunks, query=question)

recall_score_threshold = doc_recall_test_request.recall_score_threshold
Expand Down
4 changes: 1 addition & 3 deletions dbgpt/app/scene/chat_knowledge/v1/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ def __init__(self, chat_param: Dict):
- model_name:(str) llm model name
- select_param:(str) space name
"""
from dbgpt.rag.embedding.embedding_factory import (
RerankEmbeddingFactory,
)
from dbgpt.rag.embedding.embedding_factory import RerankEmbeddingFactory

self.knowledge_space = chat_param["select_param"]
chat_param["chat_mode"] = ChatScene.ChatKnowledge
Expand Down
2 changes: 1 addition & 1 deletion dbgpt/app/static/web/404.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="icon" href="/favicon.ico"/><meta name="description" content="Revolutionizing Database Interactions with Private LLM Technology"/><meta property="og:site_name" content="df.alipay.com"/><meta property="og:description" content="eosphoros-ai"/><meta property="og:title" content="Ant-DB-GPT"/><link rel="preload" href="/_next/static/css/303847e6112d00ae.css" as="style"/><link rel="stylesheet" href="/_next/static/css/303847e6112d00ae.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js"></script><script src="/_next/static/chunks/webpack-0a2338c2b59bc7b5.js" defer=""></script><script src="/_next/static/chunks/framework-f701683ca87c9d36.js" defer=""></script><script src="/_next/static/chunks/main-8c6ee2635a9b3afc.js" defer=""></script><script src="/_next/static/chunks/pages/_app-53ef7d9cabe0adea.js" defer=""></script><script src="/_next/static/chunks/pages/_error-8095ba9e1bf12f30.js" defer=""></script><script src="/_next/static/SffxRojMO5idwjHbCoDQW/_buildManifest.js" defer=""></script><script src="/_next/static/SffxRojMO5idwjHbCoDQW/_ssgManifest.js" defer=""></script><link rel="stylesheet" href="/_next/static/css/antd-output/antd.min.7d5365b5.css"/></head><body><div id="__next"><div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":404}},"page":"/_error","query":{},"buildId":"SffxRojMO5idwjHbCoDQW","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="icon" href="/favicon.ico"/><meta name="description" content="Revolutionizing Database Interactions with Private LLM Technology"/><meta property="og:description" content="eosphoros-ai"/><meta property="og:title" content="DB-GPT"/><link rel="preload" href="/_next/static/css/303847e6112d00ae.css" as="style"/><link rel="stylesheet" href="/_next/static/css/303847e6112d00ae.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js"></script><script src="/_next/static/chunks/webpack-3d1fc9d1ad5b769f.js" defer=""></script><script src="/_next/static/chunks/framework-f701683ca87c9d36.js" defer=""></script><script src="/_next/static/chunks/main-8c6ee2635a9b3afc.js" defer=""></script><script src="/_next/static/chunks/pages/_app-3080d061c6f415ba.js" defer=""></script><script src="/_next/static/chunks/pages/_error-8095ba9e1bf12f30.js" defer=""></script><script src="/_next/static/T0TLOiMXd67QJRfok8C-J/_buildManifest.js" defer=""></script><script src="/_next/static/T0TLOiMXd67QJRfok8C-J/_ssgManifest.js" defer=""></script><link rel="stylesheet" href="/_next/static/css/antd-output/antd.min.7d5365b5.css"/></head><body><div id="__next"><div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":404}},"page":"/_error","query":{},"buildId":"T0TLOiMXd67QJRfok8C-J","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
2 changes: 1 addition & 1 deletion dbgpt/app/static/web/404/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="icon" href="/favicon.ico"/><meta name="description" content="Revolutionizing Database Interactions with Private LLM Technology"/><meta property="og:site_name" content="df.alipay.com"/><meta property="og:description" content="eosphoros-ai"/><meta property="og:title" content="Ant-DB-GPT"/><link rel="preload" href="/_next/static/css/303847e6112d00ae.css" as="style"/><link rel="stylesheet" href="/_next/static/css/303847e6112d00ae.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js"></script><script src="/_next/static/chunks/webpack-0a2338c2b59bc7b5.js" defer=""></script><script src="/_next/static/chunks/framework-f701683ca87c9d36.js" defer=""></script><script src="/_next/static/chunks/main-8c6ee2635a9b3afc.js" defer=""></script><script src="/_next/static/chunks/pages/_app-53ef7d9cabe0adea.js" defer=""></script><script src="/_next/static/chunks/pages/_error-8095ba9e1bf12f30.js" defer=""></script><script src="/_next/static/SffxRojMO5idwjHbCoDQW/_buildManifest.js" defer=""></script><script src="/_next/static/SffxRojMO5idwjHbCoDQW/_ssgManifest.js" defer=""></script><link rel="stylesheet" href="/_next/static/css/antd-output/antd.min.7d5365b5.css"/></head><body><div id="__next"><div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":404}},"page":"/_error","query":{},"buildId":"SffxRojMO5idwjHbCoDQW","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="icon" href="/favicon.ico"/><meta name="description" content="Revolutionizing Database Interactions with Private LLM Technology"/><meta property="og:description" content="eosphoros-ai"/><meta property="og:title" content="DB-GPT"/><link rel="preload" href="/_next/static/css/303847e6112d00ae.css" as="style"/><link rel="stylesheet" href="/_next/static/css/303847e6112d00ae.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js"></script><script src="/_next/static/chunks/webpack-3d1fc9d1ad5b769f.js" defer=""></script><script src="/_next/static/chunks/framework-f701683ca87c9d36.js" defer=""></script><script src="/_next/static/chunks/main-8c6ee2635a9b3afc.js" defer=""></script><script src="/_next/static/chunks/pages/_app-3080d061c6f415ba.js" defer=""></script><script src="/_next/static/chunks/pages/_error-8095ba9e1bf12f30.js" defer=""></script><script src="/_next/static/T0TLOiMXd67QJRfok8C-J/_buildManifest.js" defer=""></script><script src="/_next/static/T0TLOiMXd67QJRfok8C-J/_ssgManifest.js" defer=""></script><link rel="stylesheet" href="/_next/static/css/antd-output/antd.min.7d5365b5.css"/></head><body><div id="__next"><div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":404}},"page":"/_error","query":{},"buildId":"T0TLOiMXd67QJRfok8C-J","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>

Large diffs are not rendered by default.

This file was deleted.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Loading

0 comments on commit 2382661

Please sign in to comment.