文章主题:- 诺贝尔奖
– 预测
– AI
– ChatGPT
– 自然语言处理
– 机器学习
– 人工智能
– 诺贝尔奖得主
– 化学
– 物理
– 生理学
– 医学
– 预测未来
– 人工智能工具

666AI工具大全,助力做AI时代先行者!

本文来自微信公众号“新智元”(ID:AI_era),作者:新智元,36氪经授权发布。

2023诺贝尔奖即将在下周,也就是10月2日-9日(当地时间)揭晓。

我们每个人心中或许都会有个疑问:谁会摘得今年的诺奖桂冠?

来源:新智元

在此之前,不如用「地表最强」AI——ChatGPT预测下今年诺奖重大进展。

Nature最新文章称,微调后的大模型,包括ChatGPT在内,都能大大增强预测诺奖得主的能力。

来源:新智元

<!doctype html>
<html lang=en>
<head>
<title>requests.exceptions.ConnectionError: HTTPConnectionPool(host=&#39;127.0.0.1&#39;, port=7861): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError(&#39;&lt;urllib3.connection.HTTPConnection object at 0x00000252251C70D0&gt;: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。&#39;))
// Werkzeug Debugger</title>
<link rel=”stylesheet” href=”?__debugger__=yes&amp;cmd=resource&amp;f=style.css”>
<link rel=”shortcut icon”
href=”?__debugger__=yes&amp;cmd=resource&amp;f=console.png”>
<script src=”?__debugger__=yes&amp;cmd=resource&amp;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=&#39;127.0.0.1&#39;, port=7861): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError(&#39;&lt;urllib3.connection.HTTPConnection object at 0x00000252251C70D0&gt;: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。&#39;))
</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-2551833204768″>
<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>&#34;&#34;&#34;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>&#34;&#34;&#34;</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-2551833204880″>
<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(&#34;getaddrinfo returns an empty list&#34;)</pre></div>
</div>

<li><div class=”frame” id=”frame-2551833204992″>
<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-2551833203648″>
<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&#39;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-2551833203760″>
<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-2551833203872″>
<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 &#34;user-agent&#34; not in header_keys:</pre>
<pre class=”line before”><span class=”ws”> </span>self.putheader(&#34;User-Agent&#34;, _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&#39;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&#39;t allowed for TE: chunked</pre></div>
</div>

<li><div class=”frame” id=”frame-2551833203984″>
<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>&#34;&#34;&#34;</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>&#34;&#34;&#34;Send a complete request to the server.&#34;&#34;&#34;</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-2551833204208″>
<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>&#34;&#34;&#34;</pre>
<pre class=”line before”><span class=”ws”> </span>self._buffer.extend((b&#34;&#34;, b&#34;&#34;))</pre>
<pre class=”line before”><span class=”ws”> </span>msg = b&#34;\r\n&#34;.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, &#39;read&#39;):</pre></div>
</div>

<li><div class=”frame” id=”frame-2551833204320″>
<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>&#34;&#34;&#34;</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 &gt; 0:</pre>
<pre class=”line after”><span class=”ws”> </span>print(&#34;send:&#34;, repr(data))</pre></div>
</div>

<li><div class=”frame” id=”frame-2551833204432″>
<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) -&gt; 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&#39;re tunneling it means we&#39;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&#39;t depend on self.sock state.</pre></div>
</div>

<li><div class=”frame” id=”frame-2551833204544″>
<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&#34;Connection to {self.host} timed out. (connect timeout={self.timeout})&#34;,</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&#34;Failed to establish a new connection: {e}&#34;</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-2551833203200″>
<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-2551833203312″>
<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(&#34;Connection aborted.&#34;, 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-2551833203424″>
<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(&#34;Incremented Retry for (url=&#39;%s&#39;): %r&#34;, 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-2551833168240″>
<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) -&gt; t.Any:</pre>
<pre class=”line before”><span class=”ws”> </span>&#34;&#34;&#34;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>&#34;&#34;&#34;</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-2551833168128″>
<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-2551833168016″>
<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-2551833168352″>
<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-2551833168464″>
<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-2551833168576″>
<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 == &#34;OPTIONS&#34;</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) -&gt; Response:</pre>
<pre class=”line after”><span class=”ws”> </span>&#34;&#34;&#34;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-2551833168688″>
<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(&#39;content&#39;)</pre>
<pre class=”line before”><span class=”ws”> </span>engine_type = request.args.get(&#39;engine_type&#39;)</pre>
<pre class=”line before”><span class=”ws”> </span>need_summary = request.args.get(&#39;need_summary&#39;)</pre>
<pre class=”line before”><span class=”ws”> </span>need_keywords = request.args.get(&#39;need_keywords&#39;)</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-2551833168800″>
<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-2551833168912″>
<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-2551833169024″>
<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>&#34;&#34;&#34;</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-2551833169136″>
<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>&#34;model&#34;: &#34;chatglm3-6b&#34;,</pre></div>
</div>

<li><div class=”frame” id=”frame-2551833169360″>
<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-2551833169472″>
<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-2551833169584″>
<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>&#34;&#34;&#34;</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-2551833169696″>
<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>&#34;functions&#34;: {},</pre>
<pre class=”line before”><span class=”ws”> </span>&#34;repetition_penalty&#34;: 1.1</pre>
<pre class=”line before”><span class=”ws”> </span>}</pre>
<pre class=”line before”><span class=”ws”> </span>headers = {&#34;content-type&#34;: &#34;application/json&#34;}</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(&#34;POST&#34;, 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[&#39;choices&#39;][0][&#39;message&#39;][&#39;content&#39;]</pre>
<pre class=”line after”><span class=”ws”> </span>new_content = new_content.replace(&#34;重新改写后:&#34;, &#34;&#34;).replace(&#34;&#34;, &#34;&#34;)</pre></div>
</div>

<li><div class=”frame” id=”frame-2551833169808″>
<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 &#39;with&#39; 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&#34;&#34;&#34;Sends a GET request.</pre>
<pre class=”line after”><span class=”ws”></span> </pre></div>
</div>

<li><div class=”frame” id=”frame-2551833202864″>
<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>&#34;timeout&#34;: timeout,</pre>
<pre class=”line before”><span class=”ws”> </span>&#34;allow_redirects&#34;: 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&#34;&#34;&#34;Sends a GET request. Returns :class:`Response` object.</pre></div>
</div>

<li><div class=”frame” id=”frame-2551833202976″>
<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-2551833203088″>
<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=&#39;127.0.0.1&#39;, port=7861): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError(&#39;&lt;urllib3.connection.HTTPConnection object at 0x00000252251C70D0&gt;: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。&#39;))
</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 &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py&#34;, line 203, in _new_conn
sock = connection.create_connection(
File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\util\connection.py&#34;, line 85, in create_connection
raise err
File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\util\connection.py&#34;, 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 &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py&#34;, line 790, in urlopen
response = self._make_request(
File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py&#34;, line 496, in _make_request
conn.request(
File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py&#34;, line 395, in request
self.endheaders()
File &#34;C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py&#34;, line 1280, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File &#34;C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py&#34;, line 1040, in _send_output
self.send(msg)
File &#34;C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py&#34;, line 980, in send
self.connect()
File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py&#34;, line 243, in connect
self.sock = self._new_conn()
File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py&#34;, line 218, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: &lt;urllib3.connection.HTTPConnection object at 0x00000252251C70D0&gt;: 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 &#34;F:\project\wxgzh\venv\lib\site-packages\requests\adapters.py&#34;, line 486, in send
resp = conn.urlopen(
File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py&#34;, line 844, in urlopen
retries = retries.increment(
File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\util\retry.py&#34;, line 515, in increment
raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host=&#39;127.0.0.1&#39;, port=7861): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError(&#39;&lt;urllib3.connection.HTTPConnection object at 0x00000252251C70D0&gt;: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。&#39;))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File &#34;F:\project\wxgzh\venv\lib\site-packages\flask\app.py&#34;, line 1478, in __call__
return self.wsgi_app(environ, start_response)
File &#34;F:\project\wxgzh\venv\lib\site-packages\flask\app.py&#34;, line 1458, in wsgi_app
response = self.handle_exception(e)
File &#34;F:\project\wxgzh\venv\lib\site-packages\flask\app.py&#34;, line 1455, in wsgi_app
response = self.full_dispatch_request()
File &#34;F:\project\wxgzh\venv\lib\site-packages\flask\app.py&#34;, line 869, in full_dispatch_request
rv = self.handle_user_exception(e)
File &#34;F:\project\wxgzh\venv\lib\site-packages\flask\app.py&#34;, line 867, in full_dispatch_request
rv = self.dispatch_request()
File &#34;F:\project\wxgzh\venv\lib\site-packages\flask\app.py&#34;, line 852, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
File &#34;F:\project\wxgzh\model_server.py&#34;, line 322, in get_new_content_api
new_content = get_new_content(engine_type,need_summary,need_keywords,content) # 传递 len 参数,使用 30 作为长度
File &#34;F:\project\wxgzh\venv\lib\site-packages\decorator.py&#34;, line 232, in fun
return caller(func, *(extras + args), **kw)
File &#34;F:\project\wxgzh\venv\lib\site-packages\retry\api.py&#34;, line 73, in retry_decorator
return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter,
File &#34;F:\project\wxgzh\venv\lib\site-packages\retry\api.py&#34;, line 33, in __retry_internal
return f()
File &#34;F:\project\wxgzh\model_server.py&#34;, line 329, in get_new_content
new_content = get_new_content_chatglm(init_content)
File &#34;F:\project\wxgzh\venv\lib\site-packages\decorator.py&#34;, line 232, in fun
return caller(func, *(extras + args), **kw)
File &#34;F:\project\wxgzh\venv\lib\site-packages\retry\api.py&#34;, line 73, in retry_decorator
return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter,
File &#34;F:\project\wxgzh\venv\lib\site-packages\retry\api.py&#34;, line 33, in __retry_internal
return f()
File &#34;F:\project\wxgzh\model_server.py&#34;, line 355, in get_new_content_chatglm
response = requests.request(&#34;POST&#34;, chatglm_url, json=payload, headers=headers)
File &#34;F:\project\wxgzh\venv\lib\site-packages\requests\api.py&#34;, line 59, in request
return session.request(method=method, url=url, **kwargs)
File &#34;F:\project\wxgzh\venv\lib\site-packages\requests\sessions.py&#34;, line 589, in request
resp = self.send(prep, **send_kwargs)
File &#34;F:\project\wxgzh\venv\lib\site-packages\requests\sessions.py&#34;, line 703, in send
r = adapter.send(request, **kwargs)
File &#34;F:\project\wxgzh\venv\lib\site-packages\requests\adapters.py&#34;, line 519, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host=&#39;127.0.0.1&#39;, port=7861): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError(&#39;&lt;urllib3.connection.HTTPConnection object at 0x00000252251C70D0&gt;: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。&#39;))
</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 0x00000252251C70D0>: 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 0x00000252251C70D0>: 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 0x00000252251C70D0>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。’))

–>

那么,ChatGPT预测的诺奖到底准不准?

来源:新智元

ChatGPT预测诺奖得主

<!doctype html>
<html lang=en>
<head>
<title>requests.exceptions.ConnectionError: HTTPConnectionPool(host=&#39;127.0.0.1&#39;, port=7861): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError(&#39;&lt;urllib3.connection.HTTPConnection object at 0x00000252251D63D0&gt;: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。&#39;))
// Werkzeug Debugger</title>
<link rel=”stylesheet” href=”?__debugger__=yes&amp;cmd=resource&amp;f=style.css”>
<link rel=”shortcut icon”
href=”?__debugger__=yes&amp;cmd=resource&amp;f=console.png”>
<script src=”?__debugger__=yes&amp;cmd=resource&amp;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=&#39;127.0.0.1&#39;, port=7861): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError(&#39;&lt;urllib3.connection.HTTPConnection object at 0x00000252251D63D0&gt;: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。&#39;))
</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-2551833283040″>
<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>&#34;&#34;&#34;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>&#34;&#34;&#34;</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-2551833283152″>
<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(&#34;getaddrinfo returns an empty list&#34;)</pre></div>
</div>

<li><div class=”frame” id=”frame-2551833283264″>
<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-2551833281920″>
<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&#39;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-2551833282032″>
<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-2551833282144″>
<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 &#34;user-agent&#34; not in header_keys:</pre>
<pre class=”line before”><span class=”ws”> </span>self.putheader(&#34;User-Agent&#34;, _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&#39;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&#39;t allowed for TE: chunked</pre></div>
</div>

<li><div class=”frame” id=”frame-2551833282256″>
<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>&#34;&#34;&#34;</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>&#34;&#34;&#34;Send a complete request to the server.&#34;&#34;&#34;</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-2551833282480″>
<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>&#34;&#34;&#34;</pre>
<pre class=”line before”><span class=”ws”> </span>self._buffer.extend((b&#34;&#34;, b&#34;&#34;))</pre>
<pre class=”line before”><span class=”ws”> </span>msg = b&#34;\r\n&#34;.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, &#39;read&#39;):</pre></div>
</div>

<li><div class=”frame” id=”frame-2551833282592″>
<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>&#34;&#34;&#34;</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 &gt; 0:</pre>
<pre class=”line after”><span class=”ws”> </span>print(&#34;send:&#34;, repr(data))</pre></div>
</div>

<li><div class=”frame” id=”frame-2551833282704″>
<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) -&gt; 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&#39;re tunneling it means we&#39;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&#39;t depend on self.sock state.</pre></div>
</div>

<li><div class=”frame” id=”frame-2551833282816″>
<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&#34;Connection to {self.host} timed out. (connect timeout={self.timeout})&#34;,</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&#34;Failed to establish a new connection: {e}&#34;</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-2551833281472″>
<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-2551833281584″>
<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(&#34;Connection aborted.&#34;, 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-2551833281696″>
<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(&#34;Incremented Retry for (url=&#39;%s&#39;): %r&#34;, 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-2551833242416″>
<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) -&gt; t.Any:</pre>
<pre class=”line before”><span class=”ws”> </span>&#34;&#34;&#34;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>&#34;&#34;&#34;</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-2551833242304″>
<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-2551833240624″>
<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-2551833242528″>
<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-2551833242640″>
<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-2551833242752″>
<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 == &#34;OPTIONS&#34;</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) -&gt; Response:</pre>
<pre class=”line after”><span class=”ws”> </span>&#34;&#34;&#34;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-2551833242864″>
<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(&#39;content&#39;)</pre>
<pre class=”line before”><span class=”ws”> </span>engine_type = request.args.get(&#39;engine_type&#39;)</pre>
<pre class=”line before”><span class=”ws”> </span>need_summary = request.args.get(&#39;need_summary&#39;)</pre>
<pre class=”line before”><span class=”ws”> </span>need_keywords = request.args.get(&#39;need_keywords&#39;)</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-2551833242976″>
<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-2551833243088″>
<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-2551833243200″>
<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>&#34;&#34;&#34;</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-2551833243312″>
<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>&#34;model&#34;: &#34;chatglm3-6b&#34;,</pre></div>
</div>

<li><div class=”frame” id=”frame-2551833243536″>
<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-2551833280576″>
<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-2551833280688″>
<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>&#34;&#34;&#34;</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-2551833280800″>
<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>&#34;functions&#34;: {},</pre>
<pre class=”line before”><span class=”ws”> </span>&#34;repetition_penalty&#34;: 1.1</pre>
<pre class=”line before”><span class=”ws”> </span>}</pre>
<pre class=”line before”><span class=”ws”> </span>headers = {&#34;content-type&#34;: &#34;application/json&#34;}</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(&#34;POST&#34;, 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[&#39;choices&#39;][0][&#39;message&#39;][&#39;content&#39;]</pre>
<pre class=”line after”><span class=”ws”> </span>new_content = new_content.replace(&#34;重新改写后:&#34;, &#34;&#34;).replace(&#34;&#34;, &#34;&#34;)</pre></div>
</div>

<li><div class=”frame” id=”frame-2551833280912″>
<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 &#39;with&#39; 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&#34;&#34;&#34;Sends a GET request.</pre>
<pre class=”line after”><span class=”ws”></span> </pre></div>
</div>

<li><div class=”frame” id=”frame-2551833281136″>
<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>&#34;timeout&#34;: timeout,</pre>
<pre class=”line before”><span class=”ws”> </span>&#34;allow_redirects&#34;: 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&#34;&#34;&#34;Sends a GET request. Returns :class:`Response` object.</pre></div>
</div>

<li><div class=”frame” id=”frame-2551833281248″>
<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-2551833281360″>
<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=&#39;127.0.0.1&#39;, port=7861): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError(&#39;&lt;urllib3.connection.HTTPConnection object at 0x00000252251D63D0&gt;: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。&#39;))
</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 &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py&#34;, line 203, in _new_conn
sock = connection.create_connection(
File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\util\connection.py&#34;, line 85, in create_connection
raise err
File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\util\connection.py&#34;, 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 &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py&#34;, line 790, in urlopen
response = self._make_request(
File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py&#34;, line 496, in _make_request
conn.request(
File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py&#34;, line 395, in request
self.endheaders()
File &#34;C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py&#34;, line 1280, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File &#34;C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py&#34;, line 1040, in _send_output
self.send(msg)
File &#34;C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py&#34;, line 980, in send
self.connect()
File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py&#34;, line 243, in connect
self.sock = self._new_conn()
File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py&#34;, line 218, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: &lt;urllib3.connection.HTTPConnection object at 0x00000252251D63D0&gt;: 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 &#34;F:\project\wxgzh\venv\lib\site-packages\requests\adapters.py&#34;, line 486, in send
resp = conn.urlopen(
File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py&#34;, line 844, in urlopen
retries = retries.increment(
File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\util\retry.py&#34;, line 515, in increment
raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host=&#39;127.0.0.1&#39;, port=7861): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError(&#39;&lt;urllib3.connection.HTTPConnection object at 0x00000252251D63D0&gt;: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。&#39;))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File &#34;F:\project\wxgzh\venv\lib\site-packages\flask\app.py&#34;, line 1478, in __call__
return self.wsgi_app(environ, start_response)
File &#34;F:\project\wxgzh\venv\lib\site-packages\flask\app.py&#34;, line 1458, in wsgi_app
response = self.handle_exception(e)
File &#34;F:\project\wxgzh\venv\lib\site-packages\flask\app.py&#34;, line 1455, in wsgi_app
response = self.full_dispatch_request()
File &#34;F:\project\wxgzh\venv\lib\site-packages\flask\app.py&#34;, line 869, in full_dispatch_request
rv = self.handle_user_exception(e)
File &#34;F:\project\wxgzh\venv\lib\site-packages\flask\app.py&#34;, line 867, in full_dispatch_request
rv = self.dispatch_request()
File &#34;F:\project\wxgzh\venv\lib\site-packages\flask\app.py&#34;, line 852, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
File &#34;F:\project\wxgzh\model_server.py&#34;, line 322, in get_new_content_api
new_content = get_new_content(engine_type,need_summary,need_keywords,content) # 传递 len 参数,使用 30 作为长度
File &#34;F:\project\wxgzh\venv\lib\site-packages\decorator.py&#34;, line 232, in fun
return caller(func, *(extras + args), **kw)
File &#34;F:\project\wxgzh\venv\lib\site-packages\retry\api.py&#34;, line 73, in retry_decorator
return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter,
File &#34;F:\project\wxgzh\venv\lib\site-packages\retry\api.py&#34;, line 33, in __retry_internal
return f()
File &#34;F:\project\wxgzh\model_server.py&#34;, line 329, in get_new_content
new_content = get_new_content_chatglm(init_content)
File &#34;F:\project\wxgzh\venv\lib\site-packages\decorator.py&#34;, line 232, in fun
return caller(func, *(extras + args), **kw)
File &#34;F:\project\wxgzh\venv\lib\site-packages\retry\api.py&#34;, line 73, in retry_decorator
return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter,
File &#34;F:\project\wxgzh\venv\lib\site-packages\retry\api.py&#34;, line 33, in __retry_internal
return f()
File &#34;F:\project\wxgzh\model_server.py&#34;, line 355, in get_new_content_chatglm
response = requests.request(&#34;POST&#34;, chatglm_url, json=payload, headers=headers)
File &#34;F:\project\wxgzh\venv\lib\site-packages\requests\api.py&#34;, line 59, in request
return session.request(method=method, url=url, **kwargs)
File &#34;F:\project\wxgzh\venv\lib\site-packages\requests\sessions.py&#34;, line 589, in request
resp = self.send(prep, **send_kwargs)
File &#34;F:\project\wxgzh\venv\lib\site-packages\requests\sessions.py&#34;, line 703, in send
r = adapter.send(request, **kwargs)
File &#34;F:\project\wxgzh\venv\lib\site-packages\requests\adapters.py&#34;, line 519, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host=&#39;127.0.0.1&#39;, port=7861): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError(&#39;&lt;urllib3.connection.HTTPConnection object at 0x00000252251D63D0&gt;: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。&#39;))
</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 0x00000252251D63D0>: 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 0x00000252251D63D0>: 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 0x00000252251D63D0>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。’))

–>

他在社交网络平台称,每年诺奖开奖之前,都会有很多人问,今年是谁?

来源:X(Twitter)

这次,Santo直接把这个问题抛给了ChatGPT。

<!doctype html>
<html lang=en>
<head>
<title>requests.exceptions.ConnectionError: HTTPConnectionPool(host=&#39;127.0.0.1&#39;, port=7861): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError(&#39;&lt;urllib3.connection.HTTPConnection object at 0x00000252251F1700&gt;: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。&#39;))
// Werkzeug Debugger</title>
<link rel=”stylesheet” href=”?__debugger__=yes&amp;cmd=resource&amp;f=style.css”>
<link rel=”shortcut icon”
href=”?__debugger__=yes&amp;cmd=resource&amp;f=console.png”>
<script src=”?__debugger__=yes&amp;cmd=resource&amp;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=&#39;127.0.0.1&#39;, port=7861): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError(&#39;&lt;urllib3.connection.HTTPConnection object at 0x00000252251F1700&gt;: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。&#39;))
</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-2551833406368″>
<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>&#34;&#34;&#34;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>&#34;&#34;&#34;</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-2551833406480″>
<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(&#34;getaddrinfo returns an empty list&#34;)</pre></div>
</div>

<li><div class=”frame” id=”frame-2551833406592″>
<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-2551833405248″>
<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&#39;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-2551833405360″>
<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-2551833405472″>
<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 &#34;user-agent&#34; not in header_keys:</pre>
<pre class=”line before”><span class=”ws”> </span>self.putheader(&#34;User-Agent&#34;, _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&#39;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&#39;t allowed for TE: chunked</pre></div>
</div>

<li><div class=”frame” id=”frame-2551833405584″>
<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>&#34;&#34;&#34;</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>&#34;&#34;&#34;Send a complete request to the server.&#34;&#34;&#34;</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-2551833405808″>
<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>&#34;&#34;&#34;</pre>
<pre class=”line before”><span class=”ws”> </span>self._buffer.extend((b&#34;&#34;, b&#34;&#34;))</pre>
<pre class=”line before”><span class=”ws”> </span>msg = b&#34;\r\n&#34;.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, &#39;read&#39;):</pre></div>
</div>

<li><div class=”frame” id=”frame-2551833405920″>
<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>&#34;&#34;&#34;</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 &gt; 0:</pre>
<pre class=”line after”><span class=”ws”> </span>print(&#34;send:&#34;, repr(data))</pre></div>
</div>

<li><div class=”frame” id=”frame-2551833406032″>
<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) -&gt; 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&#39;re tunneling it means we&#39;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&#39;t depend on self.sock state.</pre></div>
</div>

<li><div class=”frame” id=”frame-2551833406144″>
<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&#34;Connection to {self.host} timed out. (connect timeout={self.timeout})&#34;,</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&#34;Failed to establish a new connection: {e}&#34;</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-2551833404800″>
<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-2551833404912″>
<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(&#34;Connection aborted.&#34;, 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-2551833405024″>
<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(&#34;Incremented Retry for (url=&#39;%s&#39;): %r&#34;, 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-2551833345264″>
<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) -&gt; t.Any:</pre>
<pre class=”line before”><span class=”ws”> </span>&#34;&#34;&#34;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>&#34;&#34;&#34;</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-2551833343472″>
<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-2551833345152″>
<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-2551833345376″>
<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-2551833345488″>
<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-2551833345600″>
<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 == &#34;OPTIONS&#34;</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) -&gt; Response:</pre>
<pre class=”line after”><span class=”ws”> </span>&#34;&#34;&#34;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-2551833345712″>
<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(&#39;content&#39;)</pre>
<pre class=”line before”><span class=”ws”> </span>engine_type = request.args.get(&#39;engine_type&#39;)</pre>
<pre class=”line before”><span class=”ws”> </span>need_summary = request.args.get(&#39;need_summary&#39;)</pre>
<pre class=”line before”><span class=”ws”> </span>need_keywords = request.args.get(&#39;need_keywords&#39;)</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-2551833345824″>
<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-2551833345936″>
<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-2551833403456″>
<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>&#34;&#34;&#34;</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-2551833403568″>
<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>&#34;model&#34;: &#34;chatglm3-6b&#34;,</pre></div>
</div>

<li><div class=”frame” id=”frame-2551833403792″>
<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-2551833403904″>
<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-2551833404016″>
<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>&#34;&#34;&#34;</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-2551833404128″>
<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>&#34;functions&#34;: {},</pre>
<pre class=”line before”><span class=”ws”> </span>&#34;repetition_penalty&#34;: 1.1</pre>
<pre class=”line before”><span class=”ws”> </span>}</pre>
<pre class=”line before”><span class=”ws”> </span>headers = {&#34;content-type&#34;: &#34;application/json&#34;}</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(&#34;POST&#34;, 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[&#39;choices&#39;][0][&#39;message&#39;][&#39;content&#39;]</pre>
<pre class=”line after”><span class=”ws”> </span>new_content = new_content.replace(&#34;重新改写后:&#34;, &#34;&#34;).replace(&#34;&#34;, &#34;&#34;)</pre></div>
</div>

<li><div class=”frame” id=”frame-2551833404240″>
<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 &#39;with&#39; 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&#34;&#34;&#34;Sends a GET request.</pre>
<pre class=”line after”><span class=”ws”></span> </pre></div>
</div>

<li><div class=”frame” id=”frame-2551833404464″>
<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>&#34;timeout&#34;: timeout,</pre>
<pre class=”line before”><span class=”ws”> </span>&#34;allow_redirects&#34;: 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&#34;&#34;&#34;Sends a GET request. Returns :class:`Response` object.</pre></div>
</div>

<li><div class=”frame” id=”frame-2551833404576″>
<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-2551833404688″>
<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=&#39;127.0.0.1&#39;, port=7861): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError(&#39;&lt;urllib3.connection.HTTPConnection object at 0x00000252251F1700&gt;: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。&#39;))
</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 &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py&#34;, line 203, in _new_conn
sock = connection.create_connection(
File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\util\connection.py&#34;, line 85, in create_connection
raise err
File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\util\connection.py&#34;, 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 &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py&#34;, line 790, in urlopen
response = self._make_request(
File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py&#34;, line 496, in _make_request
conn.request(
File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py&#34;, line 395, in request
self.endheaders()
File &#34;C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py&#34;, line 1280, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File &#34;C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py&#34;, line 1040, in _send_output
self.send(msg)
File &#34;C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py&#34;, line 980, in send
self.connect()
File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py&#34;, line 243, in connect
self.sock = self._new_conn()
File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py&#34;, line 218, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: &lt;urllib3.connection.HTTPConnection object at 0x00000252251F1700&gt;: 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 &#34;F:\project\wxgzh\venv\lib\site-packages\requests\adapters.py&#34;, line 486, in send
resp = conn.urlopen(
File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py&#34;, line 844, in urlopen
retries = retries.increment(
File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\util\retry.py&#34;, line 515, in increment
raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host=&#39;127.0.0.1&#39;, port=7861): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError(&#39;&lt;urllib3.connection.HTTPConnection object at 0x00000252251F1700&gt;: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。&#39;))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File &#34;F:\project\wxgzh\venv\lib\site-packages\flask\app.py&#34;, line 1478, in __call__
return self.wsgi_app(environ, start_response)
File &#34;F:\project\wxgzh\venv\lib\site-packages\flask\app.py&#34;, line 1458, in wsgi_app
response = self.handle_exception(e)
File &#34;F:\project\wxgzh\venv\lib\site-packages\flask\app.py&#34;, line 1455, in wsgi_app
response = self.full_dispatch_request()
File &#34;F:\project\wxgzh\venv\lib\site-packages\flask\app.py&#34;, line 869, in full_dispatch_request
rv = self.handle_user_exception(e)
File &#34;F:\project\wxgzh\venv\lib\site-packages\flask\app.py&#34;, line 867, in full_dispatch_request
rv = self.dispatch_request()
File &#34;F:\project\wxgzh\venv\lib\site-packages\flask\app.py&#34;, line 852, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
File &#34;F:\project\wxgzh\model_server.py&#34;, line 322, in get_new_content_api
new_content = get_new_content(engine_type,need_summary,need_keywords,content) # 传递 len 参数,使用 30 作为长度
File &#34;F:\project\wxgzh\venv\lib\site-packages\decorator.py&#34;, line 232, in fun
return caller(func, *(extras + args), **kw)
File &#34;F:\project\wxgzh\venv\lib\site-packages\retry\api.py&#34;, line 73, in retry_decorator
return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter,
File &#34;F:\project\wxgzh\venv\lib\site-packages\retry\api.py&#34;, line 33, in __retry_internal
return f()
File &#34;F:\project\wxgzh\model_server.py&#34;, line 329, in get_new_content
new_content = get_new_content_chatglm(init_content)
File &#34;F:\project\wxgzh\venv\lib\site-packages\decorator.py&#34;, line 232, in fun
return caller(func, *(extras + args), **kw)
File &#34;F:\project\wxgzh\venv\lib\site-packages\retry\api.py&#34;, line 73, in retry_decorator
return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter,
File &#34;F:\project\wxgzh\venv\lib\site-packages\retry\api.py&#34;, line 33, in __retry_internal
return f()
File &#34;F:\project\wxgzh\model_server.py&#34;, line 355, in get_new_content_chatglm
response = requests.request(&#34;POST&#34;, chatglm_url, json=payload, headers=headers)
File &#34;F:\project\wxgzh\venv\lib\site-packages\requests\api.py&#34;, line 59, in request
return session.request(method=method, url=url, **kwargs)
File &#34;F:\project\wxgzh\venv\lib\site-packages\requests\sessions.py&#34;, line 589, in request
resp = self.send(prep, **send_kwargs)
File &#34;F:\project\wxgzh\venv\lib\site-packages\requests\sessions.py&#34;, line 703, in send
r = adapter.send(request, **kwargs)
File &#34;F:\project\wxgzh\venv\lib\site-packages\requests\adapters.py&#34;, line 519, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host=&#39;127.0.0.1&#39;, port=7861): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError(&#39;&lt;urllib3.connection.HTTPConnection object at 0x00000252251F1700&gt;: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。&#39;))
</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 0x00000252251F1700>: 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 0x00000252251F1700>: 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 0x00000252251F1700>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。’))

–>

然鹅,ChatGPT却表示,「我无法预测未来,包括2023年在内任何一年的诺贝尔奖获得者」。

事实上,这个答案并未让人感到意外。这是因为,无论是ChatGPT还是其他任何聊天机器人,都不具备预测未来的能力,就像那颗著名的“水晶球”。

之后,Santo的学生输入了类似的提示,让Claude,以及ChatGPT去回答。

在研究过程中,我们惊讶地发现两个聊天机器人具有相同的洞察力,它们都能找出一些重要的发现。这些重要发现包括基因编辑工具CRISPR的研发以及二维材料石墨烯的发现。这无疑证明了聊天机器人在科学研究中的潜力和价值。

但是,不可否认的是,它们的发现还有重大的缺陷。

ChatGPT和Claude指出的发现中,已经有科学家们,因此获得了诺贝尔奖。

这并非单方面的问题。Santo阐述道:“我所询问的是那些「仍然存活」的科学家,然而他们所提供的实例却是那些已经「离世」的科学家。”

对此,小编拿着同样的提示问问ChatGPT,顺便给它用上最新的必应联网功能,看看回答的怎样?

第一次,ChatGPT并没给出答案。

明确预定每个领域的「三大」发现很有挑战性,建议查阅科学杂志、知名新闻机构或与各领域相关的组织。

来源:新智元

同样的问题再问一遍,这次,ChatGPT给出了自己在这三个领域方向和进展的预测。

ChatGPT表示,若不对这些领域进行深入研究,就难以准确判断相关科学家的诺贝尔奖得主身份。他有能力阐述这些领域最近的突破性成果或发展情况,这将有助于我们更好地了解这些领域的最新进展。

来源:新智元

首先,在化学领域。

– CRISPR-Cas9技术:这是一种革命性的基因编辑系统,允许科学家精确修改生物体内的基因。

生物化学家Jennifer Doudna作为该系统研究者之一,曾荣获诺贝尔奖,然而与该系统开发密切相关的其他人在此荣誉中却未能获得。

来源:新智元

– 金属有机框架(MOFs):这是一种具有极高表面积的化合物,能够捕获、储存和释放化合物,具有包括碳捕获在内的广泛潜在应用。

其次,在物理学领域。

– 第一张黑洞图像:Event Horizon Telescope合作组织于2019年发布了第一张黑洞图像。

虽然这是一项集许多科学家之力取得的努力,但并非所有参与其中的科学家都获得了诺贝尔奖。

来源:新智元

– 引力波探测:LIGO首次探测到引力波是一项不朽的成就,虽然一些关键人物获得了诺贝尔奖,但许多贡献者却没有获得诺贝尔奖。

最后,在生理学或医学领域。

– mRNA疫苗的开发:为COVID-19快速开发和部署mRNA疫苗是一项不朽的成就。「虽然一些科学家获得了认可,但其他科学家却没有获得诺贝尔奖。」

– 免疫疗法在癌症治疗方面的进展:免疫疗法是治疗某些类型癌症的重大进展。

来源:新智元

可以看到,ChatGPT以上的回答都是,侧重三个领域当前研究的重要方向。

不如再让它预测下,2023诺奖得主。

ChatGPT根据网络搜索结果,没有给出真正答案,再次强调「一些化学家预测,mRNA疫苗的开发可能会获得2023年诺贝尔化学奖」。

如此说来,mRNA疫苗有很大可能成为今年化学领域风向标。

来源:新智元

再问它最后一个问题,「哪位中国科学家,最有可能获得诺贝尔奖」?

ChatGPT根据一些中国科学家因自己的贡献获得国际认可,被许多人作为潜在诺奖得主,并给出了几个例子。

来源:新智元

AI预测可靠吗?

那么,用ChatGPT预测诺奖的结果可不可信?

伊利诺伊州芝加哥大学的计算社会科学家James Evans表示,「尽管大型语言模型(如ChatGPT和Claude)无法成为伟大的诺贝尔预言家,但它们确实有潜力成为强大的预测工具」。

来源:新智元

若使使它们达到目的,还需要做一些「微调工作」。

简言之,创建一个能预测诺贝尔奖的AI,需要对LLM需要进行修改,并在适当的数据上进行训练。

就在上周,分析公司科睿唯安(Clarivate)发布了2023年度「引文桂冠奖」名单。

这份名单在过去20年,成功预测了71位未来诺贝尔奖获得者,主要是通过分析作者研究的被引次数。

来源:新智元

不过,这样的分析,通常是无法预测出,准诺奖得主具体的获奖年份。

「引文桂冠奖」名单着重突出发表论文被引次数至少2000次的研究人员,这一程度与多数以前的诺奖获得者相当。

来源:新智元

与此同时,科睿唯安的分析还考虑了,这些被高度引用论文的作者是否有开创性发现,并且是否已经获得显著的奖项。

今年上榜的研究人员,在癌症免疫疗法、合成生物学和材料科学等领域做出了巨大贡献。

科睿唯安研究分析主管David Pendlebury表示,公司已经开始探索生成式A如何帮助预测未来的诺贝尔奖得主。

「我们可能会在明年的评选中,从AI预测中得到一些贡献」。

生成式AI可以为现有方法提供一个优势,它们能够在大量科学作品中进行查找。这将提高我们确定为潜在诺贝尔奖获得者的候选人库的速度和全面性。

特殊贡献,无法量化

丹麦技术大学的物理学家Rasmus Bjørk对诺贝尔奖得主进行了分析,仅仅看引用,不足以表明谁将来可能获得诺贝尔奖。

Bjørk说,要获得最高奖项,研究人员需要做出开创性的工作,推动一个领域向前发展,或者对社会产生根本性影响。

「这个贡献,必须有一些特别之处。因此,量化这种特殊性可能很困难」。

但Bjørk表示,生成式AI工具也可能会,延续此前围绕诺奖的偏见。

自1901年诺贝尔奖设立以来,至今,也只有60位女性获奖。

如果LLM根据过去获奖者的数据进行训练,它们更可能选择男性,而不是女性作为未来的潜在获奖者。

基于AI的新奖?

当然,要真正决定谁将获得诺贝尔奖,人类的判断力依然是无法比拟的,而这这也正是诺贝尔奖的魅力所在。

但有朝一日,LLM可能会在科学奖领域,创造出公平的竞争环境。

由此,也可以为基于较少偏见的AI分析而非人类委员会观点的新型奖项,铺平道路。

而这种奖项,也将有助于突出那些,以目前尚未得到认可的方式颠覆和改变科学的研究。

最后,贴一个physicsworld对今年物理学奖的预测。他们曾在2013年时,正确地推断出Peter Higgs和François Englert会因对希格斯机制的预测而获奖。

来源:新智元

「DNA结构」发现者,缺一个诺贝尔奖

在《科学美国人》最新一期报道中称,英国物理化学家与晶体学家Rosalind Franklin(1920-1958)因发现DNA双螺旋结构,应当再加冕一个诺贝尔奖。

来源:新智元

1953年4月25日,一篇题为《核酸的分子结构》的文章登上Nature,寥寥千余字却像一颗金手指一样,轻松地捅开了模糊了生物学界多年的那层纸,具有里程碑式的意义。

论文地址:https://www.nature.com/articles/171740a0

很多人都知道,因为解开了DNA双螺旋的秘密,背后最大贡献离不开Rosalind Franklin。

然而,1962年生物学家James Watson,Francis Crick和Maurice Wilkins因发现了DNA的分子结构而被授予生理学或医学奖,唯独没有Rosalind Franklin。

来源:新智元

这一年的诺贝尔奖,至今仍存在巨大争议,仅有3名男性获奖,而他们的女同事被排除在外。

来源:新智元

诺贝尔奖规则规定,奖项只能授予活着的科学家。

但2011年诺贝尔生理学或医学奖除外,该奖的一部分授予了医生Ralph Steinman,但委员会并不知道他已在公布前3天去世。

许多人认为,即使Franklin活着,诺贝尔大会也会忽略她,就像之前的所有女性一样,居里夫人、Gerty Cori。

《科学美国人》称,诺贝尔颁奖典礼应当纠正这一错误,将诺奖追授给富兰克林Franklin,以表彰她在发现双螺旋结构方面发挥的核心作用。

来源:新智元

诺奖之路,愈发漫长

毫无疑问,诺贝尔奖是世界上最负盛名的科学奖项。然而,通往诺贝尔奖的道路,却越来越漫长。

现在,几乎有一半的获奖者从做出值得诺贝尔奖的发现到获奖要等待20多年。

一项分析表明,在过去的60年里,从发表研究成果到获得科学奖的平均时间几乎翻了一番。

在三大科学奖中,化学奖的「诺贝尔奖滞后期」最长,过去十年的平均值为30年,而生理学或医学奖的滞后期最短,为26年。

诺贝尔的遗嘱规定,奖项应颁发给「在前一年为人类做出最大贡献的人」。但实际上,这种情况只发生过几次。

此外,在20世纪上半叶,诺贝尔奖得主年龄在30多岁是很常见的,而现在这种情况却闻所未闻。

来源:新智元

2014年,印第安纳大学计算社会科学家Santo Fortunato,发表了一份自诺贝尔奖设立以来所有获奖者的分析报告。结果显示,获奖者的获奖研究与其获得诺贝尔奖之间的时间间隔一直在缓慢增加。

对此,康奈尔大学的计算社会科学家Yian Yin表示,造成这种趋势的原因可能有很多。

比如,由于每年取得突破的总体数量都在增加,因此奖项跟不上值得表彰的人数。或者,一些工作的重要性可能只有在数年甚至数十年后才被认识到,Yin称之为「睡美人」。

来源:新智元

另一方面,这种日益拉大的差距也可能表明——那些能够改变其领域范式的「颠覆性」研究或发现,变少了。

Fortunato表示,「重大突破」的数量正在减少,但当它们出现时,往往会很快得到认可。

例如,加州大学伯克利分校的生物化学家Jennifer Doudna和马克斯-普朗克病原体科学研究所的Emmanuelle Charpentier,在开发出基因编辑工具CRISPR-Cas9系统仅仅8年后,就获得了2020年诺贝尔化学奖。

有研究人员推测,在COVID-19疫情期间向全球数百万人推出mRNA疫苗的发明者,也可能获得类似的认可。

但问题是,如果上述等待时间继续拉长,一些杰出的科学家很可能就会因为禁止追授奖项的规定,而与诺贝尔奖失之交臂。

来源:新智元

颁奖时间表

诺贝尔奖颁奖季又到了。

每年10月,瑞典和挪威的诺贝尔奖委员会都会评选出科学、文学、经济等共计六个奖项的获奖者。

随后,获奖者将于12月在斯德哥尔摩领取诺贝尔奖奖章和证书。

今年,诺贝尔奖的奖金为1100万瑞典克朗,按当前汇率折合约98.9万美元。

值得一提的是,每年诺奖评选最让委员会头疼的一个问题是「rule of three」,就是说,每个奖项最多只能颁给三位科学家。

来源:新智元

生理学或医学奖将于10月2日周一宣布。物理学奖将于10月3日周二宣布。化学奖将于10月4日周三宣布。文学奖将于10月5日周四宣布。和平奖将于10月6日周五宣布。经济学奖将于10月9日周一宣布。

来源:新智元

参考资料:

https://www.nature.com/articles/d41586-023-03074-7

https://www.nature.com/articles/d41586-023-03086-3

https://www.scientificamerican.com/article/rosalind-franklin-deserves-a-posthumous-nobel-prize-for-co-discovering-dna-structure/

举报/反馈

AI时代,拥有个人微信机器人AI助手!AI时代不落人后!

免费ChatGPT问答,办公、写作、生活好得力助手!

搜索微信号aigc666aigc999或上边扫码,即可拥有个人AI助手!

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注