Skip to content

Commit

Permalink
added training successfulness check in finetuning ut.
Browse files Browse the repository at this point in the history
Signed-off-by: Ye, Xinyu <[email protected]>
  • Loading branch information
XinyuYe-Intel committed Nov 6, 2024
1 parent 3918fc6 commit b0f945a
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/finetuning/test_finetuning.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ function validate_finetune() {
HTTP_RESPONSE=$(curl --silent --write-out "HTTPSTATUS:%{http_code}" -X POST -H 'Content-Type: application/json' -d "$INPUT_DATA" "$URL")
HTTP_STATUS=$(echo $HTTP_RESPONSE | tr -d '\n' | sed -e 's/.*HTTPSTATUS://')
RESPONSE_BODY=$(echo $HTTP_RESPONSE | sed -e 's/HTTPSTATUS\:.*//g')
FINTUNING_ID=$(echo "$RESPONSE_BODY" | jq -r '.id')

# Parse the JSON response
purpose=$(echo "$RESPONSE_BODY" | jq -r '.purpose')
Expand All @@ -96,6 +97,26 @@ function validate_finetune() {
fi

sleep 10s

# check finetuning job status
URL="$URL/retrieve"
for((i=1;i<=10;i++));
do
HTTP_RESPONSE=$(curl --silent --write-out "HTTPSTATUS:%{http_code}" -X POST -H "Content-Type: application/json" -d '{"fine_tuning_job_id": "'$FINTUNING_ID'"}' "$URL")
echo $HTTP_RESPONSE
RESPONSE_BODY=$(echo $HTTP_RESPONSE | sed -e 's/HTTPSTATUS\:.*//g')
STATUS=$(echo "$RESPONSE_BODY" | jq -r '.status')
if [[ "$STATUS" == "succeeded" ]]; then
echo "training: succeeded."
break
elif [[ "$STATUS" == "failed" ]]; then
echo "training: failed."
exit 1
else
echo "training: '$STATUS'"
fi
sleep 1m
done
}

function validate_microservice() {
Expand Down

0 comments on commit b0f945a

Please sign in to comment.