feat: overhaul UI styling, improve templates, enhance services and tests
This commit is contained in:
@@ -50,7 +50,9 @@ class ChromaManager:
|
||||
"""获取或创建 papers_embeddings collection。"""
|
||||
try:
|
||||
col = self._client.get_collection("papers_embeddings")
|
||||
logger.info("ChromaDB collection 'papers_embeddings' loaded, count=%d", col.count())
|
||||
logger.info(
|
||||
"ChromaDB collection 'papers_embeddings' loaded, count=%d", col.count()
|
||||
)
|
||||
return col
|
||||
except Exception:
|
||||
pass
|
||||
@@ -228,7 +230,9 @@ def index_paper(paper_id: str, texts_dict: dict | None = None) -> bool:
|
||||
col.upsert(
|
||||
ids=[arxiv_id],
|
||||
embeddings=[vec],
|
||||
metadatas=[{"arxiv_id": arxiv_id, "title_zh": title_zh, "paper_date": paper_date}],
|
||||
metadatas=[
|
||||
{"arxiv_id": arxiv_id, "title_zh": title_zh, "paper_date": paper_date}
|
||||
],
|
||||
)
|
||||
logger.info("Indexed paper %s in ChromaDB", arxiv_id)
|
||||
return True
|
||||
@@ -262,7 +266,9 @@ def index_batch(paper_ids: list[str]) -> dict:
|
||||
else:
|
||||
failed += 1
|
||||
|
||||
logger.info("Batch index: total=%d success=%d failed=%d", len(paper_ids), success, failed)
|
||||
logger.info(
|
||||
"Batch index: total=%d success=%d failed=%d", len(paper_ids), success, failed
|
||||
)
|
||||
return {"total": len(paper_ids), "success": success, "failed": failed}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user