feat: model: Optional[str] = None

This commit is contained in:
莘权 马 2024-09-04 11:03:43 +08:00
parent d5c29a16ad
commit cd8bd28216

View file

@ -29,7 +29,7 @@ class IndexRepo(BaseModel):
filename: str
root_path: str
fingerprint_filename: str = "fingerprint.json"
model: str = "text-embedding-ada-002"
model: Optional[str] = None
min_token_count: int = 5000
max_token_count: int = 100000
recall_count: int = 5
@ -95,7 +95,8 @@ class IndexRepo(BaseModel):
"""
if not self.embedding:
config = Config.default()
config.embedding.model = self.model
if self.model:
config.embedding.model = self.model
factory = RAGEmbeddingFactory(config)
self.embedding = factory.get_rag_embedding()