feat: build

This commit is contained in:
李如威 2025-07-28 11:13:41 +08:00
parent 0ad204747c
commit 8b27dda8ee
2 changed files with 9 additions and 7 deletions

View File

@ -2,6 +2,7 @@
from base_rag import BaseRAG
class SimpleRAG(BaseRAG):
def ingest(self, file_path: str):
documents = self.load_and_split_documents(file_path)
@ -12,12 +13,10 @@ class SimpleRAG(BaseRAG):
docs = self.similarity_search(question)
return f"找到 {len(docs)} 个相关文档"
if __name__ == "__main__":
# 本地模型配置
config = {
"type": "local",
"model_name": "sentence-transformers/all-MiniLM-L6-v2"
}
config = {"type": "local", "model_name": "sentence-transformers/all-MiniLM-L6-v2"}
rag = SimpleRAG(embedding_config=config)
print("RAG初始化完成!")

View File

@ -3,6 +3,9 @@
set -e
echo "检查并安装构建依赖..."
pip install --upgrade pip build twine
echo "清理..."
rm -rf build/ dist/ *.egg-info/