Skip to content

Commit 40e5e96

Browse files
author
n0x29a
committed
draft
1 parent 8d04b81 commit 40e5e96

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed

fastembed/config/dense_models.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"models": [
3+
{
4+
"model": "BAAI/bge-base-en",
5+
"dim": 768,
6+
"description": "Text embeddings, Unimodal (text), English...",
7+
"license": "mit",
8+
"size_in_GB": 0.42,
9+
"sources": {
10+
"hf": "Qdrant/fast-bge-base-en",
11+
"url": "https://storage.googleapis.com/qdrant-fastembed/fast-bge-base-en.tar.gz"
12+
},
13+
"model_file": "model_optimized.onnx"
14+
}
15+
]
16+
}

fastembed/config/sparse_models.json

Whitespace-only changes.

fastembed/model_loader.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
from pathlib import Path
2+
import json
3+
from typing import Dict, List
4+
5+
6+
class ModelLoader:
7+
def __init__(self):
8+
self.config_dir = Path(__file__).parent / "configs"
9+
self._models: Dict[str, List[Dict]] = {}
10+
11+
def load_models(self, model_type: str) -> List[Dict]:
12+
if model_type not in self._models:
13+
config_path = self.config_dir / f"{model_type}_models.json"
14+
with open(config_path) as f:
15+
self._models[model_type] = json.load(f)["models"]
16+
return self._models[model_type]

0 commit comments

Comments
 (0)