This commit is contained in:
n0x29a
2025-02-18 17:57:33 +01:00
parent 8d04b81782
commit 40e5e96212
3 changed files with 32 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
{
"models": [
{
"model": "BAAI/bge-base-en",
"dim": 768,
"description": "Text embeddings, Unimodal (text), English...",
"license": "mit",
"size_in_GB": 0.42,
"sources": {
"hf": "Qdrant/fast-bge-base-en",
"url": "https://storage.googleapis.com/qdrant-fastembed/fast-bge-base-en.tar.gz"
},
"model_file": "model_optimized.onnx"
}
]
}

View File

16
fastembed/model_loader.py Normal file
View File

@@ -0,0 +1,16 @@
from pathlib import Path
import json
from typing import Dict, List
class ModelLoader:
def __init__(self):
self.config_dir = Path(__file__).parent / "configs"
self._models: Dict[str, List[Dict]] = {}
def load_models(self, model_type: str) -> List[Dict]:
if model_type not in self._models:
config_path = self.config_dir / f"{model_type}_models.json"
with open(config_path) as f:
self._models[model_type] = json.load(f)["models"]
return self._models[model_type]