Spaces:
Running on Zero
Running on Zero
Update app.py
Browse files953 unmodified lines95495595695795895996014 unmodified lines975976977978979980953 unmodified linesif out:return outbreakif any(marker in err_lowfor marker in ("429",14 unmodified linesif hasattr(self, "_sync_provider_env"):self._sync_provider_env(v_provider, pool[0] if pool else "")breakraise RuntimeError(str(last_err) if last_err else "No vision model available.")except Exception as e:953 unmodified lines95495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899914 unmodified lines1014101510161017101810191020953 unmodified linesif out:return outbreakexcept Exception as exc:last_err = excerr_low = str(exc).lower()if "task time budget exhausted" in err_low:raiseif any(marker in err_lowfor marker in ("400","badrequesterror","reasoning is mandatory","cannot be disabled","404","not found","model_not_found","decommissioned","unsupported",)):dead_models.add(v_model)breakif any(marker in err_lowfor marker in ("401","402","403","authentication","invalid api key","permission_denied","insufficient permissions",)):if hasattr(self, "_rotate_api_key") and self._rotate_api_key(v_provider, permanent=True):continuerate_limited_providers.add(v_provider)breakif any(marker in err_lowfor marker in ("429",14 unmodified linesif hasattr(self, "_sync_provider_env"):self._sync_provider_env(v_provider, pool[0] if pool else "")breakbreakraise RuntimeError(str(last_err) if last_err else "No vision model available.")except Exception as e:
app.py+41-1