原始代码

This commit is contained in:
xxm
2025-12-05 07:11:25 +00:00
parent 045e777a11
commit dd5339de32
46 changed files with 5848 additions and 0 deletions

11
xinference_client.py Normal file
View File

@@ -0,0 +1,11 @@
import requests
from typing import List
XINFERENCE_EMBED_URL = "http://127.0.0.1:9997/models/bge-base-zh/embed"
def embed_texts(texts: List[str]) -> List[List[float]]:
payload = {"inputs": texts}
resp = requests.post(XINFERENCE_EMBED_URL, json=payload, timeout=30)
resp.raise_for_status()
data = resp.json()
return data.get("embeddings", [])