config.py
744 Bytes
"""
Embedding module configuration.
This module is intentionally a plain Python file (no env var parsing, no extra deps).
Edit values here to configure:
- server host/port
- local model settings (paths/devices/batch sizes)
"""
from typing import Optional
class EmbeddingConfig(object):
# Server
HOST = "0.0.0.0"
PORT = 6005
# Text embeddings (BGE-M3)
TEXT_MODEL_DIR = "Xorbits/bge-m3"
TEXT_DEVICE = "cuda" # "cuda" or "cpu" (model may fall back to CPU if needed)
TEXT_BATCH_SIZE = 32
# Image embeddings (CN-CLIP)
IMAGE_MODEL_NAME = "ViT-H-14"
IMAGE_DEVICE = None # type: Optional[str] # "cuda" / "cpu" / None(auto)
# Service behavior
IMAGE_BATCH_SIZE = 8
CONFIG = EmbeddingConfig()