Skip to content

Commit 3b70968

Browse files
updated one condition
1 parent d5dacca commit 3b70968

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

scripts/validate_model_quota.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,14 @@ print_recommended_warning() {
3333
local capacity="$1"
3434
local recommended_list
3535
recommended_list=$(IFS=, ; echo "${RECOMMENDED_REGIONS[*]}")
36+
primary_entry="${ALL_RESULTS[0]}"
37+
IFS='|' read -r _ limit used available <<< "$primary_entry"
3638
echo -e "\n⚠️ You have entered a capacity of $capacity, which is less than the recommended minimum ($RECOMMENDED_TOKENS)."
3739
echo -e "🚨 This may cause performance issues or unexpected behavior."
38-
echo -e "ℹ️ Recommended regions (≥ $RECOMMENDED_TOKENS tokens available): $recommended_list"
40+
echo -e "📊 Available quota in '$LOCATION': $available, Required: $capacity"
41+
if [[ -n "$recommended_list" ]]; then
42+
echo -e "ℹ️ Recommended regions (≥ $RECOMMENDED_TOKENS tokens available): $recommended_list"
43+
fi
3944
}
4045

4146
update_env_and_parameters() {
@@ -195,6 +200,7 @@ fi
195200
echo -e "\n🔍 Checking quota in the requested region '$LOCATION'..."
196201
if check_quota "$LOCATION"; then
197202
if (( CAPACITY < RECOMMENDED_TOKENS )); then
203+
check_fallback_regions
198204
print_recommended_warning "$CAPACITY"
199205
prompt_yes_no "❓ Proceed anyway? (y/n): " || {
200206
ask_for_location

0 commit comments

Comments
 (0)