-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(rerankers): Add new backend, support jina rerankers API
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
- Loading branch information
Showing
25 changed files
with
630 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: jina-reranker-v1-base-en | ||
backend: rerankers | ||
parameters: | ||
model: cross-encoder | ||
|
||
usage: | | ||
You can test this model with curl like this: | ||
curl http://localhost:8080/v1/rerank \ | ||
-H "Content-Type: application/json" \ | ||
-d '{ | ||
"model": "jina-reranker-v1-base-en", | ||
"query": "Organic skincare products for sensitive skin", | ||
"documents": [ | ||
"Eco-friendly kitchenware for modern homes", | ||
"Biodegradable cleaning supplies for eco-conscious consumers", | ||
"Organic cotton baby clothes for sensitive skin", | ||
"Natural organic skincare range for sensitive skin", | ||
"Tech gadgets for smart homes: 2024 edition", | ||
"Sustainable gardening tools and compost solutions", | ||
"Sensitive skin-friendly facial cleansers and toners", | ||
"Organic food wraps and storage solutions", | ||
"All-natural pet food for dogs with allergies", | ||
"Yoga mats made from recycled materials" | ||
], | ||
"top_n": 3 | ||
}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: jina-reranker-v1-base-en | ||
backend: rerankers | ||
parameters: | ||
model: cross-encoder | ||
|
||
usage: | | ||
You can test this model with curl like this: | ||
curl http://localhost:8080/v1/rerank \ | ||
-H "Content-Type: application/json" \ | ||
-d '{ | ||
"model": "jina-reranker-v1-base-en", | ||
"query": "Organic skincare products for sensitive skin", | ||
"documents": [ | ||
"Eco-friendly kitchenware for modern homes", | ||
"Biodegradable cleaning supplies for eco-conscious consumers", | ||
"Organic cotton baby clothes for sensitive skin", | ||
"Natural organic skincare range for sensitive skin", | ||
"Tech gadgets for smart homes: 2024 edition", | ||
"Sustainable gardening tools and compost solutions", | ||
"Sensitive skin-friendly facial cleansers and toners", | ||
"Organic food wraps and storage solutions", | ||
"All-natural pet food for dogs with allergies", | ||
"Yoga mats made from recycled materials" | ||
], | ||
"top_n": 3 | ||
}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: jina-reranker-v1-base-en | ||
backend: rerankers | ||
parameters: | ||
model: cross-encoder | ||
|
||
usage: | | ||
You can test this model with curl like this: | ||
curl http://localhost:8080/v1/rerank \ | ||
-H "Content-Type: application/json" \ | ||
-d '{ | ||
"model": "jina-reranker-v1-base-en", | ||
"query": "Organic skincare products for sensitive skin", | ||
"documents": [ | ||
"Eco-friendly kitchenware for modern homes", | ||
"Biodegradable cleaning supplies for eco-conscious consumers", | ||
"Organic cotton baby clothes for sensitive skin", | ||
"Natural organic skincare range for sensitive skin", | ||
"Tech gadgets for smart homes: 2024 edition", | ||
"Sustainable gardening tools and compost solutions", | ||
"Sensitive skin-friendly facial cleansers and toners", | ||
"Organic food wraps and storage solutions", | ||
"All-natural pet food for dogs with allergies", | ||
"Yoga mats made from recycled materials" | ||
], | ||
"top_n": 3 | ||
}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
.PHONY: rerankers | ||
rerankers: protogen | ||
$(MAKE) -C ../common-env/transformers | ||
|
||
|
||
.PHONY: run | ||
run: protogen | ||
@echo "Running rerankers..." | ||
bash run.sh | ||
@echo "rerankers run." | ||
|
||
# It is not working well by using command line. It only6 works with IDE like VSCode. | ||
.PHONY: test | ||
test: protogen | ||
@echo "Testing rerankers..." | ||
bash test.sh | ||
@echo "rerankers tested." | ||
|
||
.PHONY: protogen | ||
protogen: backend_pb2_grpc.py backend_pb2.py | ||
|
||
.PHONY: protogen-clean | ||
protogen-clean: | ||
$(RM) backend_pb2_grpc.py backend_pb2.py | ||
|
||
backend_pb2_grpc.py backend_pb2.py: | ||
python3 -m grpc_tools.protoc -I../.. --python_out=. --grpc_python_out=. backend.proto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Creating a separate environment for the reranker project | ||
|
||
``` | ||
make reranker | ||
``` |
Oops, something went wrong.