mirror of
https://github.com/immich-app/immich.git
synced 2025-05-24 01:12:58 -04:00
* model benchmarks * minor fixes * formatting * docs build * maybe fix reference * clarify optimal * use emojis * wording * wording * clarify optimal wording * bolding * more detailed instructions * clarify edge case fix * early exit in dim loop
23 lines
743 B
Python
23 lines
743 B
Python
import json
|
|
from pathlib import Path
|
|
|
|
models_dir = Path("models")
|
|
model_to_embed_dim = {}
|
|
for model_dir in models_dir.iterdir():
|
|
if not model_dir.is_dir():
|
|
continue
|
|
|
|
config_path = model_dir / "config.json"
|
|
if not config_path.exists():
|
|
print(f"Skipping {model_dir.name} as it does not have a config.json")
|
|
continue
|
|
with open(config_path) as f:
|
|
config = json.load(f)
|
|
embed_dim = config.get("embed_dim")
|
|
if embed_dim is None:
|
|
print(f"Skipping {model_dir.name} as it does not have an embed_dim")
|
|
continue
|
|
print(f"{model_dir.name}: {embed_dim}")
|
|
model_to_embed_dim[model_dir.name] = {"dimSize": embed_dim}
|
|
print(json.dumps(model_to_embed_dim))
|