安装Ollama
省略,参考:https://www.jianshu.com/p/ca6af4c96581
运行嵌入模型
# 运行 nomic-embed-text 嵌入模型
ollama pull nomic-embed-text
# 运行 mxbai-embed-large 嵌入模型
ollama pull mxbai-embed-large
通过Ollama API测试嵌入模型
curl http://10.3.6.38:11434/api/embed -d '{
"model": "nomic-embed-text",
"input": "Llamas are members of the camelid family"
}'
效果:
[root@bogon ~]# curl http://10.3.6.38:11434/api/embed -d '{
"model": "nomic-embed-text",
"input": "Llamas are members of the camelid family"
}'
{"model":"nomic-embed-text","embeddings":[[0.014543912,0.014353983,-0.15859936,-0.05635971,0.013833548,0.00045747016,-0.082582116,-0.07535395,-0.040231105,-0.005863341,-0.0068954662,0.047798615,0.07013451,0.017024966,0.0392089,-0.020978166,-0.060597282,-0.017331367,0.04145304,0.024633398,-0.06402724,...省略很多....,-0.06301445]],"total_duration":788713071,"load_duration":519436478,"prompt_eval_count":10}[
可惜,ollama目前还不支持Reranker Model的运行