ragflow/rag/llm
shizzgar 4b3eeaa6ef
Added LocalAI support for rerank models (#3446)
### What problem does this PR solve?

Hi there!
LocalAI added support of rerank models
https://localai.io/features/reranker/

I've implemented LocalAIRerank class (typically copied it from
OpenAI_APIRerank class).
Also, LocalAI model response with 500 error code if len of "documents"
is less than 2 in similarity check.
So I've added the second "document" on RERANK model connection check in
`api/apps/llm_app.py`.

### Type of change

- [x] New Feature (non-breaking change which adds functionality)

Co-authored-by: Kevin Hu <kevinhu.sh@gmail.com>
2024-11-18 12:05:52 +08:00
..
__init__.py Added LocalAI support for rerank models (#3446) 2024-11-18 12:05:52 +08:00
chat_model.py Fix the value issue of anthropic (#3351) 2024-11-13 16:13:52 +08:00
cv_model.py Fix keys of Xinference deployed models, especially has the same model name with public hosted models. (#2832) 2024-10-16 10:21:08 +08:00
embedding_model.py Move settings initialization after module init phase (#3438) 2024-11-15 17:30:56 +08:00
rerank_model.py Added LocalAI support for rerank models (#3446) 2024-11-18 12:05:52 +08:00
sequence2txt_model.py fix sequence2txt error and usage total token issue (#2961) 2024-10-22 11:38:37 +08:00
tts_model.py support sequence2txt and tts model in Xinference (#2696) 2024-10-08 10:43:18 +08:00