Skip to content

Commit

Permalink
change searchqna prompt (#639)
Browse files Browse the repository at this point in the history
* change prompt

* debug

* debug

---------

Co-authored-by: chen, suyue <suyue.chen@intel.com>
  • Loading branch information
Spycsh and chensuyue authored Aug 22, 2024
1 parent 06cb308 commit acbaaf8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
4 changes: 2 additions & 2 deletions SearchQnA/tests/test_gmc_on_gaudi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ function validate_searchqa() {
export CLIENT_POD=$(kubectl get pod -n $APP_NAMESPACE -l app=client-test -o jsonpath={.items..metadata.name})
echo "$CLIENT_POD"
accessUrl=$(kubectl get gmc -n $APP_NAMESPACE -o jsonpath="{.items[?(@.metadata.name=='searchqa')].status.accessUrl}")
kubectl exec "$CLIENT_POD" -n $APP_NAMESPACE -- curl $accessUrl -X POST -d '{"text":"What is the latest news? Give me also the source link."}' -H 'Content-Type: application/json' > $LOG_PATH/gmc_searchqa.log
kubectl exec "$CLIENT_POD" -n $APP_NAMESPACE -- curl $accessUrl -X POST -d '{"text":"How many gold medals does USA win in olympics 2024? Give me also the source link."}' -H 'Content-Type: application/json' > $LOG_PATH/gmc_searchqa.log
exit_code=$?
if [ $exit_code -ne 0 ]; then
echo "chatqna failed, please check the logs in ${LOG_PATH}!"
echo "searchqna failed, please check the logs in ${LOG_PATH}!"
exit 1
fi

Expand Down
4 changes: 2 additions & 2 deletions SearchQnA/tests/test_gmc_on_xeon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ function validate_searchqa() {
export CLIENT_POD=$(kubectl get pod -n $APP_NAMESPACE -l app=client-test -o jsonpath={.items..metadata.name})
echo "$CLIENT_POD"
accessUrl=$(kubectl get gmc -n $APP_NAMESPACE -o jsonpath="{.items[?(@.metadata.name=='searchqa')].status.accessUrl}")
kubectl exec "$CLIENT_POD" -n $APP_NAMESPACE -- curl $accessUrl -X POST -d '{"text":"What is the latest news? Give me also the source link."}' -H 'Content-Type: application/json' > $LOG_PATH/gmc_searchqa.log
kubectl exec "$CLIENT_POD" -n $APP_NAMESPACE -- curl $accessUrl -X POST -d '{"text":"How many gold medals does USA win in olympics 2024? Give me also the source link."}' -H 'Content-Type: application/json' > $LOG_PATH/gmc_searchqa.log
exit_code=$?
if [ $exit_code -ne 0 ]; then
echo "chatqna failed, please check the logs in ${LOG_PATH}!"
echo "searchqna failed, please check the logs in ${LOG_PATH}!"
exit 1
fi

Expand Down
8 changes: 6 additions & 2 deletions SearchQnA/tests/test_searchqna_on_gaudi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,14 @@ function start_services() {


function validate_megaservice() {
result=$(http_proxy="" curl http://${ip_address}:3008/v1/searchqna -XPOST -d '{"messages": "What is the latest news? Give me also the source link", "stream": "False"}' -H 'Content-Type: application/json')
result=$(http_proxy="" curl http://${ip_address}:3008/v1/searchqna -XPOST -d '{"messages": "How many gold medals does USA win in olympics 2024? Give me also the source link.", "stream": "False"}' -H 'Content-Type: application/json')
echo $result

if [[ $result == *"news"* ]]; then
if [[ $result == *"2024"* ]]; then
docker logs web-retriever-chroma-server > ${LOG_PATH}/web-retriever-chroma-server.log
docker logs searchqna-gaudi-backend-server > ${LOG_PATH}/searchqna-gaudi-backend-server.log
docker logs tei-embedding-gaudi-server > ${LOG_PATH}/tei-embedding-gaudi-server.log
docker logs embedding-tei-server > ${LOG_PATH}/embedding-tei-server.log
echo "Result correct."
else
docker logs web-retriever-chroma-server > ${LOG_PATH}/web-retriever-chroma-server.log
Expand Down
6 changes: 4 additions & 2 deletions SearchQnA/tests/test_searchqna_on_xeon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,12 @@ function start_services() {


function validate_megaservice() {
result=$(http_proxy="" curl http://${ip_address}:3008/v1/searchqna -XPOST -d '{"messages": "What is the latest news? Give me also the source link", "stream": "False"}' -H 'Content-Type: application/json')
result=$(http_proxy="" curl http://${ip_address}:3008/v1/searchqna -XPOST -d '{"messages": "How many gold medals does USA win in olympics 2024? Give me also the source link.", "stream": "False"}' -H 'Content-Type: application/json')
echo $result

if [[ $result == *"news"* ]]; then
if [[ $result == *"2024"* ]]; then
docker logs web-retriever-chroma-server
docker logs searchqna-xeon-backend-server
echo "Result correct."
else
docker logs web-retriever-chroma-server
Expand Down

0 comments on commit acbaaf8

Please sign in to comment.