diff --git a/modules/models/OpenAIVision.py b/modules/models/OpenAIVision.py index 098f7c58..40fa2be7 100644 --- a/modules/models/OpenAIVision.py +++ b/modules/models/OpenAIVision.py @@ -191,14 +191,10 @@ def _get_response(self, stream=False): else: timeout = TIMEOUT_ALL - # 如果有自定义的api-host,使用自定义host发送请求,否则使用默认设置发送请求 - if shared.state.chat_completion_url != CHAT_COMPLETION_URL: - logging.debug(f"使用自定义API URL: {shared.state.chat_completion_url}") - with retrieve_proxy(): try: response = requests.post( - shared.state.chat_completion_url, + self.chat_completion_url, headers=headers, json=payload, stream=stream, @@ -282,13 +278,10 @@ def _single_query_at_once(self, history, temperature=1.0): "model": self.model_name, "messages": history, } - # 如果有自定义的api-host,使用自定义host发送请求,否则使用默认设置发送请求 - if shared.state.chat_completion_url != CHAT_COMPLETION_URL: - logging.debug(f"使用自定义API URL: {shared.state.chat_completion_url}") with retrieve_proxy(): response = requests.post( - shared.state.chat_completion_url, + self.chat_completion_url, headers=headers, json=payload, stream=False,