Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update reranks tei test #284

Merged
merged 6 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/scripts/docker_images_build_push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ case ${micro_service} in
"retrievers/langchain")
IMAGE_NAME="opea/retriever-redis"
;;
"reranks/langchain")
"reranks/tei")
IMAGE_NAME="opea/reranking-tei"
;;
"llms/text-generation/tgi")
Expand Down
2 changes: 2 additions & 0 deletions comps/llms/text-generation/tgi/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
aiohttp
docarray[full]
fastapi
httpx
huggingface_hub
langsmith
opentelemetry-api
Expand Down
2 changes: 2 additions & 0 deletions comps/reranks/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
aiohttp
docarray[full]
fastapi
httpx
langsmith
opentelemetry-api
opentelemetry-exporter-otlp
Expand Down
3 changes: 3 additions & 0 deletions comps/retrievers/llamaindex/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
aiohttp
docarray[full]
easyocr
fastapi
httpx
langsmith
llama-index-vector-stores-redis
llama_index
Expand All @@ -11,3 +13,4 @@ pymupdf
redis
sentence_transformers
shortuuid

17 changes: 12 additions & 5 deletions tests/test_reranks_langchain.sh → tests/test_reranks_tei.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ WORKPATH=$(dirname "$PWD")
ip_address=$(hostname -I | awk '{print $1}')
function build_docker_images() {
cd $WORKPATH
docker build --no-cache -t opea/reranking-tei:comps -f comps/reranks/langchain/docker/Dockerfile .
docker build --no-cache -t opea/reranking-tei:comps -f comps/reranks/tei/docker/Dockerfile .
}

function start_service() {
Expand All @@ -29,12 +29,19 @@ function start_service() {

function validate_microservice() {
tei_service_port=5007
http_proxy="" curl http://${ip_address}:${tei_service_port}/v1/reranking\
local CONTENT=$(curl http://${ip_address}:${tei_service_port}/v1/reranking \
-X POST \
-d '{"initial_query":"What is Deep Learning?", "retrieved_docs": [{"text":"Deep Learning is not..."}, {"text":"Deep learning is..."}]}' \
-H 'Content-Type: application/json'
docker logs test-comps-reranking-tei-server
docker logs test-comps-reranking-tei-endpoint
-H 'Content-Type: application/json')

if echo "$CONTENT" | grep -q "### Search results:"; then
echo "Content is as expected."
else
echo "Content does not match the expected result: $CONTENT"
docker logs test-comps-reranking-tei-server
docker logs test-comps-reranking-tei-endpoint
exit 1
fi
}

function stop_docker() {
Expand Down
Loading