文章主题:ChatGPT, 搜索引擎, 聊天机器人, 人工智能
ChatGPT会取代搜索引擎吗?BingChat、GoogleBard与ChatGPT区别
<!doctype html> <html lang=en> <head> <title>requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=7861): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000002524EE2B370>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。')) // Werkzeug Debugger</title> <link rel=”stylesheet” href=”?__debugger__=yes&cmd=resource&f=style.css”> <link rel=”shortcut icon” href=”?__debugger__=yes&cmd=resource&f=console.png”> <script src=”?__debugger__=yes&cmd=resource&f=debugger.js”></script> <script> var CONSOLE_MODE = false, EVALEX = true, EVALEX_TRUSTED = false, SECRET = “uImqR9BO9WQOrgY4YnuS”; </script> </head> <body style=”background-color: #fff”> <div class=”debugger”> <h1>ConnectionError</h1> <div class=”detail”> <p class=”errormsg”>requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=7861): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000002524EE2B370>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。')) </p> </div> <h2 class=”traceback”>Traceback <em>(most recent call last)</em></h2> <div class=”traceback”> <h3></h3> <ul><li><div class=”frame” id=”frame-2552534078624″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py”</cite>, line <em class=”line”>203</em>, in <code class=”function”>_new_conn</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>"""Establish a socket connection and set nodelay settings on it.</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>:return: New socket connection.</pre> <pre class=”line before”><span class=”ws”> </span>"""</pre> <pre class=”line before”><span class=”ws”> </span>try:</pre> <pre class=”line current”><span class=”ws”> </span>sock = connection.create_connection(</pre> <pre class=”line after”><span class=”ws”> </span>(self._dns_host, self.port),</pre> <pre class=”line after”><span class=”ws”> </span>self.timeout,</pre> <pre class=”line after”><span class=”ws”> </span>source_address=self.source_address,</pre> <pre class=”line after”><span class=”ws”> </span>socket_options=self.socket_options,</pre> <pre class=”line after”><span class=”ws”> </span>)</pre></div> </div> <li><div class=”frame” id=”frame-2552534078736″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\urllib3\util\connection.py”</cite>, line <em class=”line”>85</em>, in <code class=”function”>create_connection</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>if sock is not None:</pre> <pre class=”line before”><span class=”ws”> </span>sock.close()</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>if err is not None:</pre> <pre class=”line before”><span class=”ws”> </span>try:</pre> <pre class=”line current”><span class=”ws”> </span>raise err</pre> <pre class=”line after”><span class=”ws”> </span>finally:</pre> <pre class=”line after”><span class=”ws”> </span># Break explicitly a reference cycle</pre> <pre class=”line after”><span class=”ws”> </span>err = None</pre> <pre class=”line after”><span class=”ws”> </span>else:</pre> <pre class=”line after”><span class=”ws”> </span>raise OSError("getaddrinfo returns an empty list")</pre></div> </div> <li><div class=”frame” id=”frame-2552534078848″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\urllib3\util\connection.py”</cite>, line <em class=”line”>73</em>, in <code class=”function”>create_connection</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>if timeout is not _DEFAULT_TIMEOUT:</pre> <pre class=”line before”><span class=”ws”> </span>sock.settimeout(timeout)</pre> <pre class=”line before”><span class=”ws”> </span>if source_address:</pre> <pre class=”line before”><span class=”ws”> </span>sock.bind(source_address)</pre> <pre class=”line current”><span class=”ws”> </span>sock.connect(sa)</pre> <pre class=”line after”><span class=”ws”> </span># Break explicitly a reference cycle</pre> <pre class=”line after”><span class=”ws”> </span>err = None</pre> <pre class=”line after”><span class=”ws”> </span>return sock</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>except OSError as _:</pre></div> </div> <li><div class=”exc-divider”>The above exception was the direct cause of the following exception:</div> <li><div class=”frame” id=”frame-2552534077504″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py”</cite>, line <em class=”line”>790</em>, in <code class=”function”>urlopen</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span># it will also try to release it and we'll have a double-release</pre> <pre class=”line before”><span class=”ws”> </span># mess.</pre> <pre class=”line before”><span class=”ws”> </span>response_conn = conn if not release_conn else None</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span># Make the request on the HTTPConnection object</pre> <pre class=”line current”><span class=”ws”> </span>response = self._make_request(</pre> <pre class=”line after”><span class=”ws”> </span>conn,</pre> <pre class=”line after”><span class=”ws”> </span>method,</pre> <pre class=”line after”><span class=”ws”> </span>url,</pre> <pre class=”line after”><span class=”ws”> </span>timeout=timeout_obj,</pre> <pre class=”line after”><span class=”ws”> </span>body=body,</pre></div> </div> <li><div class=”frame” id=”frame-2552534077616″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py”</cite>, line <em class=”line”>496</em>, in <code class=”function”>_make_request</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>raise new_e</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span># conn.request() calls http.client.*.request, not the method in</pre> <pre class=”line before”><span class=”ws”> </span># urllib3.request. It also calls makefile (recv) on the socket.</pre> <pre class=”line before”><span class=”ws”> </span>try:</pre> <pre class=”line current”><span class=”ws”> </span>conn.request(</pre> <pre class=”line after”><span class=”ws”> </span>method,</pre> <pre class=”line after”><span class=”ws”> </span>url,</pre> <pre class=”line after”><span class=”ws”> </span>body=body,</pre> <pre class=”line after”><span class=”ws”> </span>headers=headers,</pre> <pre class=”line after”><span class=”ws”> </span>chunked=chunked,</pre></div> </div> <li><div class=”frame” id=”frame-2552534077728″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py”</cite>, line <em class=”line”>395</em>, in <code class=”function”>request</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span># Now that framing headers are out of the way we send all the other headers.</pre> <pre class=”line before”><span class=”ws”> </span>if "user-agent" not in header_keys:</pre> <pre class=”line before”><span class=”ws”> </span>self.putheader("User-Agent", _get_default_user_agent())</pre> <pre class=”line before”><span class=”ws”> </span>for header, value in headers.items():</pre> <pre class=”line before”><span class=”ws”> </span>self.putheader(header, value)</pre> <pre class=”line current”><span class=”ws”> </span>self.endheaders()</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span># If we're given a body we start sending that in chunks.</pre> <pre class=”line after”><span class=”ws”> </span>if chunks is not None:</pre> <pre class=”line after”><span class=”ws”> </span>for chunk in chunks:</pre> <pre class=”line after”><span class=”ws”> </span># Sending empty chunks isn't allowed for TE: chunked</pre></div> </div> <li><div class=”frame” id=”frame-2552534077840″> <h4>File <cite class=”filename”>”C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py”</cite>, line <em class=”line”>1280</em>, in <code class=”function”>endheaders</code></h4> <div class=”source “><pre class=”line before”><span class=”ws”> </span>"""</pre> <pre class=”line before”><span class=”ws”> </span>if self.__state == _CS_REQ_STARTED:</pre> <pre class=”line before”><span class=”ws”> </span>self.__state = _CS_REQ_SENT</pre> <pre class=”line before”><span class=”ws”> </span>else:</pre> <pre class=”line before”><span class=”ws”> </span>raise CannotSendHeader()</pre> <pre class=”line current”><span class=”ws”> </span>self._send_output(message_body, encode_chunked=encode_chunked)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>def request(self, method, url, body=None, headers={}, *,</pre> <pre class=”line after”><span class=”ws”> </span>encode_chunked=False):</pre> <pre class=”line after”><span class=”ws”> </span>"""Send a complete request to the server."""</pre> <pre class=”line after”><span class=”ws”> </span>self._send_request(method, url, body, headers, encode_chunked)</pre></div> </div> <li><div class=”frame” id=”frame-2552534078064″> <h4>File <cite class=”filename”>”C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py”</cite>, line <em class=”line”>1040</em>, in <code class=”function”>_send_output</code></h4> <div class=”source “><pre class=”line before”><span class=”ws”> </span>A message_body may be specified, to be appended to the request.</pre> <pre class=”line before”><span class=”ws”> </span>"""</pre> <pre class=”line before”><span class=”ws”> </span>self._buffer.extend((b"", b""))</pre> <pre class=”line before”><span class=”ws”> </span>msg = b"\r\n".join(self._buffer)</pre> <pre class=”line before”><span class=”ws”> </span>del self._buffer[:]</pre> <pre class=”line current”><span class=”ws”> </span>self.send(msg)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>if message_body is not None:</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span># create a consistent interface to message_body</pre> <pre class=”line after”><span class=”ws”> </span>if hasattr(message_body, 'read'):</pre></div> </div> <li><div class=”frame” id=”frame-2552534078176″> <h4>File <cite class=”filename”>”C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py”</cite>, line <em class=”line”>980</em>, in <code class=”function”>send</code></h4> <div class=”source “><pre class=”line before”><span class=”ws”> </span>file-like object that supports a .read() method, or an iterable object.</pre> <pre class=”line before”><span class=”ws”> </span>"""</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>if self.sock is None:</pre> <pre class=”line before”><span class=”ws”> </span>if self.auto_open:</pre> <pre class=”line current”><span class=”ws”> </span>self.connect()</pre> <pre class=”line after”><span class=”ws”> </span>else:</pre> <pre class=”line after”><span class=”ws”> </span>raise NotConnected()</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>if self.debuglevel > 0:</pre> <pre class=”line after”><span class=”ws”> </span>print("send:", repr(data))</pre></div> </div> <li><div class=”frame” id=”frame-2552534078288″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py”</cite>, line <em class=”line”>243</em>, in <code class=”function”>connect</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>)</pre> <pre class=”line before”><span class=”ws”> </span>super().set_tunnel(host, port=port, headers=headers)</pre> <pre class=”line before”><span class=”ws”> </span>self._tunnel_scheme = scheme</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>def connect(self) -> None:</pre> <pre class=”line current”><span class=”ws”> </span>self.sock = self._new_conn()</pre> <pre class=”line after”><span class=”ws”> </span>if self._tunnel_host:</pre> <pre class=”line after”><span class=”ws”> </span># If we're tunneling it means we're connected to our proxy.</pre> <pre class=”line after”><span class=”ws”> </span>self._has_connected_to_proxy = True</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span># TODO: Fix tunnel so it doesn't depend on self.sock state.</pre></div> </div> <li><div class=”frame” id=”frame-2552534078400″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py”</cite>, line <em class=”line”>218</em>, in <code class=”function”>_new_conn</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>self,</pre> <pre class=”line before”><span class=”ws”> </span>f"Connection to {self.host} timed out. (connect timeout={self.timeout})",</pre> <pre class=”line before”><span class=”ws”> </span>) from e</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>except OSError as e:</pre> <pre class=”line current”><span class=”ws”> </span>raise NewConnectionError(</pre> <pre class=”line after”><span class=”ws”> </span>self, f"Failed to establish a new connection: {e}"</pre> <pre class=”line after”><span class=”ws”> </span>) from e</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span># Audit hooks are only available in Python 3.8+</pre> <pre class=”line after”><span class=”ws”> </span>if _HAS_SYS_AUDIT:</pre></div> </div> <li><div class=”exc-divider”>The above exception was the direct cause of the following exception:</div> <li><div class=”frame” id=”frame-2552534023744″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\requests\adapters.py”</cite>, line <em class=”line”>486</em>, in <code class=”function”>send</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>pass</pre> <pre class=”line before”><span class=”ws”> </span>else:</pre> <pre class=”line before”><span class=”ws”> </span>timeout = TimeoutSauce(connect=timeout, read=timeout)</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>try:</pre> <pre class=”line current”><span class=”ws”> </span>resp = conn.urlopen(</pre> <pre class=”line after”><span class=”ws”> </span>method=request.method,</pre> <pre class=”line after”><span class=”ws”> </span>url=url,</pre> <pre class=”line after”><span class=”ws”> </span>body=request.body,</pre> <pre class=”line after”><span class=”ws”> </span>headers=request.headers,</pre> <pre class=”line after”><span class=”ws”> </span>redirect=False,</pre></div> </div> <li><div class=”frame” id=”frame-2552534023856″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py”</cite>, line <em class=”line”>844</em>, in <code class=”function”>urlopen</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>) and (conn and conn.proxy and not conn.has_connected_to_proxy):</pre> <pre class=”line before”><span class=”ws”> </span>new_e = _wrap_proxy_error(new_e, conn.proxy.scheme)</pre> <pre class=”line before”><span class=”ws”> </span>elif isinstance(new_e, (OSError, HTTPException)):</pre> <pre class=”line before”><span class=”ws”> </span>new_e = ProtocolError("Connection aborted.", new_e)</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line current”><span class=”ws”> </span>retries = retries.increment(</pre> <pre class=”line after”><span class=”ws”> </span>method, url, error=new_e, _pool=self, _stacktrace=sys.exc_info()[2]</pre> <pre class=”line after”><span class=”ws”> </span>)</pre> <pre class=”line after”><span class=”ws”> </span>retries.sleep()</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span># Keep track of the error for the retry warning.</pre></div> </div> <li><div class=”frame” id=”frame-2552534023968″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\urllib3\util\retry.py”</cite>, line <em class=”line”>515</em>, in <code class=”function”>increment</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>history=history,</pre> <pre class=”line before”><span class=”ws”> </span>)</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>if new_retry.is_exhausted():</pre> <pre class=”line before”><span class=”ws”> </span>reason = error or ResponseError(cause)</pre> <pre class=”line current”><span class=”ws”> </span>raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>log.debug("Incremented Retry for (url='%s'): %r", url, new_retry)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>return new_retry</pre> <pre class=”line after”><span class=”ws”></span> </pre></div> </div> <li><div class=”exc-divider”>During handling of the above exception, another exception occurred:</div> <li><div class=”frame” id=”frame-2552534020944″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\flask\app.py”</cite>, line <em class=”line”>1478</em>, in <code class=”function”>__call__</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>def __call__(self, environ: dict, start_response: t.Callable) -> t.Any:</pre> <pre class=”line before”><span class=”ws”> </span>"""The WSGI server calls the Flask application object as the</pre> <pre class=”line before”><span class=”ws”> </span>WSGI application. This calls :meth:`wsgi_app`, which can be</pre> <pre class=”line before”><span class=”ws”> </span>wrapped to apply middleware.</pre> <pre class=”line before”><span class=”ws”> </span>"""</pre> <pre class=”line current”><span class=”ws”> </span>return self.wsgi_app(environ, start_response)</pre></div> </div> <li><div class=”frame” id=”frame-2552534021504″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\flask\app.py”</cite>, line <em class=”line”>1458</em>, in <code class=”function”>wsgi_app</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>try:</pre> <pre class=”line before”><span class=”ws”> </span>ctx.push()</pre> <pre class=”line before”><span class=”ws”> </span>response = self.full_dispatch_request()</pre> <pre class=”line before”><span class=”ws”> </span>except Exception as e:</pre> <pre class=”line before”><span class=”ws”> </span>error = e</pre> <pre class=”line current”><span class=”ws”> </span>response = self.handle_exception(e)</pre> <pre class=”line after”><span class=”ws”> </span>except: # noqa: B001</pre> <pre class=”line after”><span class=”ws”> </span>error = sys.exc_info()[1]</pre> <pre class=”line after”><span class=”ws”> </span>raise</pre> <pre class=”line after”><span class=”ws”> </span>return response(environ, start_response)</pre> <pre class=”line after”><span class=”ws”> </span>finally:</pre></div> </div> <li><div class=”frame” id=”frame-2552534021392″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\flask\app.py”</cite>, line <em class=”line”>1455</em>, in <code class=”function”>wsgi_app</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>ctx = self.request_context(environ)</pre> <pre class=”line before”><span class=”ws”> </span>error: BaseException | None = None</pre> <pre class=”line before”><span class=”ws”> </span>try:</pre> <pre class=”line before”><span class=”ws”> </span>try:</pre> <pre class=”line before”><span class=”ws”> </span>ctx.push()</pre> <pre class=”line current”><span class=”ws”> </span>response = self.full_dispatch_request()</pre> <pre class=”line after”><span class=”ws”> </span>except Exception as e:</pre> <pre class=”line after”><span class=”ws”> </span>error = e</pre> <pre class=”line after”><span class=”ws”> </span>response = self.handle_exception(e)</pre> <pre class=”line after”><span class=”ws”> </span>except: # noqa: B001</pre> <pre class=”line after”><span class=”ws”> </span>error = sys.exc_info()[1]</pre></div> </div> <li><div class=”frame” id=”frame-2552534021728″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\flask\app.py”</cite>, line <em class=”line”>869</em>, in <code class=”function”>full_dispatch_request</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>request_started.send(self, _async_wrapper=self.ensure_sync)</pre> <pre class=”line before”><span class=”ws”> </span>rv = self.preprocess_request()</pre> <pre class=”line before”><span class=”ws”> </span>if rv is None:</pre> <pre class=”line before”><span class=”ws”> </span>rv = self.dispatch_request()</pre> <pre class=”line before”><span class=”ws”> </span>except Exception as e:</pre> <pre class=”line current”><span class=”ws”> </span>rv = self.handle_user_exception(e)</pre> <pre class=”line after”><span class=”ws”> </span>return self.finalize_request(rv)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>def finalize_request(</pre> <pre class=”line after”><span class=”ws”> </span>self,</pre> <pre class=”line after”><span class=”ws”> </span>rv: ft.ResponseReturnValue | HTTPException,</pre></div> </div> <li><div class=”frame” id=”frame-2552534021840″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\flask\app.py”</cite>, line <em class=”line”>867</em>, in <code class=”function”>full_dispatch_request</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>try:</pre> <pre class=”line before”><span class=”ws”> </span>request_started.send(self, _async_wrapper=self.ensure_sync)</pre> <pre class=”line before”><span class=”ws”> </span>rv = self.preprocess_request()</pre> <pre class=”line before”><span class=”ws”> </span>if rv is None:</pre> <pre class=”line current”><span class=”ws”> </span>rv = self.dispatch_request()</pre> <pre class=”line after”><span class=”ws”> </span>except Exception as e:</pre> <pre class=”line after”><span class=”ws”> </span>rv = self.handle_user_exception(e)</pre> <pre class=”line after”><span class=”ws”> </span>return self.finalize_request(rv)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>def finalize_request(</pre></div> </div> <li><div class=”frame” id=”frame-2552534021952″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\flask\app.py”</cite>, line <em class=”line”>852</em>, in <code class=”function”>dispatch_request</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>and req.method == "OPTIONS"</pre> <pre class=”line before”><span class=”ws”> </span>):</pre> <pre class=”line before”><span class=”ws”> </span>return self.make_default_options_response()</pre> <pre class=”line before”><span class=”ws”> </span># otherwise dispatch to the handler for that endpoint</pre> <pre class=”line before”><span class=”ws”> </span>view_args: dict[str, t.Any] = req.view_args # type: ignore[assignment]</pre> <pre class=”line current”><span class=”ws”> </span>return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>def full_dispatch_request(self) -> Response:</pre> <pre class=”line after”><span class=”ws”> </span>"""Dispatches the request and on top of that performs request</pre> <pre class=”line after”><span class=”ws”> </span>pre and postprocessing as well as HTTP exception catching and</pre> <pre class=”line after”><span class=”ws”> </span>error handling.</pre></div> </div> <li><div class=”frame” id=”frame-2552534022064″> <h4>File <cite class=”filename”>”F:\project\wxgzh\model_server.py”</cite>, line <em class=”line”>322</em>, in <code class=”function”>get_new_content_api</code></h4> <div class=”source “><pre class=”line before”><span class=”ws”></span>def get_new_content_api():</pre> <pre class=”line before”><span class=”ws”> </span>content = request.args.get('content')</pre> <pre class=”line before”><span class=”ws”> </span>engine_type = request.args.get('engine_type')</pre> <pre class=”line before”><span class=”ws”> </span>need_summary = request.args.get('need_summary')</pre> <pre class=”line before”><span class=”ws”> </span>need_keywords = request.args.get('need_keywords')</pre> <pre class=”line current”><span class=”ws”> </span>new_content = get_new_content(engine_type,need_summary,need_keywords,content) # 传递 len 参数,使用 30 作为长度</pre> <pre class=”line after”><span class=”ws”> </span>return new_content</pre> <pre class=”line after”><span class=”ws”></span>@retry(exceptions=ConnectionError,tries=tries,delay=1)</pre> <pre class=”line after”><span class=”ws”></span>def get_new_content(engine_type,need_summary,need_keywords,init_content):</pre> <pre class=”line after”><span class=”ws”> </span>if engine_type == RewriteEnum.EngineType.WENXINYIYAN:</pre> <pre class=”line after”><span class=”ws”> </span>new_content = get_wp_post_wx_continue(need_summary,need_keywords ,init_content)</pre></div> </div> <li><div class=”frame” id=”frame-2552534022176″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\decorator.py”</cite>, line <em class=”line”>232</em>, in <code class=”function”>fun</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>yield res</pre> <pre class=”line before”><span class=”ws”> </span>else:</pre> <pre class=”line before”><span class=”ws”> </span>def fun(*args, **kw):</pre> <pre class=”line before”><span class=”ws”> </span>if not kwsyntax:</pre> <pre class=”line before”><span class=”ws”> </span>args, kw = fix(args, kw, sig)</pre> <pre class=”line current”><span class=”ws”> </span>return caller(func, *(extras + args), **kw)</pre> <pre class=”line after”><span class=”ws”> </span>fun.__name__ = func.__name__</pre> <pre class=”line after”><span class=”ws”> </span>fun.__doc__ = func.__doc__</pre> <pre class=”line after”><span class=”ws”> </span>fun.__wrapped__ = func</pre> <pre class=”line after”><span class=”ws”> </span>fun.__signature__ = sig</pre> <pre class=”line after”><span class=”ws”> </span>fun.__qualname__ = func.__qualname__</pre></div> </div> <li><div class=”frame” id=”frame-2552534022288″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\retry\api.py”</cite>, line <em class=”line”>73</em>, in <code class=”function”>retry_decorator</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>@decorator</pre> <pre class=”line before”><span class=”ws”> </span>def retry_decorator(f, *fargs, **fkwargs):</pre> <pre class=”line before”><span class=”ws”> </span>args = fargs if fargs else list()</pre> <pre class=”line before”><span class=”ws”> </span>kwargs = fkwargs if fkwargs else dict()</pre> <pre class=”line current”><span class=”ws”> </span>return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter,</pre> <pre class=”line after”><span class=”ws”> </span>logger)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>return retry_decorator</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”></span> </pre></div> </div> <li><div class=”frame” id=”frame-2552534022400″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\retry\api.py”</cite>, line <em class=”line”>33</em>, in <code class=”function”>__retry_internal</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>:returns: the result of the f function.</pre> <pre class=”line before”><span class=”ws”> </span>"""</pre> <pre class=”line before”><span class=”ws”> </span>_tries, _delay = tries, delay</pre> <pre class=”line before”><span class=”ws”> </span>while _tries:</pre> <pre class=”line before”><span class=”ws”> </span>try:</pre> <pre class=”line current”><span class=”ws”> </span>return f()</pre> <pre class=”line after”><span class=”ws”> </span>except exceptions as e:</pre> <pre class=”line after”><span class=”ws”> </span>_tries -= 1</pre> <pre class=”line after”><span class=”ws”> </span>if not _tries:</pre> <pre class=”line after”><span class=”ws”> </span>raise</pre> <pre class=”line after”><span class=”ws”></span> </pre></div> </div> <li><div class=”frame” id=”frame-2552534022512″> <h4>File <cite class=”filename”>”F:\project\wxgzh\model_server.py”</cite>, line <em class=”line”>329</em>, in <code class=”function”>get_new_content</code></h4> <div class=”source “><pre class=”line before”><span class=”ws”></span>@retry(exceptions=ConnectionError,tries=tries,delay=1)</pre> <pre class=”line before”><span class=”ws”></span>def get_new_content(engine_type,need_summary,need_keywords,init_content):</pre> <pre class=”line before”><span class=”ws”> </span>if engine_type == RewriteEnum.EngineType.WENXINYIYAN:</pre> <pre class=”line before”><span class=”ws”> </span>new_content = get_wp_post_wx_continue(need_summary,need_keywords ,init_content)</pre> <pre class=”line before”><span class=”ws”> </span>else:</pre> <pre class=”line current”><span class=”ws”> </span>new_content = get_new_content_chatglm(init_content)</pre> <pre class=”line after”><span class=”ws”> </span>return new_content</pre> <pre class=”line after”><span class=”ws”></span>@retry(exceptions=ConnectionError,tries=tries,delay=1)</pre> <pre class=”line after”><span class=”ws”></span>def get_new_content_chatglm(content):</pre> <pre class=”line after”><span class=”ws”> </span>payload = {</pre> <pre class=”line after”><span class=”ws”> </span>"model": "chatglm3-6b",</pre></div> </div> <li><div class=”frame” id=”frame-2552534022736″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\decorator.py”</cite>, line <em class=”line”>232</em>, in <code class=”function”>fun</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>yield res</pre> <pre class=”line before”><span class=”ws”> </span>else:</pre> <pre class=”line before”><span class=”ws”> </span>def fun(*args, **kw):</pre> <pre class=”line before”><span class=”ws”> </span>if not kwsyntax:</pre> <pre class=”line before”><span class=”ws”> </span>args, kw = fix(args, kw, sig)</pre> <pre class=”line current”><span class=”ws”> </span>return caller(func, *(extras + args), **kw)</pre> <pre class=”line after”><span class=”ws”> </span>fun.__name__ = func.__name__</pre> <pre class=”line after”><span class=”ws”> </span>fun.__doc__ = func.__doc__</pre> <pre class=”line after”><span class=”ws”> </span>fun.__wrapped__ = func</pre> <pre class=”line after”><span class=”ws”> </span>fun.__signature__ = sig</pre> <pre class=”line after”><span class=”ws”> </span>fun.__qualname__ = func.__qualname__</pre></div> </div> <li><div class=”frame” id=”frame-2552534022848″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\retry\api.py”</cite>, line <em class=”line”>73</em>, in <code class=”function”>retry_decorator</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>@decorator</pre> <pre class=”line before”><span class=”ws”> </span>def retry_decorator(f, *fargs, **fkwargs):</pre> <pre class=”line before”><span class=”ws”> </span>args = fargs if fargs else list()</pre> <pre class=”line before”><span class=”ws”> </span>kwargs = fkwargs if fkwargs else dict()</pre> <pre class=”line current”><span class=”ws”> </span>return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter,</pre> <pre class=”line after”><span class=”ws”> </span>logger)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>return retry_decorator</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”></span> </pre></div> </div> <li><div class=”frame” id=”frame-2552534022960″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\retry\api.py”</cite>, line <em class=”line”>33</em>, in <code class=”function”>__retry_internal</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>:returns: the result of the f function.</pre> <pre class=”line before”><span class=”ws”> </span>"""</pre> <pre class=”line before”><span class=”ws”> </span>_tries, _delay = tries, delay</pre> <pre class=”line before”><span class=”ws”> </span>while _tries:</pre> <pre class=”line before”><span class=”ws”> </span>try:</pre> <pre class=”line current”><span class=”ws”> </span>return f()</pre> <pre class=”line after”><span class=”ws”> </span>except exceptions as e:</pre> <pre class=”line after”><span class=”ws”> </span>_tries -= 1</pre> <pre class=”line after”><span class=”ws”> </span>if not _tries:</pre> <pre class=”line after”><span class=”ws”> </span>raise</pre> <pre class=”line after”><span class=”ws”></span> </pre></div> </div> <li><div class=”frame” id=”frame-2552534023072″> <h4>File <cite class=”filename”>”F:\project\wxgzh\model_server.py”</cite>, line <em class=”line”>355</em>, in <code class=”function”>get_new_content_chatglm</code></h4> <div class=”source “><pre class=”line before”><span class=”ws”> </span>"functions": {},</pre> <pre class=”line before”><span class=”ws”> </span>"repetition_penalty": 1.1</pre> <pre class=”line before”><span class=”ws”> </span>}</pre> <pre class=”line before”><span class=”ws”> </span>headers = {"content-type": "application/json"}</pre> <pre class=”line before”><span class=”ws”> </span>task_start_time = time.time()</pre> <pre class=”line current”><span class=”ws”> </span>response = requests.request("POST", chatglm_url, json=payload, headers=headers)</pre> <pre class=”line after”><span class=”ws”> </span>#print(response)</pre> <pre class=”line after”><span class=”ws”> </span>data = response.json()</pre> <pre class=”line after”><span class=”ws”> </span>print(json.dumps(data, indent=4))</pre> <pre class=”line after”><span class=”ws”> </span>new_content = data['choices'][0]['message']['content']</pre> <pre class=”line after”><span class=”ws”> </span>new_content = new_content.replace("重新改写后:", "").replace("", "")</pre></div> </div> <li><div class=”frame” id=”frame-2552534023184″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\requests\api.py”</cite>, line <em class=”line”>59</em>, in <code class=”function”>request</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span># By using the 'with' statement we are sure the session is closed, thus we</pre> <pre class=”line before”><span class=”ws”> </span># avoid leaving sockets open which can trigger a ResourceWarning in some</pre> <pre class=”line before”><span class=”ws”> </span># cases, and look like a memory leak in others.</pre> <pre class=”line before”><span class=”ws”> </span>with sessions.Session() as session:</pre> <pre class=”line current”><span class=”ws”> </span>return session.request(method=method, url=url, **kwargs)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”></span>def get(url, params=None, **kwargs):</pre> <pre class=”line after”><span class=”ws”> </span>r"""Sends a GET request.</pre> <pre class=”line after”><span class=”ws”></span> </pre></div> </div> <li><div class=”frame” id=”frame-2552534023408″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\requests\sessions.py”</cite>, line <em class=”line”>589</em>, in <code class=”function”>request</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>send_kwargs = {</pre> <pre class=”line before”><span class=”ws”> </span>"timeout": timeout,</pre> <pre class=”line before”><span class=”ws”> </span>"allow_redirects": allow_redirects,</pre> <pre class=”line before”><span class=”ws”> </span>}</pre> <pre class=”line before”><span class=”ws”> </span>send_kwargs.update(settings)</pre> <pre class=”line current”><span class=”ws”> </span>resp = self.send(prep, **send_kwargs)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>return resp</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>def get(self, url, **kwargs):</pre> <pre class=”line after”><span class=”ws”> </span>r"""Sends a GET request. Returns :class:`Response` object.</pre></div> </div> <li><div class=”frame” id=”frame-2552534023520″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\requests\sessions.py”</cite>, line <em class=”line”>703</em>, in <code class=”function”>send</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span># Start time (approximately) of the request</pre> <pre class=”line before”><span class=”ws”> </span>start = preferred_clock()</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span># Send the request</pre> <pre class=”line current”><span class=”ws”> </span>r = adapter.send(request, **kwargs)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span># Total elapsed time of the request (approximately)</pre> <pre class=”line after”><span class=”ws”> </span>elapsed = preferred_clock() – start</pre> <pre class=”line after”><span class=”ws”> </span>r.elapsed = timedelta(seconds=elapsed)</pre> <pre class=”line after”><span class=”ws”></span> </pre></div> </div> <li><div class=”frame” id=”frame-2552534023632″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\requests\adapters.py”</cite>, line <em class=”line”>519</em>, in <code class=”function”>send</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>if isinstance(e.reason, _SSLError):</pre> <pre class=”line before”><span class=”ws”> </span># This branch is for urllib3 v1.22 and later.</pre> <pre class=”line before”><span class=”ws”> </span>raise SSLError(e, request=request)</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line current”><span class=”ws”> </span>raise ConnectionError(e, request=request)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>except ClosedPoolError as e:</pre> <pre class=”line after”><span class=”ws”> </span>raise ConnectionError(e, request=request)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>except _ProxyError as e:</pre></div> </div> </ul> <blockquote>requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=7861): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000002524EE2B370>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。')) </blockquote> </div> <div class=”plain”> <p> This is the Copy/Paste friendly version of the traceback. </p> <textarea cols=”50″ rows=”10″ name=”code” readonly>Traceback (most recent call last): File "F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py", line 203, in _new_conn sock = connection.create_connection( File "F:\project\wxgzh\venv\lib\site-packages\urllib3\util\connection.py", line 85, in create_connection raise err File "F:\project\wxgzh\venv\lib\site-packages\urllib3\util\connection.py", line 73, in create_connection sock.connect(sa) ConnectionRefusedError: [WinError 10061] 由于目标计算机积极拒绝,无法连接。 The above exception was the direct cause of the following exception: Traceback (most recent call last): File "F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py", line 790, in urlopen response = self._make_request( File "F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py", line 496, in _make_request conn.request( File "F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py", line 395, in request self.endheaders() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py", line 1280, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py", line 1040, in _send_output self.send(msg) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py", line 980, in send self.connect() File "F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py", line 243, in connect self.sock = self._new_conn() File "F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py", line 218, in _new_conn raise NewConnectionError( urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x000002524EE2B370>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。 The above exception was the direct cause of the following exception: Traceback (most recent call last): File "F:\project\wxgzh\venv\lib\site-packages\requests\adapters.py", line 486, in send resp = conn.urlopen( File "F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py", line 844, in urlopen retries = retries.increment( File "F:\project\wxgzh\venv\lib\site-packages\urllib3\util\retry.py", line 515, in increment raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='127.0.0.1', port=7861): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000002524EE2B370>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。')) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "F:\project\wxgzh\venv\lib\site-packages\flask\app.py", line 1478, in __call__ return self.wsgi_app(environ, start_response) File "F:\project\wxgzh\venv\lib\site-packages\flask\app.py", line 1458, in wsgi_app response = self.handle_exception(e) File "F:\project\wxgzh\venv\lib\site-packages\flask\app.py", line 1455, in wsgi_app response = self.full_dispatch_request() File "F:\project\wxgzh\venv\lib\site-packages\flask\app.py", line 869, in full_dispatch_request rv = self.handle_user_exception(e) File "F:\project\wxgzh\venv\lib\site-packages\flask\app.py", line 867, in full_dispatch_request rv = self.dispatch_request() File "F:\project\wxgzh\venv\lib\site-packages\flask\app.py", line 852, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) File "F:\project\wxgzh\model_server.py", line 322, in get_new_content_api new_content = get_new_content(engine_type,need_summary,need_keywords,content) # 传递 len 参数,使用 30 作为长度 File "F:\project\wxgzh\venv\lib\site-packages\decorator.py", line 232, in fun return caller(func, *(extras + args), **kw) File "F:\project\wxgzh\venv\lib\site-packages\retry\api.py", line 73, in retry_decorator return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter, File "F:\project\wxgzh\venv\lib\site-packages\retry\api.py", line 33, in __retry_internal return f() File "F:\project\wxgzh\model_server.py", line 329, in get_new_content new_content = get_new_content_chatglm(init_content) File "F:\project\wxgzh\venv\lib\site-packages\decorator.py", line 232, in fun return caller(func, *(extras + args), **kw) File "F:\project\wxgzh\venv\lib\site-packages\retry\api.py", line 73, in retry_decorator return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter, File "F:\project\wxgzh\venv\lib\site-packages\retry\api.py", line 33, in __retry_internal return f() File "F:\project\wxgzh\model_server.py", line 355, in get_new_content_chatglm response = requests.request("POST", chatglm_url, json=payload, headers=headers) File "F:\project\wxgzh\venv\lib\site-packages\requests\api.py", line 59, in request return session.request(method=method, url=url, **kwargs) File "F:\project\wxgzh\venv\lib\site-packages\requests\sessions.py", line 589, in request resp = self.send(prep, **send_kwargs) File "F:\project\wxgzh\venv\lib\site-packages\requests\sessions.py", line 703, in send r = adapter.send(request, **kwargs) File "F:\project\wxgzh\venv\lib\site-packages\requests\adapters.py", line 519, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=7861): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000002524EE2B370>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。')) </textarea> </div> <div class=”explanation”> The debugger caught an exception in your WSGI application. You can now look at the traceback which led to the error. <span class=”nojavascript”> If you enable JavaScript you can also use additional features such as code execution (if the evalex feature is enabled), automatic pasting of the exceptions and much more.</span> </div> <div class=”footer”> Brought to you by <strong class=”arthur”>DON’T PANIC</strong>, your friendly Werkzeug powered traceback interpreter. </div> </div> <div class=”pin-prompt”> <div class=”inner”> <h3>Console Locked</h3> <p> The console is locked and needs to be unlocked by entering the PIN. You can find the PIN printed out on the standard output of your shell that runs the server. <form> <p>PIN: <input type=text name=pin size=14> <input type=submit name=btn value=”Confirm Pin”> </form> </div> </div> </body> </html> <!– Traceback (most recent call last): File “F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py”, line 203, in _new_conn sock = connection.create_connection( File “F:\project\wxgzh\venv\lib\site-packages\urllib3\util\connection.py”, line 85, in create_connection raise err File “F:\project\wxgzh\venv\lib\site-packages\urllib3\util\connection.py”, line 73, in create_connection sock.connect(sa) ConnectionRefusedError: [WinError 10061] 由于目标计算机积极拒绝,无法连接。 The above exception was the direct cause of the following exception: Traceback (most recent call last): File “F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py”, line 790, in urlopen response = self._make_request( File “F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py”, line 496, in _make_request conn.request( File “F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py”, line 395, in request self.endheaders() File “C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py”, line 1280, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File “C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py”, line 1040, in _send_output self.send(msg) File “C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py”, line 980, in send self.connect() File “F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py”, line 243, in connect self.sock = self._new_conn() File “F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py”, line 218, in _new_conn raise NewConnectionError( urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x000002524EE2B370>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。 The above exception was the direct cause of the following exception: Traceback (most recent call last): File “F:\project\wxgzh\venv\lib\site-packages\requests\adapters.py”, line 486, in send resp = conn.urlopen( File “F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py”, line 844, in urlopen retries = retries.increment( File “F:\project\wxgzh\venv\lib\site-packages\urllib3\util\retry.py”, line 515, in increment raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host=’127.0.0.1′, port=7861): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError(‘<urllib3.connection.HTTPConnection object at 0x000002524EE2B370>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。’)) During handling of the above exception, another exception occurred: Traceback (most recent call last): File “F:\project\wxgzh\venv\lib\site-packages\flask\app.py”, line 1478, in __call__ return self.wsgi_app(environ, start_response) File “F:\project\wxgzh\venv\lib\site-packages\flask\app.py”, line 1458, in wsgi_app response = self.handle_exception(e) File “F:\project\wxgzh\venv\lib\site-packages\flask\app.py”, line 1455, in wsgi_app response = self.full_dispatch_request() File “F:\project\wxgzh\venv\lib\site-packages\flask\app.py”, line 869, in full_dispatch_request rv = self.handle_user_exception(e) File “F:\project\wxgzh\venv\lib\site-packages\flask\app.py”, line 867, in full_dispatch_request rv = self.dispatch_request() File “F:\project\wxgzh\venv\lib\site-packages\flask\app.py”, line 852, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) File “F:\project\wxgzh\model_server.py”, line 322, in get_new_content_api new_content = get_new_content(engine_type,need_summary,need_keywords,content) # 传递 len 参数,使用 30 作为长度 File “F:\project\wxgzh\venv\lib\site-packages\decorator.py”, line 232, in fun return caller(func, *(extras + args), **kw) File “F:\project\wxgzh\venv\lib\site-packages\retry\api.py”, line 73, in retry_decorator return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter, File “F:\project\wxgzh\venv\lib\site-packages\retry\api.py”, line 33, in __retry_internal return f() File “F:\project\wxgzh\model_server.py”, line 329, in get_new_content new_content = get_new_content_chatglm(init_content) File “F:\project\wxgzh\venv\lib\site-packages\decorator.py”, line 232, in fun return caller(func, *(extras + args), **kw) File “F:\project\wxgzh\venv\lib\site-packages\retry\api.py”, line 73, in retry_decorator return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter, File “F:\project\wxgzh\venv\lib\site-packages\retry\api.py”, line 33, in __retry_internal return f() File “F:\project\wxgzh\model_server.py”, line 355, in get_new_content_chatglm response = requests.request(“POST”, chatglm_url, json=payload, headers=headers) File “F:\project\wxgzh\venv\lib\site-packages\requests\api.py”, line 59, in request return session.request(method=method, url=url, **kwargs) File “F:\project\wxgzh\venv\lib\site-packages\requests\sessions.py”, line 589, in request resp = self.send(prep, **send_kwargs) File “F:\project\wxgzh\venv\lib\site-packages\requests\sessions.py”, line 703, in send r = adapter.send(request, **kwargs) File “F:\project\wxgzh\venv\lib\site-packages\requests\adapters.py”, line 519, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPConnectionPool(host=’127.0.0.1′, port=7861): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError(‘<urllib3.connection.HTTPConnection object at 0x000002524EE2B370>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。’)) –>
当前这项技术仍处于初级阶段,故而其未来完全替代搜索引擎的可能性极大。然而,要预测这一过程所需的时间却并不容易,因为这取决于多种因素,包括但不限于技术的进步速度、市场需求以及相关行业的发展状况等。
Bing Chat与ChatGPT相同吗?
微软公司决定将人工智能助手ChatGPT融入到Bing搜索引擎中,并以Bing Chat的形式呈现出来。然而,与此前的ChatGPT不同,Bing Chat需要用户下载最新版的Edge浏览器才能使用。这样一来,那些使用Safari或Chrome浏览器的用户就无法体验到Bing Chat的便利性了。
在Bing Chat的初始阶段,可能会出现一些错误的反应,然而微软公司迅速采取了相应的措施进行了调整。如今,Bing Chat所采用的是GPT-4语言模型,这一版本相较于基础版的ChatGPT,无论是在准确性还是反应速度上,都有了显著的提升,而且完全免费。值得一提的是,全新的Edge Copilot模式也提供了一个更加友好且便利的使用方式——借助Windows Copilot,用户可以直接在桌面上看到Bing Chat。
Google Bard与ChatGPT区别
与Bing Chat不同,Google Bard使用完全不同的LLM来增强其自然语言功能。发布后,Bard一直在使用LaMDA,该公司使用的是自己的训练模型,根据个人有限的使用情况来看,它整体还是逊于ChatGPT,不过Bard的相对优势是基于Google搜索,可以访问和处理来自当前现实世界的信息。返回搜狐,查看更多
责任编辑:
AI时代,拥有个人微信机器人AI助手!AI时代不落人后!
免费ChatGPT问答,办公、写作、生活好得力助手!
搜索微信号aigc666aigc999或上边扫码,即可拥有个人AI助手!