This commit is contained in:
hailin 2025-08-05 11:52:20 +08:00
parent 23adcd15a7
commit ca8f4a43bf
1 changed files with 2 additions and 2 deletions

View File

@ -28,7 +28,7 @@ from FlagEmbedding import BGEM3FlagModel
# -----------------------------------------------------------------------------#
MODEL_PATH = "model/bge-m3" # 按需改成你的权重路径
SAFE_MIN_FREE_MB = int(
os.getenv("SAFE_MIN_FREE_MB", "4096")
os.getenv("SAFE_MIN_FREE_MB", "16384")
) # 启动时要求的最小空闲显存MB
# -----------------------------------------------------------------------------#
@ -169,7 +169,7 @@ tokenizer = AutoTokenizer.from_pretrained(MODEL_PATH)
# FastAPI
# -----------------------------------------------------------------------------#
app = FastAPI()
logger.info("Using SAFE_MIN_FREE_MB = %d MB", SAFE_MIN_FREE_MB)
class EmbeddingRequest(BaseModel):
input: Union[str, List[str]]