BGE-large Embeddings api by FastAPI
Refer to m3e-large-api
docker run -d --name bge-large-api -p 6008:6008 jokerwho/bge-large-api:latest
required nvidia-docker2
docker run -d --name bge-large-api --gpus all -p 6008:6008 jokerwho/bge-large-api:latest
curl --location --request POST 'http://127.0.0.1/v1/embeddings' \
--header 'Authorization: Bearer sk-aaabbbcccdddeeefffggghhhiiijjjkkk' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "bge-large-zh-v1.5",
"input": ["github是什么"]
}'
from huggingface_hub import snapshot_download
snapshot_download(repo_id="BAAI/bge-large-zh-v1.5",cache_dir="./cache", local_dir="models/bge-large-zh-v1.5")
print("======download successful=====")
rm -r ./cache
pip install -r requirements.txt
python main.py