Skip to content

Commit 6bb6e4f

Browse files
updated the validation file
1 parent 3eba022 commit 6bb6e4f

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

scripts/validate_model_quota.sh

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ print_recommended_warning() {
4545
echo -e "\n⚠️ You have entered a capacity of $capacity, which is less than the recommended minimum ($RECOMMENDED_TOKENS)."
4646
echo -e "🚨 This may cause performance issues or unexpected behavior."
4747
echo -e "📊 Available quota in '$LOCATION': $available, Required: $capacity"
48+
if (( available < RECOMMENDED_TOKENS )); then
49+
echo -e "❗️ Available quota is below recommended minimum ($RECOMMENDED_TOKENS)."
50+
check_fallback_regions
51+
else
52+
echo -e "ℹ️ Available quota is sufficient for the requested capacity."
53+
fi
4854
else
4955
echo -e "\n⚠️ Capacity entered is below recommended, but region quota data was not found."
5056
fi
@@ -113,7 +119,7 @@ show_table() {
113119
local index=1
114120
for result in "${ALL_RESULTS[@]}"; do
115121
IFS='|' read -r region limit used available <<< "$result"
116-
if (( available >= 50 )); then
122+
if (( available >= 50 )) && [[ -z "${printed_regions[$region]}" ]]; then
117123
printf "| %-3s | %-16s | %-33s | %-6s | %-6s | %-9s |\n" "$index" "$region" "OpenAI.$DEPLOYMENT_TYPE.$MODEL" "$limit" "$used" "$available"
118124
((index++))
119125
fi
@@ -185,9 +191,9 @@ check_fallback_regions() {
185191
echo -e "\n❌ ERROR: No region has sufficient quota."
186192
fi
187193

188-
prompt_yes_no "Would you like to retry with a different region? (y/n): " && ask_for_location || {
189-
echo "Exiting... No region with sufficient quota."
190-
exit 1
194+
prompt_yes_no "Proceed anyway? (y/n): " || {
195+
ask_for_location
196+
return
191197
}
192198
}
193199

0 commit comments

Comments
 (0)