Create a OpenAI compatible text-embddding server from open source text embedding model.
First, create new virtual environment by conda
and activate it.
conda create -n openai-text-embedding python=3.11
conda activate openai-text-embedding
Then, install the dependencies.
pip install -r requirements.txt
# Or use mirror
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
Clone the repository, then modify the model_path.json
file to specify the path of your model or the respository of your model.
{
"model_path": "path/to/your/model"
}
Then, run the server by
uvicorn text_embedding:app --reload
You can open the http://localhost:8000/docs
to test the server.