7bfb9946
tangwang
向量化模块
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
"""
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()
|