michaelfeil / infinity

Infinity is a high-throughput, low-latency REST API for serving vector embeddings, supporting a wide range of text-embedding models and frameworks.
https://michaelfeil.eu/infinity/
MIT License
977 stars 72 forks source link

"msg":"Input should be a valid list" #130

Closed fishfree closed 4 months ago

fishfree commented 4 months ago

I totally adapted the OpenAI CURL example as below:

curl https://localhost:7997/embeddings \
  -H "Content-Type: application/json" \
  -d '{
    "input": "Your text string goes here",
    "model": "BAAI/bge-small-en-v1.5"
  }'

Infinity showed errors as below: {"detail":[{"type":"list_type","loc":["body","input"],"msg":"Input should be a valid list". I changed to:

curl https://localhost:7997/embeddings \
  -H "Content-Type: application/json" \
  -d '{
    "input": ["Your text string goes here"],
    "model": "BAAI/bge-small-en-v1.5"
  }'

It worked.

How can I modify Infinity codes to totally compatible with OpenAI API? Many thanks!

michaelfeil commented 4 months ago

Should be fixed with 0.0.26!

michaelfeil commented 4 months ago

https://github.com/michaelfeil/infinity/issues/98

https://github.com/michaelfeil/infinity/pull/99

fishfree commented 4 months ago

@michaelfeil Michael, would you please also update the docker image? For when runpip install infinity-emb[all], the error still exists.

michaelfeil commented 4 months ago

The docker inage is released. Make sure to NOT pull "latest" but pin your image to a version, e.g. michaelf34/infinity:0.0.26 Thank you.

https://github.com/michaelfeil/infinity/actions/runs/8118848897

michaelfeil commented 4 months ago

@fishfree Also, make sure that the version you have installed via pip is 0.0.26

fishfree commented 4 months ago

@michaelfeil Thank you, Michael!