Skip to content

armgit / storm

Public Imported from GitHub
0

An LLM-powered knowledge curation system that researches a topic and generates a full-length report with citations.

removed the default collection name and model from vectorRM to avoid confusions when deploying like choosing a wrong model other than the one the vector store was built with or a collection name that is outdated

AMMAS1638acc0ae34d
diff --git a/knowledge_storm/rm.py b/knowledge_storm/rm.py
index 723b125..7b315e5 100644
--- a/knowledge_storm/rm.py
+++ b/knowledge_storm/rm.py
@@ -177,8 +177,8 @@ class VectorRM(dspy.Retrieve):
"""
def __init__(self,
- collection_name: str = "my_documents",
- embedding_model: str = 'BAAI/bge-m3',
+ collection_name: str,
+ embedding_model: str,
device: str = "mps",
k: int = 3,
):
@@ -191,6 +191,12 @@ class VectorRM(dspy.Retrieve):
"""
super().__init__(k=k)
self.usage = 0
+ # check if the collection is provided
+ if not collection_name:
+ raise ValueError("Please provide a collection name.")
+ # check if the embedding model is provided
+ if not embedding_model:
+ raise ValueError("Please provide an embedding model.")
model_kwargs = {"device": device}
encode_kwargs = {"normalize_embeddings": True}