requests.exceptions.JSONDecodeError: Expecting v
文章主题:
// Werkzeug Debugger
JSONDecodeError
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last)
-
File “F:\project\wxgzh\venv\lib\site-packages\requests\models.py”
<!doctype html>
<html lang=en>
<head>
<title>requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
// Werkzeug Debugger</title>
<link rel=”stylesheet” href=”?__debugger__=yes&cmd=resource&f=style.css”>
<link rel=”shortcut icon”
href=”?__debugger__=yes&cmd=resource&f=console.png”>
<script src=”?__debugger__=yes&cmd=resource&f=debugger.js”></script>
<script>
var CONSOLE_MODE = false,
EVALEX = true,
EVALEX_TRUSTED = false,
SECRET = “uImqR9BO9WQOrgY4YnuS”;
</script>
</head>
<body style=”background-color: #fff”>
<div class=”debugger”>
<h1>JSONDecodeError</h1>
<div class=”detail”>
<p class=”errormsg”>requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
</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-2552849859520″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\requests\models.py”</cite>,
line <em class=”line”>971</em>,
in <code class=”function”>json</code></h4>
<div class=”source library”><pre class=”line before”><span class=”ws”> </span>pass</pre>
<pre class=”line before”><span class=”ws”> </span>except JSONDecodeError as e:</pre>
<pre class=”line before”><span class=”ws”> </span>raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)</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>return complexjson.loads(self.text, **kwargs)</pre>
<pre class=”line after”><span class=”ws”> </span>except JSONDecodeError as e:</pre>
<pre class=”line after”><span class=”ws”> </span># Catch JSON-related errors and raise as requests.JSONDecodeError</pre>
<pre class=”line after”><span class=”ws”> </span># This aliases json.JSONDecodeError and simplejson.JSONDecodeError</pre>
<pre class=”line after”><span class=”ws”> </span>raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)</pre>
<pre class=”line after”><span class=”ws”></span> </pre></div>
</div><li><div class=”frame” id=”frame-2552849859632″>
<h4>File <cite class=”filename”>”C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\__init__.py”</cite>,
line <em class=”line”>346</em>,
in <code class=”function”>loads</code></h4>
<div class=”source “><pre class=”line before”><span class=”ws”> </span>s = s.decode(detect_encoding(s), 'surrogatepass')</pre>
<pre class=”line before”><span class=”ws”></span> </pre>
<pre class=”line before”><span class=”ws”> </span>if (cls is None and object_hook is None and</pre>
<pre class=”line before”><span class=”ws”> </span>parse_int is None and parse_float is None and</pre>
<pre class=”line before”><span class=”ws”> </span>parse_constant is None and object_pairs_hook is None and not kw):</pre>
<pre class=”line current”><span class=”ws”> </span>return _default_decoder.decode(s)</pre>
<pre class=”line after”><span class=”ws”> </span>if cls is None:</pre>
<pre class=”line after”><span class=”ws”> </span>cls = JSONDecoder</pre>
<pre class=”line after”><span class=”ws”> </span>if object_hook is not None:</pre>
<pre class=”line after”><span class=”ws”> </span>kw['object_hook'] = object_hook</pre>
<pre class=”line after”><span class=”ws”> </span>if object_pairs_hook is not None:</pre></div>
</div><li><div class=”frame” id=”frame-2552849859744″>
<h4>File <cite class=”filename”>”C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\decoder.py”</cite>,
line <em class=”line”>337</em>,
in <code class=”function”>decode</code></h4>
<div class=”source “><pre class=”line before”><span class=”ws”> </span>def decode(self, s, _w=WHITESPACE.match):</pre>
<pre class=”line before”><span class=”ws”> </span>"""Return the Python representation of “s“ (a “str“ instance</pre>
<pre class=”line before”><span class=”ws”> </span>containing a JSON document).</pre>
<pre class=”line before”><span class=”ws”></span> </pre>
<pre class=”line before”><span class=”ws”> </span>"""</pre>
<pre class=”line current”><span class=”ws”> </span>obj, end = self.raw_decode(s, idx=_w(s, 0).end())</pre>
<pre class=”line after”><span class=”ws”> </span>end = _w(s, end).end()</pre>
<pre class=”line after”><span class=”ws”> </span>if end != len(s):</pre>
<pre class=”line after”><span class=”ws”> </span>raise JSONDecodeError("Extra data", s, end)</pre>
<pre class=”line after”><span class=”ws”> </span>return obj</pre>
<pre class=”line after”><span class=”ws”></span> </pre></div>
</div><li><div class=”frame” id=”frame-2552849859968″>
<h4>File <cite class=”filename”>”C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\decoder.py”</cite>,
line <em class=”line”>355</em>,
in <code class=”function”>raw_decode</code></h4>
<div class=”source “><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>try:</pre>
<pre class=”line before”><span class=”ws”> </span>obj, end = self.scan_once(s, idx)</pre>
<pre class=”line before”><span class=”ws”> </span>except StopIteration as err:</pre>
<pre class=”line current”><span class=”ws”> </span>raise JSONDecodeError("Expecting value", s, err.value) from None</pre>
<pre class=”line after”><span class=”ws”> </span>return obj, end</pre></div>
</div><li><div class=”exc-divider”>During handling of the above exception, another exception occurred:</div>
<li><div class=”frame” id=”frame-2552849767552″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\flask\app.py”</cite>,
line <em class=”line”>1478</em>,
in <code class=”function”>__call__</code></h4>
<div class=”source library”><pre class=”line before”><span class=”ws”> </span>def __call__(self, environ: dict, start_response: t.Callable) -> t.Any:</pre>
<pre class=”line before”><span class=”ws”> </span>"""The WSGI server calls the Flask application object as the</pre>
<pre class=”line before”><span class=”ws”> </span>WSGI application. This calls :meth:`wsgi_app`, which can be</pre>
<pre class=”line before”><span class=”ws”> </span>wrapped to apply middleware.</pre>
<pre class=”line before”><span class=”ws”> </span>"""</pre>
<pre class=”line current”><span class=”ws”> </span>return self.wsgi_app(environ, start_response)</pre></div>
</div><li><div class=”frame” id=”frame-2552849767216″>
<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-2552849767440″>
<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-2552849767664″>
<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-2552849767776″>
<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-2552849767888″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\flask\app.py”</cite>,
line <em class=”line”>852</em>,
in <code class=”function”>dispatch_request</code></h4>
<div class=”source library”><pre class=”line before”><span class=”ws”> </span>and req.method == "OPTIONS"</pre>
<pre class=”line before”><span class=”ws”> </span>):</pre>
<pre class=”line before”><span class=”ws”> </span>return self.make_default_options_response()</pre>
<pre class=”line before”><span class=”ws”> </span># otherwise dispatch to the handler for that endpoint</pre>
<pre class=”line before”><span class=”ws”> </span>view_args: dict[str, t.Any] = req.view_args # type: ignore[assignment]</pre>
<pre class=”line current”><span class=”ws”> </span>return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)</pre>
<pre class=”line after”><span class=”ws”></span> </pre>
<pre class=”line after”><span class=”ws”> </span>def full_dispatch_request(self) -> Response:</pre>
<pre class=”line after”><span class=”ws”> </span>"""Dispatches the request and on top of that performs request</pre>
<pre class=”line after”><span class=”ws”> </span>pre and postprocessing as well as HTTP exception catching and</pre>
<pre class=”line after”><span class=”ws”> </span>error handling.</pre></div>
</div><li><div class=”frame” id=”frame-2552849768000″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\model_server.py”</cite>,
line <em class=”line”>322</em>,
in <code class=”function”>get_new_content_api</code></h4>
<div class=”source “><pre class=”line before”><span class=”ws”></span>def get_new_content_api():</pre>
<pre class=”line before”><span class=”ws”> </span>content = request.args.get('content')</pre>
<pre class=”line before”><span class=”ws”> </span>engine_type = request.args.get('engine_type')</pre>
<pre class=”line before”><span class=”ws”> </span>need_summary = request.args.get('need_summary')</pre>
<pre class=”line before”><span class=”ws”> </span>need_keywords = request.args.get('need_keywords')</pre>
<pre class=”line current”><span class=”ws”> </span>new_content = get_new_content(engine_type,need_summary,need_keywords,content) # 传递 len 参数,使用 30 作为长度</pre>
<pre class=”line after”><span class=”ws”> </span>return new_content</pre>
<pre class=”line after”><span class=”ws”></span>@retry(exceptions=ConnectionError,tries=tries,delay=1)</pre>
<pre class=”line after”><span class=”ws”></span>def get_new_content(engine_type,need_summary,need_keywords,init_content):</pre>
<pre class=”line after”><span class=”ws”> </span>if engine_type == RewriteEnum.EngineType.WENXINYIYAN:</pre>
<pre class=”line after”><span class=”ws”> </span>new_content = get_wp_post_wx_continue(need_summary,need_keywords ,init_content)</pre></div>
</div><li><div class=”frame” id=”frame-2552849768112″>
<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-2552849768224″>
<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-2552849768336″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\retry\api.py”</cite>,
line <em class=”line”>33</em>,
in <code class=”function”>__retry_internal</code></h4>
<div class=”source library”><pre class=”line before”><span class=”ws”> </span>:returns: the result of the f function.</pre>
<pre class=”line before”><span class=”ws”> </span>"""</pre>
<pre class=”line before”><span class=”ws”> </span>_tries, _delay = tries, delay</pre>
<pre class=”line before”><span class=”ws”> </span>while _tries:</pre>
<pre class=”line before”><span class=”ws”> </span>try:</pre>
<pre class=”line current”><span class=”ws”> </span>return f()</pre>
<pre class=”line after”><span class=”ws”> </span>except exceptions as e:</pre>
<pre class=”line after”><span class=”ws”> </span>_tries -= 1</pre>
<pre class=”line after”><span class=”ws”> </span>if not _tries:</pre>
<pre class=”line after”><span class=”ws”> </span>raise</pre>
<pre class=”line after”><span class=”ws”></span> </pre></div>
</div><li><div class=”frame” id=”frame-2552849858624″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\model_server.py”</cite>,
line <em class=”line”>329</em>,
in <code class=”function”>get_new_content</code></h4>
<div class=”source “><pre class=”line before”><span class=”ws”></span>@retry(exceptions=ConnectionError,tries=tries,delay=1)</pre>
<pre class=”line before”><span class=”ws”></span>def get_new_content(engine_type,need_summary,need_keywords,init_content):</pre>
<pre class=”line before”><span class=”ws”> </span>if engine_type == RewriteEnum.EngineType.WENXINYIYAN:</pre>
<pre class=”line before”><span class=”ws”> </span>new_content = get_wp_post_wx_continue(need_summary,need_keywords ,init_content)</pre>
<pre class=”line before”><span class=”ws”> </span>else:</pre>
<pre class=”line current”><span class=”ws”> </span>new_content = get_new_content_chatglm(init_content)</pre>
<pre class=”line after”><span class=”ws”> </span>return new_content</pre>
<pre class=”line after”><span class=”ws”></span>@retry(exceptions=ConnectionError,tries=tries,delay=1)</pre>
<pre class=”line after”><span class=”ws”></span>def get_new_content_chatglm(content):</pre>
<pre class=”line after”><span class=”ws”> </span>payload = {</pre>
<pre class=”line after”><span class=”ws”> </span>"model": "chatglm3-6b",</pre></div>
</div><li><div class=”frame” id=”frame-2552849858848″>
<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-2552849858960″>
<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-2552849859072″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\retry\api.py”</cite>,
line <em class=”line”>33</em>,
in <code class=”function”>__retry_internal</code></h4>
<div class=”source library”><pre class=”line before”><span class=”ws”> </span>:returns: the result of the f function.</pre>
<pre class=”line before”><span class=”ws”> </span>"""</pre>
<pre class=”line before”><span class=”ws”> </span>_tries, _delay = tries, delay</pre>
<pre class=”line before”><span class=”ws”> </span>while _tries:</pre>
<pre class=”line before”><span class=”ws”> </span>try:</pre>
<pre class=”line current”><span class=”ws”> </span>return f()</pre>
<pre class=”line after”><span class=”ws”> </span>except exceptions as e:</pre>
<pre class=”line after”><span class=”ws”> </span>_tries -= 1</pre>
<pre class=”line after”><span class=”ws”> </span>if not _tries:</pre>
<pre class=”line after”><span class=”ws”> </span>raise</pre>
<pre class=”line after”><span class=”ws”></span> </pre></div>
</div><li><div class=”frame” id=”frame-2552849859184″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\model_server.py”</cite>,
line <em class=”line”>357</em>,
in <code class=”function”>get_new_content_chatglm</code></h4>
<div class=”source “><pre class=”line before”><span class=”ws”> </span>}</pre>
<pre class=”line before”><span class=”ws”> </span>headers = {"content-type": "application/json"}</pre>
<pre class=”line before”><span class=”ws”> </span>task_start_time = time.time()</pre>
<pre class=”line before”><span class=”ws”> </span>response = requests.request("POST", chatglm_url, json=payload, headers=headers)</pre>
<pre class=”line before”><span class=”ws”> </span>#print(response)</pre>
<pre class=”line current”><span class=”ws”> </span>data = response.json()</pre>
<pre class=”line after”><span class=”ws”> </span>print(json.dumps(data, indent=4))</pre>
<pre class=”line after”><span class=”ws”> </span>new_content = data['choices'][0]['message']['content']</pre>
<pre class=”line after”><span class=”ws”> </span>new_content = new_content.replace("重新改写后:", "").replace("", "")</pre>
<pre class=”line after”><span class=”ws”> </span>new_content = new_content.replace("重新组织后:", "")</pre>
<pre class=”line after”><span class=”ws”> </span>new_content = new_content.replace("\n", "")</pre></div>
</div><li><div class=”frame” id=”frame-2552849859296″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\requests\models.py”</cite>,
line <em class=”line”>975</em>,
in <code class=”function”>json</code></h4>
<div class=”source library”><pre class=”line before”><span class=”ws”> </span>try:</pre>
<pre class=”line before”><span class=”ws”> </span>return complexjson.loads(self.text, **kwargs)</pre>
<pre class=”line before”><span class=”ws”> </span>except JSONDecodeError as e:</pre>
<pre class=”line before”><span class=”ws”> </span># Catch JSON-related errors and raise as requests.JSONDecodeError</pre>
<pre class=”line before”><span class=”ws”> </span># This aliases json.JSONDecodeError and simplejson.JSONDecodeError</pre>
<pre class=”line current”><span class=”ws”> </span>raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)</pre>
<pre class=”line after”><span class=”ws”></span> </pre>
<pre class=”line after”><span class=”ws”> </span>@property</pre>
<pre class=”line after”><span class=”ws”> </span>def links(self):</pre>
<pre class=”line after”><span class=”ws”> </span>"""Returns the parsed header links of the response, if any."""</pre>
<pre class=”line after”><span class=”ws”></span> </pre></div>
</div>
</ul>
<blockquote>requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
</blockquote>
</div><div class=”plain”>
<p>
This is the Copy/Paste friendly version of the traceback.
</p>
<textarea cols=”50″ rows=”10″ name=”code” readonly>Traceback (most recent call last):
File "F:\project\wxgzh\venv\lib\site-packages\requests\models.py", line 971, in json
return complexjson.loads(self.text, **kwargs)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)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 357, in get_new_content_chatglm
data = response.json()
File "F:\project\wxgzh\venv\lib\site-packages\requests\models.py", line 975, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
</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\requests\models.py”, line 971, in json
return complexjson.loads(self.text, **kwargs)
File “C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\__init__.py”, line 346, in loads
return _default_decoder.decode(s)
File “C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\decoder.py”, line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File “C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\decoder.py”, line 355, in raw_decode
raise JSONDecodeError(“Expecting value”, s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)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 357, in get_new_content_chatglm
data = response.json()
File “F:\project\wxgzh\venv\lib\site-packages\requests\models.py”, line 975, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)–>
1. 【ChatGPT的9个新应用案例】
<!doctype html>
<html lang=en>
<head>
<title>requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
// Werkzeug Debugger</title>
<link rel=”stylesheet” href=”?__debugger__=yes&cmd=resource&f=style.css”>
<link rel=”shortcut icon”
href=”?__debugger__=yes&cmd=resource&f=console.png”>
<script src=”?__debugger__=yes&cmd=resource&f=debugger.js”></script>
<script>
var CONSOLE_MODE = false,
EVALEX = true,
EVALEX_TRUSTED = false,
SECRET = “uImqR9BO9WQOrgY4YnuS”;
</script>
</head>
<body style=”background-color: #fff”>
<div class=”debugger”>
<h1>JSONDecodeError</h1>
<div class=”detail”>
<p class=”errormsg”>requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
</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-2552849926400″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\requests\models.py”</cite>,
line <em class=”line”>971</em>,
in <code class=”function”>json</code></h4>
<div class=”source library”><pre class=”line before”><span class=”ws”> </span>pass</pre>
<pre class=”line before”><span class=”ws”> </span>except JSONDecodeError as e:</pre>
<pre class=”line before”><span class=”ws”> </span>raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)</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>return complexjson.loads(self.text, **kwargs)</pre>
<pre class=”line after”><span class=”ws”> </span>except JSONDecodeError as e:</pre>
<pre class=”line after”><span class=”ws”> </span># Catch JSON-related errors and raise as requests.JSONDecodeError</pre>
<pre class=”line after”><span class=”ws”> </span># This aliases json.JSONDecodeError and simplejson.JSONDecodeError</pre>
<pre class=”line after”><span class=”ws”> </span>raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)</pre>
<pre class=”line after”><span class=”ws”></span> </pre></div>
</div><li><div class=”frame” id=”frame-2552849926512″>
<h4>File <cite class=”filename”>”C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\__init__.py”</cite>,
line <em class=”line”>346</em>,
in <code class=”function”>loads</code></h4>
<div class=”source “><pre class=”line before”><span class=”ws”> </span>s = s.decode(detect_encoding(s), 'surrogatepass')</pre>
<pre class=”line before”><span class=”ws”></span> </pre>
<pre class=”line before”><span class=”ws”> </span>if (cls is None and object_hook is None and</pre>
<pre class=”line before”><span class=”ws”> </span>parse_int is None and parse_float is None and</pre>
<pre class=”line before”><span class=”ws”> </span>parse_constant is None and object_pairs_hook is None and not kw):</pre>
<pre class=”line current”><span class=”ws”> </span>return _default_decoder.decode(s)</pre>
<pre class=”line after”><span class=”ws”> </span>if cls is None:</pre>
<pre class=”line after”><span class=”ws”> </span>cls = JSONDecoder</pre>
<pre class=”line after”><span class=”ws”> </span>if object_hook is not None:</pre>
<pre class=”line after”><span class=”ws”> </span>kw['object_hook'] = object_hook</pre>
<pre class=”line after”><span class=”ws”> </span>if object_pairs_hook is not None:</pre></div>
</div><li><div class=”frame” id=”frame-2552849926624″>
<h4>File <cite class=”filename”>”C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\decoder.py”</cite>,
line <em class=”line”>337</em>,
in <code class=”function”>decode</code></h4>
<div class=”source “><pre class=”line before”><span class=”ws”> </span>def decode(self, s, _w=WHITESPACE.match):</pre>
<pre class=”line before”><span class=”ws”> </span>"""Return the Python representation of “s“ (a “str“ instance</pre>
<pre class=”line before”><span class=”ws”> </span>containing a JSON document).</pre>
<pre class=”line before”><span class=”ws”></span> </pre>
<pre class=”line before”><span class=”ws”> </span>"""</pre>
<pre class=”line current”><span class=”ws”> </span>obj, end = self.raw_decode(s, idx=_w(s, 0).end())</pre>
<pre class=”line after”><span class=”ws”> </span>end = _w(s, end).end()</pre>
<pre class=”line after”><span class=”ws”> </span>if end != len(s):</pre>
<pre class=”line after”><span class=”ws”> </span>raise JSONDecodeError("Extra data", s, end)</pre>
<pre class=”line after”><span class=”ws”> </span>return obj</pre>
<pre class=”line after”><span class=”ws”></span> </pre></div>
</div><li><div class=”frame” id=”frame-2552849926848″>
<h4>File <cite class=”filename”>”C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\decoder.py”</cite>,
line <em class=”line”>355</em>,
in <code class=”function”>raw_decode</code></h4>
<div class=”source “><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>try:</pre>
<pre class=”line before”><span class=”ws”> </span>obj, end = self.scan_once(s, idx)</pre>
<pre class=”line before”><span class=”ws”> </span>except StopIteration as err:</pre>
<pre class=”line current”><span class=”ws”> </span>raise JSONDecodeError("Expecting value", s, err.value) from None</pre>
<pre class=”line after”><span class=”ws”> </span>return obj, end</pre></div>
</div><li><div class=”exc-divider”>During handling of the above exception, another exception occurred:</div>
<li><div class=”frame” id=”frame-2552846982944″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\flask\app.py”</cite>,
line <em class=”line”>1478</em>,
in <code class=”function”>__call__</code></h4>
<div class=”source library”><pre class=”line before”><span class=”ws”> </span>def __call__(self, environ: dict, start_response: t.Callable) -> t.Any:</pre>
<pre class=”line before”><span class=”ws”> </span>"""The WSGI server calls the Flask application object as the</pre>
<pre class=”line before”><span class=”ws”> </span>WSGI application. This calls :meth:`wsgi_app`, which can be</pre>
<pre class=”line before”><span class=”ws”> </span>wrapped to apply middleware.</pre>
<pre class=”line before”><span class=”ws”> </span>"""</pre>
<pre class=”line current”><span class=”ws”> </span>return self.wsgi_app(environ, start_response)</pre></div>
</div><li><div class=”frame” id=”frame-2552849924384″>
<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-2552849924608″>
<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-2552849924720″>
<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-2552849924832″>
<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-2552849924944″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\flask\app.py”</cite>,
line <em class=”line”>852</em>,
in <code class=”function”>dispatch_request</code></h4>
<div class=”source library”><pre class=”line before”><span class=”ws”> </span>and req.method == "OPTIONS"</pre>
<pre class=”line before”><span class=”ws”> </span>):</pre>
<pre class=”line before”><span class=”ws”> </span>return self.make_default_options_response()</pre>
<pre class=”line before”><span class=”ws”> </span># otherwise dispatch to the handler for that endpoint</pre>
<pre class=”line before”><span class=”ws”> </span>view_args: dict[str, t.Any] = req.view_args # type: ignore[assignment]</pre>
<pre class=”line current”><span class=”ws”> </span>return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)</pre>
<pre class=”line after”><span class=”ws”></span> </pre>
<pre class=”line after”><span class=”ws”> </span>def full_dispatch_request(self) -> Response:</pre>
<pre class=”line after”><span class=”ws”> </span>"""Dispatches the request and on top of that performs request</pre>
<pre class=”line after”><span class=”ws”> </span>pre and postprocessing as well as HTTP exception catching and</pre>
<pre class=”line after”><span class=”ws”> </span>error handling.</pre></div>
</div><li><div class=”frame” id=”frame-2552849925056″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\model_server.py”</cite>,
line <em class=”line”>322</em>,
in <code class=”function”>get_new_content_api</code></h4>
<div class=”source “><pre class=”line before”><span class=”ws”></span>def get_new_content_api():</pre>
<pre class=”line before”><span class=”ws”> </span>content = request.args.get('content')</pre>
<pre class=”line before”><span class=”ws”> </span>engine_type = request.args.get('engine_type')</pre>
<pre class=”line before”><span class=”ws”> </span>need_summary = request.args.get('need_summary')</pre>
<pre class=”line before”><span class=”ws”> </span>need_keywords = request.args.get('need_keywords')</pre>
<pre class=”line current”><span class=”ws”> </span>new_content = get_new_content(engine_type,need_summary,need_keywords,content) # 传递 len 参数,使用 30 作为长度</pre>
<pre class=”line after”><span class=”ws”> </span>return new_content</pre>
<pre class=”line after”><span class=”ws”></span>@retry(exceptions=ConnectionError,tries=tries,delay=1)</pre>
<pre class=”line after”><span class=”ws”></span>def get_new_content(engine_type,need_summary,need_keywords,init_content):</pre>
<pre class=”line after”><span class=”ws”> </span>if engine_type == RewriteEnum.EngineType.WENXINYIYAN:</pre>
<pre class=”line after”><span class=”ws”> </span>new_content = get_wp_post_wx_continue(need_summary,need_keywords ,init_content)</pre></div>
</div><li><div class=”frame” id=”frame-2552849925168″>
<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-2552849925280″>
<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-2552849925392″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\retry\api.py”</cite>,
line <em class=”line”>33</em>,
in <code class=”function”>__retry_internal</code></h4>
<div class=”source library”><pre class=”line before”><span class=”ws”> </span>:returns: the result of the f function.</pre>
<pre class=”line before”><span class=”ws”> </span>"""</pre>
<pre class=”line before”><span class=”ws”> </span>_tries, _delay = tries, delay</pre>
<pre class=”line before”><span class=”ws”> </span>while _tries:</pre>
<pre class=”line before”><span class=”ws”> </span>try:</pre>
<pre class=”line current”><span class=”ws”> </span>return f()</pre>
<pre class=”line after”><span class=”ws”> </span>except exceptions as e:</pre>
<pre class=”line after”><span class=”ws”> </span>_tries -= 1</pre>
<pre class=”line after”><span class=”ws”> </span>if not _tries:</pre>
<pre class=”line after”><span class=”ws”> </span>raise</pre>
<pre class=”line after”><span class=”ws”></span> </pre></div>
</div><li><div class=”frame” id=”frame-2552849925504″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\model_server.py”</cite>,
line <em class=”line”>329</em>,
in <code class=”function”>get_new_content</code></h4>
<div class=”source “><pre class=”line before”><span class=”ws”></span>@retry(exceptions=ConnectionError,tries=tries,delay=1)</pre>
<pre class=”line before”><span class=”ws”></span>def get_new_content(engine_type,need_summary,need_keywords,init_content):</pre>
<pre class=”line before”><span class=”ws”> </span>if engine_type == RewriteEnum.EngineType.WENXINYIYAN:</pre>
<pre class=”line before”><span class=”ws”> </span>new_content = get_wp_post_wx_continue(need_summary,need_keywords ,init_content)</pre>
<pre class=”line before”><span class=”ws”> </span>else:</pre>
<pre class=”line current”><span class=”ws”> </span>new_content = get_new_content_chatglm(init_content)</pre>
<pre class=”line after”><span class=”ws”> </span>return new_content</pre>
<pre class=”line after”><span class=”ws”></span>@retry(exceptions=ConnectionError,tries=tries,delay=1)</pre>
<pre class=”line after”><span class=”ws”></span>def get_new_content_chatglm(content):</pre>
<pre class=”line after”><span class=”ws”> </span>payload = {</pre>
<pre class=”line after”><span class=”ws”> </span>"model": "chatglm3-6b",</pre></div>
</div><li><div class=”frame” id=”frame-2552849925728″>
<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-2552849925840″>
<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-2552849925952″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\retry\api.py”</cite>,
line <em class=”line”>33</em>,
in <code class=”function”>__retry_internal</code></h4>
<div class=”source library”><pre class=”line before”><span class=”ws”> </span>:returns: the result of the f function.</pre>
<pre class=”line before”><span class=”ws”> </span>"""</pre>
<pre class=”line before”><span class=”ws”> </span>_tries, _delay = tries, delay</pre>
<pre class=”line before”><span class=”ws”> </span>while _tries:</pre>
<pre class=”line before”><span class=”ws”> </span>try:</pre>
<pre class=”line current”><span class=”ws”> </span>return f()</pre>
<pre class=”line after”><span class=”ws”> </span>except exceptions as e:</pre>
<pre class=”line after”><span class=”ws”> </span>_tries -= 1</pre>
<pre class=”line after”><span class=”ws”> </span>if not _tries:</pre>
<pre class=”line after”><span class=”ws”> </span>raise</pre>
<pre class=”line after”><span class=”ws”></span> </pre></div>
</div><li><div class=”frame” id=”frame-2552849926064″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\model_server.py”</cite>,
line <em class=”line”>357</em>,
in <code class=”function”>get_new_content_chatglm</code></h4>
<div class=”source “><pre class=”line before”><span class=”ws”> </span>}</pre>
<pre class=”line before”><span class=”ws”> </span>headers = {"content-type": "application/json"}</pre>
<pre class=”line before”><span class=”ws”> </span>task_start_time = time.time()</pre>
<pre class=”line before”><span class=”ws”> </span>response = requests.request("POST", chatglm_url, json=payload, headers=headers)</pre>
<pre class=”line before”><span class=”ws”> </span>#print(response)</pre>
<pre class=”line current”><span class=”ws”> </span>data = response.json()</pre>
<pre class=”line after”><span class=”ws”> </span>print(json.dumps(data, indent=4))</pre>
<pre class=”line after”><span class=”ws”> </span>new_content = data['choices'][0]['message']['content']</pre>
<pre class=”line after”><span class=”ws”> </span>new_content = new_content.replace("重新改写后:", "").replace("", "")</pre>
<pre class=”line after”><span class=”ws”> </span>new_content = new_content.replace("重新组织后:", "")</pre>
<pre class=”line after”><span class=”ws”> </span>new_content = new_content.replace("\n", "")</pre></div>
</div><li><div class=”frame” id=”frame-2552849926176″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\requests\models.py”</cite>,
line <em class=”line”>975</em>,
in <code class=”function”>json</code></h4>
<div class=”source library”><pre class=”line before”><span class=”ws”> </span>try:</pre>
<pre class=”line before”><span class=”ws”> </span>return complexjson.loads(self.text, **kwargs)</pre>
<pre class=”line before”><span class=”ws”> </span>except JSONDecodeError as e:</pre>
<pre class=”line before”><span class=”ws”> </span># Catch JSON-related errors and raise as requests.JSONDecodeError</pre>
<pre class=”line before”><span class=”ws”> </span># This aliases json.JSONDecodeError and simplejson.JSONDecodeError</pre>
<pre class=”line current”><span class=”ws”> </span>raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)</pre>
<pre class=”line after”><span class=”ws”></span> </pre>
<pre class=”line after”><span class=”ws”> </span>@property</pre>
<pre class=”line after”><span class=”ws”> </span>def links(self):</pre>
<pre class=”line after”><span class=”ws”> </span>"""Returns the parsed header links of the response, if any."""</pre>
<pre class=”line after”><span class=”ws”></span> </pre></div>
</div>
</ul>
<blockquote>requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
</blockquote>
</div><div class=”plain”>
<p>
This is the Copy/Paste friendly version of the traceback.
</p>
<textarea cols=”50″ rows=”10″ name=”code” readonly>Traceback (most recent call last):
File "F:\project\wxgzh\venv\lib\site-packages\requests\models.py", line 971, in json
return complexjson.loads(self.text, **kwargs)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)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 357, in get_new_content_chatglm
data = response.json()
File "F:\project\wxgzh\venv\lib\site-packages\requests\models.py", line 975, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
</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\requests\models.py”, line 971, in json
return complexjson.loads(self.text, **kwargs)
File “C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\__init__.py”, line 346, in loads
return _default_decoder.decode(s)
File “C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\decoder.py”, line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File “C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\decoder.py”, line 355, in raw_decode
raise JSONDecodeError(“Expecting value”, s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)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 357, in get_new_content_chatglm
data = response.json()
File “F:\project\wxgzh\venv\lib\site-packages\requests\models.py”, line 975, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)–>
2. 【CNET员工组建工会,争取编辑独立和AI工具使用】
<!doctype html>
<html lang=en>
<head>
<title>requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
// Werkzeug Debugger</title>
<link rel=”stylesheet” href=”?__debugger__=yes&cmd=resource&f=style.css”>
<link rel=”shortcut icon”
href=”?__debugger__=yes&cmd=resource&f=console.png”>
<script src=”?__debugger__=yes&cmd=resource&f=debugger.js”></script>
<script>
var CONSOLE_MODE = false,
EVALEX = true,
EVALEX_TRUSTED = false,
SECRET = “uImqR9BO9WQOrgY4YnuS”;
</script>
</head>
<body style=”background-color: #fff”>
<div class=”debugger”>
<h1>JSONDecodeError</h1>
<div class=”detail”>
<p class=”errormsg”>requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
</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-2552849997376″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\requests\models.py”</cite>,
line <em class=”line”>971</em>,
in <code class=”function”>json</code></h4>
<div class=”source library”><pre class=”line before”><span class=”ws”> </span>pass</pre>
<pre class=”line before”><span class=”ws”> </span>except JSONDecodeError as e:</pre>
<pre class=”line before”><span class=”ws”> </span>raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)</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>return complexjson.loads(self.text, **kwargs)</pre>
<pre class=”line after”><span class=”ws”> </span>except JSONDecodeError as e:</pre>
<pre class=”line after”><span class=”ws”> </span># Catch JSON-related errors and raise as requests.JSONDecodeError</pre>
<pre class=”line after”><span class=”ws”> </span># This aliases json.JSONDecodeError and simplejson.JSONDecodeError</pre>
<pre class=”line after”><span class=”ws”> </span>raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)</pre>
<pre class=”line after”><span class=”ws”></span> </pre></div>
</div><li><div class=”frame” id=”frame-2552849997488″>
<h4>File <cite class=”filename”>”C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\__init__.py”</cite>,
line <em class=”line”>346</em>,
in <code class=”function”>loads</code></h4>
<div class=”source “><pre class=”line before”><span class=”ws”> </span>s = s.decode(detect_encoding(s), 'surrogatepass')</pre>
<pre class=”line before”><span class=”ws”></span> </pre>
<pre class=”line before”><span class=”ws”> </span>if (cls is None and object_hook is None and</pre>
<pre class=”line before”><span class=”ws”> </span>parse_int is None and parse_float is None and</pre>
<pre class=”line before”><span class=”ws”> </span>parse_constant is None and object_pairs_hook is None and not kw):</pre>
<pre class=”line current”><span class=”ws”> </span>return _default_decoder.decode(s)</pre>
<pre class=”line after”><span class=”ws”> </span>if cls is None:</pre>
<pre class=”line after”><span class=”ws”> </span>cls = JSONDecoder</pre>
<pre class=”line after”><span class=”ws”> </span>if object_hook is not None:</pre>
<pre class=”line after”><span class=”ws”> </span>kw['object_hook'] = object_hook</pre>
<pre class=”line after”><span class=”ws”> </span>if object_pairs_hook is not None:</pre></div>
</div><li><div class=”frame” id=”frame-2552849997600″>
<h4>File <cite class=”filename”>”C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\decoder.py”</cite>,
line <em class=”line”>337</em>,
in <code class=”function”>decode</code></h4>
<div class=”source “><pre class=”line before”><span class=”ws”> </span>def decode(self, s, _w=WHITESPACE.match):</pre>
<pre class=”line before”><span class=”ws”> </span>"""Return the Python representation of “s“ (a “str“ instance</pre>
<pre class=”line before”><span class=”ws”> </span>containing a JSON document).</pre>
<pre class=”line before”><span class=”ws”></span> </pre>
<pre class=”line before”><span class=”ws”> </span>"""</pre>
<pre class=”line current”><span class=”ws”> </span>obj, end = self.raw_decode(s, idx=_w(s, 0).end())</pre>
<pre class=”line after”><span class=”ws”> </span>end = _w(s, end).end()</pre>
<pre class=”line after”><span class=”ws”> </span>if end != len(s):</pre>
<pre class=”line after”><span class=”ws”> </span>raise JSONDecodeError("Extra data", s, end)</pre>
<pre class=”line after”><span class=”ws”> </span>return obj</pre>
<pre class=”line after”><span class=”ws”></span> </pre></div>
</div><li><div class=”frame” id=”frame-2552850047040″>
<h4>File <cite class=”filename”>”C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\decoder.py”</cite>,
line <em class=”line”>355</em>,
in <code class=”function”>raw_decode</code></h4>
<div class=”source “><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>try:</pre>
<pre class=”line before”><span class=”ws”> </span>obj, end = self.scan_once(s, idx)</pre>
<pre class=”line before”><span class=”ws”> </span>except StopIteration as err:</pre>
<pre class=”line current”><span class=”ws”> </span>raise JSONDecodeError("Expecting value", s, err.value) from None</pre>
<pre class=”line after”><span class=”ws”> </span>return obj, end</pre></div>
</div><li><div class=”exc-divider”>During handling of the above exception, another exception occurred:</div>
<li><div class=”frame” id=”frame-2552849995472″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\flask\app.py”</cite>,
line <em class=”line”>1478</em>,
in <code class=”function”>__call__</code></h4>
<div class=”source library”><pre class=”line before”><span class=”ws”> </span>def __call__(self, environ: dict, start_response: t.Callable) -> t.Any:</pre>
<pre class=”line before”><span class=”ws”> </span>"""The WSGI server calls the Flask application object as the</pre>
<pre class=”line before”><span class=”ws”> </span>WSGI application. This calls :meth:`wsgi_app`, which can be</pre>
<pre class=”line before”><span class=”ws”> </span>wrapped to apply middleware.</pre>
<pre class=”line before”><span class=”ws”> </span>"""</pre>
<pre class=”line current”><span class=”ws”> </span>return self.wsgi_app(environ, start_response)</pre></div>
</div><li><div class=”frame” id=”frame-2552849995584″>
<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-2552849995248″>
<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-2552849995696″>
<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-2552849995808″>
<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-2552849995920″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\flask\app.py”</cite>,
line <em class=”line”>852</em>,
in <code class=”function”>dispatch_request</code></h4>
<div class=”source library”><pre class=”line before”><span class=”ws”> </span>and req.method == "OPTIONS"</pre>
<pre class=”line before”><span class=”ws”> </span>):</pre>
<pre class=”line before”><span class=”ws”> </span>return self.make_default_options_response()</pre>
<pre class=”line before”><span class=”ws”> </span># otherwise dispatch to the handler for that endpoint</pre>
<pre class=”line before”><span class=”ws”> </span>view_args: dict[str, t.Any] = req.view_args # type: ignore[assignment]</pre>
<pre class=”line current”><span class=”ws”> </span>return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)</pre>
<pre class=”line after”><span class=”ws”></span> </pre>
<pre class=”line after”><span class=”ws”> </span>def full_dispatch_request(self) -> Response:</pre>
<pre class=”line after”><span class=”ws”> </span>"""Dispatches the request and on top of that performs request</pre>
<pre class=”line after”><span class=”ws”> </span>pre and postprocessing as well as HTTP exception catching and</pre>
<pre class=”line after”><span class=”ws”> </span>error handling.</pre></div>
</div><li><div class=”frame” id=”frame-2552849996032″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\model_server.py”</cite>,
line <em class=”line”>322</em>,
in <code class=”function”>get_new_content_api</code></h4>
<div class=”source “><pre class=”line before”><span class=”ws”></span>def get_new_content_api():</pre>
<pre class=”line before”><span class=”ws”> </span>content = request.args.get('content')</pre>
<pre class=”line before”><span class=”ws”> </span>engine_type = request.args.get('engine_type')</pre>
<pre class=”line before”><span class=”ws”> </span>need_summary = request.args.get('need_summary')</pre>
<pre class=”line before”><span class=”ws”> </span>need_keywords = request.args.get('need_keywords')</pre>
<pre class=”line current”><span class=”ws”> </span>new_content = get_new_content(engine_type,need_summary,need_keywords,content) # 传递 len 参数,使用 30 作为长度</pre>
<pre class=”line after”><span class=”ws”> </span>return new_content</pre>
<pre class=”line after”><span class=”ws”></span>@retry(exceptions=ConnectionError,tries=tries,delay=1)</pre>
<pre class=”line after”><span class=”ws”></span>def get_new_content(engine_type,need_summary,need_keywords,init_content):</pre>
<pre class=”line after”><span class=”ws”> </span>if engine_type == RewriteEnum.EngineType.WENXINYIYAN:</pre>
<pre class=”line after”><span class=”ws”> </span>new_content = get_wp_post_wx_continue(need_summary,need_keywords ,init_content)</pre></div>
</div><li><div class=”frame” id=”frame-2552849996144″>
<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-2552849996256″>
<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-2552849996368″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\retry\api.py”</cite>,
line <em class=”line”>33</em>,
in <code class=”function”>__retry_internal</code></h4>
<div class=”source library”><pre class=”line before”><span class=”ws”> </span>:returns: the result of the f function.</pre>
<pre class=”line before”><span class=”ws”> </span>"""</pre>
<pre class=”line before”><span class=”ws”> </span>_tries, _delay = tries, delay</pre>
<pre class=”line before”><span class=”ws”> </span>while _tries:</pre>
<pre class=”line before”><span class=”ws”> </span>try:</pre>
<pre class=”line current”><span class=”ws”> </span>return f()</pre>
<pre class=”line after”><span class=”ws”> </span>except exceptions as e:</pre>
<pre class=”line after”><span class=”ws”> </span>_tries -= 1</pre>
<pre class=”line after”><span class=”ws”> </span>if not _tries:</pre>
<pre class=”line after”><span class=”ws”> </span>raise</pre>
<pre class=”line after”><span class=”ws”></span> </pre></div>
</div><li><div class=”frame” id=”frame-2552849996480″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\model_server.py”</cite>,
line <em class=”line”>329</em>,
in <code class=”function”>get_new_content</code></h4>
<div class=”source “><pre class=”line before”><span class=”ws”></span>@retry(exceptions=ConnectionError,tries=tries,delay=1)</pre>
<pre class=”line before”><span class=”ws”></span>def get_new_content(engine_type,need_summary,need_keywords,init_content):</pre>
<pre class=”line before”><span class=”ws”> </span>if engine_type == RewriteEnum.EngineType.WENXINYIYAN:</pre>
<pre class=”line before”><span class=”ws”> </span>new_content = get_wp_post_wx_continue(need_summary,need_keywords ,init_content)</pre>
<pre class=”line before”><span class=”ws”> </span>else:</pre>
<pre class=”line current”><span class=”ws”> </span>new_content = get_new_content_chatglm(init_content)</pre>
<pre class=”line after”><span class=”ws”> </span>return new_content</pre>
<pre class=”line after”><span class=”ws”></span>@retry(exceptions=ConnectionError,tries=tries,delay=1)</pre>
<pre class=”line after”><span class=”ws”></span>def get_new_content_chatglm(content):</pre>
<pre class=”line after”><span class=”ws”> </span>payload = {</pre>
<pre class=”line after”><span class=”ws”> </span>"model": "chatglm3-6b",</pre></div>
</div><li><div class=”frame” id=”frame-2552849996704″>
<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-2552849996816″>
<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-2552849996928″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\retry\api.py”</cite>,
line <em class=”line”>33</em>,
in <code class=”function”>__retry_internal</code></h4>
<div class=”source library”><pre class=”line before”><span class=”ws”> </span>:returns: the result of the f function.</pre>
<pre class=”line before”><span class=”ws”> </span>"""</pre>
<pre class=”line before”><span class=”ws”> </span>_tries, _delay = tries, delay</pre>
<pre class=”line before”><span class=”ws”> </span>while _tries:</pre>
<pre class=”line before”><span class=”ws”> </span>try:</pre>
<pre class=”line current”><span class=”ws”> </span>return f()</pre>
<pre class=”line after”><span class=”ws”> </span>except exceptions as e:</pre>
<pre class=”line after”><span class=”ws”> </span>_tries -= 1</pre>
<pre class=”line after”><span class=”ws”> </span>if not _tries:</pre>
<pre class=”line after”><span class=”ws”> </span>raise</pre>
<pre class=”line after”><span class=”ws”></span> </pre></div>
</div><li><div class=”frame” id=”frame-2552849997040″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\model_server.py”</cite>,
line <em class=”line”>357</em>,
in <code class=”function”>get_new_content_chatglm</code></h4>
<div class=”source “><pre class=”line before”><span class=”ws”> </span>}</pre>
<pre class=”line before”><span class=”ws”> </span>headers = {"content-type": "application/json"}</pre>
<pre class=”line before”><span class=”ws”> </span>task_start_time = time.time()</pre>
<pre class=”line before”><span class=”ws”> </span>response = requests.request("POST", chatglm_url, json=payload, headers=headers)</pre>
<pre class=”line before”><span class=”ws”> </span>#print(response)</pre>
<pre class=”line current”><span class=”ws”> </span>data = response.json()</pre>
<pre class=”line after”><span class=”ws”> </span>print(json.dumps(data, indent=4))</pre>
<pre class=”line after”><span class=”ws”> </span>new_content = data['choices'][0]['message']['content']</pre>
<pre class=”line after”><span class=”ws”> </span>new_content = new_content.replace("重新改写后:", "").replace("", "")</pre>
<pre class=”line after”><span class=”ws”> </span>new_content = new_content.replace("重新组织后:", "")</pre>
<pre class=”line after”><span class=”ws”> </span>new_content = new_content.replace("\n", "")</pre></div>
</div><li><div class=”frame” id=”frame-2552849997152″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\requests\models.py”</cite>,
line <em class=”line”>975</em>,
in <code class=”function”>json</code></h4>
<div class=”source library”><pre class=”line before”><span class=”ws”> </span>try:</pre>
<pre class=”line before”><span class=”ws”> </span>return complexjson.loads(self.text, **kwargs)</pre>
<pre class=”line before”><span class=”ws”> </span>except JSONDecodeError as e:</pre>
<pre class=”line before”><span class=”ws”> </span># Catch JSON-related errors and raise as requests.JSONDecodeError</pre>
<pre class=”line before”><span class=”ws”> </span># This aliases json.JSONDecodeError and simplejson.JSONDecodeError</pre>
<pre class=”line current”><span class=”ws”> </span>raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)</pre>
<pre class=”line after”><span class=”ws”></span> </pre>
<pre class=”line after”><span class=”ws”> </span>@property</pre>
<pre class=”line after”><span class=”ws”> </span>def links(self):</pre>
<pre class=”line after”><span class=”ws”> </span>"""Returns the parsed header links of the response, if any."""</pre>
<pre class=”line after”><span class=”ws”></span> </pre></div>
</div>
</ul>
<blockquote>requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
</blockquote>
</div><div class=”plain”>
<p>
This is the Copy/Paste friendly version of the traceback.
</p>
<textarea cols=”50″ rows=”10″ name=”code” readonly>Traceback (most recent call last):
File "F:\project\wxgzh\venv\lib\site-packages\requests\models.py", line 971, in json
return complexjson.loads(self.text, **kwargs)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)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 357, in get_new_content_chatglm
data = response.json()
File "F:\project\wxgzh\venv\lib\site-packages\requests\models.py", line 975, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
</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\requests\models.py”, line 971, in json
return complexjson.loads(self.text, **kwargs)
File “C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\__init__.py”, line 346, in loads
return _default_decoder.decode(s)
File “C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\decoder.py”, line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File “C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\decoder.py”, line 355, in raw_decode
raise JSONDecodeError(“Expecting value”, s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)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 357, in get_new_content_chatglm
data = response.json()
File “F:\project\wxgzh\venv\lib\site-packages\requests\models.py”, line 975, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)–>
3. 【国会讨论AI监管和可能成立的新机构】
<!doctype html>
<html lang=en>
<head>
<title>requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
// Werkzeug Debugger</title>
<link rel=”stylesheet” href=”?__debugger__=yes&cmd=resource&f=style.css”>
<link rel=”shortcut icon”
href=”?__debugger__=yes&cmd=resource&f=console.png”>
<script src=”?__debugger__=yes&cmd=resource&f=debugger.js”></script>
<script>
var CONSOLE_MODE = false,
EVALEX = true,
EVALEX_TRUSTED = false,
SECRET = “uImqR9BO9WQOrgY4YnuS”;
</script>
</head>
<body style=”background-color: #fff”>
<div class=”debugger”>
<h1>JSONDecodeError</h1>
<div class=”detail”>
<p class=”errormsg”>requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
</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-2552850129856″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\requests\models.py”</cite>,
line <em class=”line”>971</em>,
in <code class=”function”>json</code></h4>
<div class=”source library”><pre class=”line before”><span class=”ws”> </span>pass</pre>
<pre class=”line before”><span class=”ws”> </span>except JSONDecodeError as e:</pre>
<pre class=”line before”><span class=”ws”> </span>raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)</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>return complexjson.loads(self.text, **kwargs)</pre>
<pre class=”line after”><span class=”ws”> </span>except JSONDecodeError as e:</pre>
<pre class=”line after”><span class=”ws”> </span># Catch JSON-related errors and raise as requests.JSONDecodeError</pre>
<pre class=”line after”><span class=”ws”> </span># This aliases json.JSONDecodeError and simplejson.JSONDecodeError</pre>
<pre class=”line after”><span class=”ws”> </span>raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)</pre>
<pre class=”line after”><span class=”ws”></span> </pre></div>
</div><li><div class=”frame” id=”frame-2552850129968″>
<h4>File <cite class=”filename”>”C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\__init__.py”</cite>,
line <em class=”line”>346</em>,
in <code class=”function”>loads</code></h4>
<div class=”source “><pre class=”line before”><span class=”ws”> </span>s = s.decode(detect_encoding(s), 'surrogatepass')</pre>
<pre class=”line before”><span class=”ws”></span> </pre>
<pre class=”line before”><span class=”ws”> </span>if (cls is None and object_hook is None and</pre>
<pre class=”line before”><span class=”ws”> </span>parse_int is None and parse_float is None and</pre>
<pre class=”line before”><span class=”ws”> </span>parse_constant is None and object_pairs_hook is None and not kw):</pre>
<pre class=”line current”><span class=”ws”> </span>return _default_decoder.decode(s)</pre>
<pre class=”line after”><span class=”ws”> </span>if cls is None:</pre>
<pre class=”line after”><span class=”ws”> </span>cls = JSONDecoder</pre>
<pre class=”line after”><span class=”ws”> </span>if object_hook is not None:</pre>
<pre class=”line after”><span class=”ws”> </span>kw['object_hook'] = object_hook</pre>
<pre class=”line after”><span class=”ws”> </span>if object_pairs_hook is not None:</pre></div>
</div><li><div class=”frame” id=”frame-2552850130080″>
<h4>File <cite class=”filename”>”C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\decoder.py”</cite>,
line <em class=”line”>337</em>,
in <code class=”function”>decode</code></h4>
<div class=”source “><pre class=”line before”><span class=”ws”> </span>def decode(self, s, _w=WHITESPACE.match):</pre>
<pre class=”line before”><span class=”ws”> </span>"""Return the Python representation of “s“ (a “str“ instance</pre>
<pre class=”line before”><span class=”ws”> </span>containing a JSON document).</pre>
<pre class=”line before”><span class=”ws”></span> </pre>
<pre class=”line before”><span class=”ws”> </span>"""</pre>
<pre class=”line current”><span class=”ws”> </span>obj, end = self.raw_decode(s, idx=_w(s, 0).end())</pre>
<pre class=”line after”><span class=”ws”> </span>end = _w(s, end).end()</pre>
<pre class=”line after”><span class=”ws”> </span>if end != len(s):</pre>
<pre class=”line after”><span class=”ws”> </span>raise JSONDecodeError("Extra data", s, end)</pre>
<pre class=”line after”><span class=”ws”> </span>return obj</pre>
<pre class=”line after”><span class=”ws”></span> </pre></div>
</div><li><div class=”frame” id=”frame-2552850130304″>
<h4>File <cite class=”filename”>”C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\decoder.py”</cite>,
line <em class=”line”>355</em>,
in <code class=”function”>raw_decode</code></h4>
<div class=”source “><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>try:</pre>
<pre class=”line before”><span class=”ws”> </span>obj, end = self.scan_once(s, idx)</pre>
<pre class=”line before”><span class=”ws”> </span>except StopIteration as err:</pre>
<pre class=”line current”><span class=”ws”> </span>raise JSONDecodeError("Expecting value", s, err.value) from None</pre>
<pre class=”line after”><span class=”ws”> </span>return obj, end</pre></div>
</div><li><div class=”exc-divider”>During handling of the above exception, another exception occurred:</div>
<li><div class=”frame” id=”frame-2552850050176″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\flask\app.py”</cite>,
line <em class=”line”>1478</em>,
in <code class=”function”>__call__</code></h4>
<div class=”source library”><pre class=”line before”><span class=”ws”> </span>def __call__(self, environ: dict, start_response: t.Callable) -> t.Any:</pre>
<pre class=”line before”><span class=”ws”> </span>"""The WSGI server calls the Flask application object as the</pre>
<pre class=”line before”><span class=”ws”> </span>WSGI application. This calls :meth:`wsgi_app`, which can be</pre>
<pre class=”line before”><span class=”ws”> </span>wrapped to apply middleware.</pre>
<pre class=”line before”><span class=”ws”> </span>"""</pre>
<pre class=”line current”><span class=”ws”> </span>return self.wsgi_app(environ, start_response)</pre></div>
</div><li><div class=”frame” id=”frame-2552850049840″>
<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-2552850050064″>
<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-2552850050288″>
<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-2552850050400″>
<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-2552850050512″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\flask\app.py”</cite>,
line <em class=”line”>852</em>,
in <code class=”function”>dispatch_request</code></h4>
<div class=”source library”><pre class=”line before”><span class=”ws”> </span>and req.method == "OPTIONS"</pre>
<pre class=”line before”><span class=”ws”> </span>):</pre>
<pre class=”line before”><span class=”ws”> </span>return self.make_default_options_response()</pre>
<pre class=”line before”><span class=”ws”> </span># otherwise dispatch to the handler for that endpoint</pre>
<pre class=”line before”><span class=”ws”> </span>view_args: dict[str, t.Any] = req.view_args # type: ignore[assignment]</pre>
<pre class=”line current”><span class=”ws”> </span>return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)</pre>
<pre class=”line after”><span class=”ws”></span> </pre>
<pre class=”line after”><span class=”ws”> </span>def full_dispatch_request(self) -> Response:</pre>
<pre class=”line after”><span class=”ws”> </span>"""Dispatches the request and on top of that performs request</pre>
<pre class=”line after”><span class=”ws”> </span>pre and postprocessing as well as HTTP exception catching and</pre>
<pre class=”line after”><span class=”ws”> </span>error handling.</pre></div>
</div><li><div class=”frame” id=”frame-2552850050624″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\model_server.py”</cite>,
line <em class=”line”>322</em>,
in <code class=”function”>get_new_content_api</code></h4>
<div class=”source “><pre class=”line before”><span class=”ws”></span>def get_new_content_api():</pre>
<pre class=”line before”><span class=”ws”> </span>content = request.args.get('content')</pre>
<pre class=”line before”><span class=”ws”> </span>engine_type = request.args.get('engine_type')</pre>
<pre class=”line before”><span class=”ws”> </span>need_summary = request.args.get('need_summary')</pre>
<pre class=”line before”><span class=”ws”> </span>need_keywords = request.args.get('need_keywords')</pre>
<pre class=”line current”><span class=”ws”> </span>new_content = get_new_content(engine_type,need_summary,need_keywords,content) # 传递 len 参数,使用 30 作为长度</pre>
<pre class=”line after”><span class=”ws”> </span>return new_content</pre>
<pre class=”line after”><span class=”ws”></span>@retry(exceptions=ConnectionError,tries=tries,delay=1)</pre>
<pre class=”line after”><span class=”ws”></span>def get_new_content(engine_type,need_summary,need_keywords,init_content):</pre>
<pre class=”line after”><span class=”ws”> </span>if engine_type == RewriteEnum.EngineType.WENXINYIYAN:</pre>
<pre class=”line after”><span class=”ws”> </span>new_content = get_wp_post_wx_continue(need_summary,need_keywords ,init_content)</pre></div>
</div><li><div class=”frame” id=”frame-2552850050736″>
<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-2552850050848″>
<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-2552850050960″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\retry\api.py”</cite>,
line <em class=”line”>33</em>,
in <code class=”function”>__retry_internal</code></h4>
<div class=”source library”><pre class=”line before”><span class=”ws”> </span>:returns: the result of the f function.</pre>
<pre class=”line before”><span class=”ws”> </span>"""</pre>
<pre class=”line before”><span class=”ws”> </span>_tries, _delay = tries, delay</pre>
<pre class=”line before”><span class=”ws”> </span>while _tries:</pre>
<pre class=”line before”><span class=”ws”> </span>try:</pre>
<pre class=”line current”><span class=”ws”> </span>return f()</pre>
<pre class=”line after”><span class=”ws”> </span>except exceptions as e:</pre>
<pre class=”line after”><span class=”ws”> </span>_tries -= 1</pre>
<pre class=”line after”><span class=”ws”> </span>if not _tries:</pre>
<pre class=”line after”><span class=”ws”> </span>raise</pre>
<pre class=”line after”><span class=”ws”></span> </pre></div>
</div><li><div class=”frame” id=”frame-2552850128960″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\model_server.py”</cite>,
line <em class=”line”>329</em>,
in <code class=”function”>get_new_content</code></h4>
<div class=”source “><pre class=”line before”><span class=”ws”></span>@retry(exceptions=ConnectionError,tries=tries,delay=1)</pre>
<pre class=”line before”><span class=”ws”></span>def get_new_content(engine_type,need_summary,need_keywords,init_content):</pre>
<pre class=”line before”><span class=”ws”> </span>if engine_type == RewriteEnum.EngineType.WENXINYIYAN:</pre>
<pre class=”line before”><span class=”ws”> </span>new_content = get_wp_post_wx_continue(need_summary,need_keywords ,init_content)</pre>
<pre class=”line before”><span class=”ws”> </span>else:</pre>
<pre class=”line current”><span class=”ws”> </span>new_content = get_new_content_chatglm(init_content)</pre>
<pre class=”line after”><span class=”ws”> </span>return new_content</pre>
<pre class=”line after”><span class=”ws”></span>@retry(exceptions=ConnectionError,tries=tries,delay=1)</pre>
<pre class=”line after”><span class=”ws”></span>def get_new_content_chatglm(content):</pre>
<pre class=”line after”><span class=”ws”> </span>payload = {</pre>
<pre class=”line after”><span class=”ws”> </span>"model": "chatglm3-6b",</pre></div>
</div><li><div class=”frame” id=”frame-2552850129184″>
<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-2552850129296″>
<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-2552850129408″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\retry\api.py”</cite>,
line <em class=”line”>33</em>,
in <code class=”function”>__retry_internal</code></h4>
<div class=”source library”><pre class=”line before”><span class=”ws”> </span>:returns: the result of the f function.</pre>
<pre class=”line before”><span class=”ws”> </span>"""</pre>
<pre class=”line before”><span class=”ws”> </span>_tries, _delay = tries, delay</pre>
<pre class=”line before”><span class=”ws”> </span>while _tries:</pre>
<pre class=”line before”><span class=”ws”> </span>try:</pre>
<pre class=”line current”><span class=”ws”> </span>return f()</pre>
<pre class=”line after”><span class=”ws”> </span>except exceptions as e:</pre>
<pre class=”line after”><span class=”ws”> </span>_tries -= 1</pre>
<pre class=”line after”><span class=”ws”> </span>if not _tries:</pre>
<pre class=”line after”><span class=”ws”> </span>raise</pre>
<pre class=”line after”><span class=”ws”></span> </pre></div>
</div><li><div class=”frame” id=”frame-2552850129520″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\model_server.py”</cite>,
line <em class=”line”>357</em>,
in <code class=”function”>get_new_content_chatglm</code></h4>
<div class=”source “><pre class=”line before”><span class=”ws”> </span>}</pre>
<pre class=”line before”><span class=”ws”> </span>headers = {"content-type": "application/json"}</pre>
<pre class=”line before”><span class=”ws”> </span>task_start_time = time.time()</pre>
<pre class=”line before”><span class=”ws”> </span>response = requests.request("POST", chatglm_url, json=payload, headers=headers)</pre>
<pre class=”line before”><span class=”ws”> </span>#print(response)</pre>
<pre class=”line current”><span class=”ws”> </span>data = response.json()</pre>
<pre class=”line after”><span class=”ws”> </span>print(json.dumps(data, indent=4))</pre>
<pre class=”line after”><span class=”ws”> </span>new_content = data['choices'][0]['message']['content']</pre>
<pre class=”line after”><span class=”ws”> </span>new_content = new_content.replace("重新改写后:", "").replace("", "")</pre>
<pre class=”line after”><span class=”ws”> </span>new_content = new_content.replace("重新组织后:", "")</pre>
<pre class=”line after”><span class=”ws”> </span>new_content = new_content.replace("\n", "")</pre></div>
</div><li><div class=”frame” id=”frame-2552850129632″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\requests\models.py”</cite>,
line <em class=”line”>975</em>,
in <code class=”function”>json</code></h4>
<div class=”source library”><pre class=”line before”><span class=”ws”> </span>try:</pre>
<pre class=”line before”><span class=”ws”> </span>return complexjson.loads(self.text, **kwargs)</pre>
<pre class=”line before”><span class=”ws”> </span>except JSONDecodeError as e:</pre>
<pre class=”line before”><span class=”ws”> </span># Catch JSON-related errors and raise as requests.JSONDecodeError</pre>
<pre class=”line before”><span class=”ws”> </span># This aliases json.JSONDecodeError and simplejson.JSONDecodeError</pre>
<pre class=”line current”><span class=”ws”> </span>raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)</pre>
<pre class=”line after”><span class=”ws”></span> </pre>
<pre class=”line after”><span class=”ws”> </span>@property</pre>
<pre class=”line after”><span class=”ws”> </span>def links(self):</pre>
<pre class=”line after”><span class=”ws”> </span>"""Returns the parsed header links of the response, if any."""</pre>
<pre class=”line after”><span class=”ws”></span> </pre></div>
</div>
</ul>
<blockquote>requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
</blockquote>
</div><div class=”plain”>
<p>
This is the Copy/Paste friendly version of the traceback.
</p>
<textarea cols=”50″ rows=”10″ name=”code” readonly>Traceback (most recent call last):
File "F:\project\wxgzh\venv\lib\site-packages\requests\models.py", line 971, in json
return complexjson.loads(self.text, **kwargs)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)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 357, in get_new_content_chatglm
data = response.json()
File "F:\project\wxgzh\venv\lib\site-packages\requests\models.py", line 975, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
</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\requests\models.py”, line 971, in json
return complexjson.loads(self.text, **kwargs)
File “C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\__init__.py”, line 346, in loads
return _default_decoder.decode(s)
File “C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\decoder.py”, line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File “C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\decoder.py”, line 355, in raw_decode
raise JSONDecodeError(“Expecting value”, s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)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 357, in get_new_content_chatglm
data = response.json()
File “F:\project\wxgzh\venv\lib\site-packages\requests\models.py”, line 975, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)–>
4.【OpenAI CEO支持成立AI监管机构】
<!doctype html>
<html lang=en>
<head>
<title>requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
// Werkzeug Debugger</title>
<link rel=”stylesheet” href=”?__debugger__=yes&cmd=resource&f=style.css”>
<link rel=”shortcut icon”
href=”?__debugger__=yes&cmd=resource&f=console.png”>
<script src=”?__debugger__=yes&cmd=resource&f=debugger.js”></script>
<script>
var CONSOLE_MODE = false,
EVALEX = true,
EVALEX_TRUSTED = false,
SECRET = “uImqR9BO9WQOrgY4YnuS”;
</script>
</head>
<body style=”background-color: #fff”>
<div class=”debugger”>
<h1>JSONDecodeError</h1>
<div class=”detail”>
<p class=”errormsg”>requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
</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-2552850184448″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\requests\models.py”</cite>,
line <em class=”line”>971</em>,
in <code class=”function”>json</code></h4>
<div class=”source library”><pre class=”line before”><span class=”ws”> </span>pass</pre>
<pre class=”line before”><span class=”ws”> </span>except JSONDecodeError as e:</pre>
<pre class=”line before”><span class=”ws”> </span>raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)</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>return complexjson.loads(self.text, **kwargs)</pre>
<pre class=”line after”><span class=”ws”> </span>except JSONDecodeError as e:</pre>
<pre class=”line after”><span class=”ws”> </span># Catch JSON-related errors and raise as requests.JSONDecodeError</pre>
<pre class=”line after”><span class=”ws”> </span># This aliases json.JSONDecodeError and simplejson.JSONDecodeError</pre>
<pre class=”line after”><span class=”ws”> </span>raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)</pre>
<pre class=”line after”><span class=”ws”></span> </pre></div>
</div><li><div class=”frame” id=”frame-2552850184560″>
<h4>File <cite class=”filename”>”C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\__init__.py”</cite>,
line <em class=”line”>346</em>,
in <code class=”function”>loads</code></h4>
<div class=”source “><pre class=”line before”><span class=”ws”> </span>s = s.decode(detect_encoding(s), 'surrogatepass')</pre>
<pre class=”line before”><span class=”ws”></span> </pre>
<pre class=”line before”><span class=”ws”> </span>if (cls is None and object_hook is None and</pre>
<pre class=”line before”><span class=”ws”> </span>parse_int is None and parse_float is None and</pre>
<pre class=”line before”><span class=”ws”> </span>parse_constant is None and object_pairs_hook is None and not kw):</pre>
<pre class=”line current”><span class=”ws”> </span>return _default_decoder.decode(s)</pre>
<pre class=”line after”><span class=”ws”> </span>if cls is None:</pre>
<pre class=”line after”><span class=”ws”> </span>cls = JSONDecoder</pre>
<pre class=”line after”><span class=”ws”> </span>if object_hook is not None:</pre>
<pre class=”line after”><span class=”ws”> </span>kw['object_hook'] = object_hook</pre>
<pre class=”line after”><span class=”ws”> </span>if object_pairs_hook is not None:</pre></div>
</div><li><div class=”frame” id=”frame-2552850184672″>
<h4>File <cite class=”filename”>”C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\decoder.py”</cite>,
line <em class=”line”>337</em>,
in <code class=”function”>decode</code></h4>
<div class=”source “><pre class=”line before”><span class=”ws”> </span>def decode(self, s, _w=WHITESPACE.match):</pre>
<pre class=”line before”><span class=”ws”> </span>"""Return the Python representation of “s“ (a “str“ instance</pre>
<pre class=”line before”><span class=”ws”> </span>containing a JSON document).</pre>
<pre class=”line before”><span class=”ws”></span> </pre>
<pre class=”line before”><span class=”ws”> </span>"""</pre>
<pre class=”line current”><span class=”ws”> </span>obj, end = self.raw_decode(s, idx=_w(s, 0).end())</pre>
<pre class=”line after”><span class=”ws”> </span>end = _w(s, end).end()</pre>
<pre class=”line after”><span class=”ws”> </span>if end != len(s):</pre>
<pre class=”line after”><span class=”ws”> </span>raise JSONDecodeError("Extra data", s, end)</pre>
<pre class=”line after”><span class=”ws”> </span>return obj</pre>
<pre class=”line after”><span class=”ws”></span> </pre></div>
</div><li><div class=”frame” id=”frame-2552850184896″>
<h4>File <cite class=”filename”>”C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\decoder.py”</cite>,
line <em class=”line”>355</em>,
in <code class=”function”>raw_decode</code></h4>
<div class=”source “><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>try:</pre>
<pre class=”line before”><span class=”ws”> </span>obj, end = self.scan_once(s, idx)</pre>
<pre class=”line before”><span class=”ws”> </span>except StopIteration as err:</pre>
<pre class=”line current”><span class=”ws”> </span>raise JSONDecodeError("Expecting value", s, err.value) from None</pre>
<pre class=”line after”><span class=”ws”> </span>return obj, end</pre></div>
</div><li><div class=”exc-divider”>During handling of the above exception, another exception occurred:</div>
<li><div class=”frame” id=”frame-2552850182544″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\flask\app.py”</cite>,
line <em class=”line”>1478</em>,
in <code class=”function”>__call__</code></h4>
<div class=”source library”><pre class=”line before”><span class=”ws”> </span>def __call__(self, environ: dict, start_response: t.Callable) -> t.Any:</pre>
<pre class=”line before”><span class=”ws”> </span>"""The WSGI server calls the Flask application object as the</pre>
<pre class=”line before”><span class=”ws”> </span>WSGI application. This calls :meth:`wsgi_app`, which can be</pre>
<pre class=”line before”><span class=”ws”> </span>wrapped to apply middleware.</pre>
<pre class=”line before”><span class=”ws”> </span>"""</pre>
<pre class=”line current”><span class=”ws”> </span>return self.wsgi_app(environ, start_response)</pre></div>
</div><li><div class=”frame” id=”frame-2552850182656″>
<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-2552850182320″>
<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-2552850182768″>
<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-2552850182880″>
<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-2552850182992″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\flask\app.py”</cite>,
line <em class=”line”>852</em>,
in <code class=”function”>dispatch_request</code></h4>
<div class=”source library”><pre class=”line before”><span class=”ws”> </span>and req.method == "OPTIONS"</pre>
<pre class=”line before”><span class=”ws”> </span>):</pre>
<pre class=”line before”><span class=”ws”> </span>return self.make_default_options_response()</pre>
<pre class=”line before”><span class=”ws”> </span># otherwise dispatch to the handler for that endpoint</pre>
<pre class=”line before”><span class=”ws”> </span>view_args: dict[str, t.Any] = req.view_args # type: ignore[assignment]</pre>
<pre class=”line current”><span class=”ws”> </span>return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)</pre>
<pre class=”line after”><span class=”ws”></span> </pre>
<pre class=”line after”><span class=”ws”> </span>def full_dispatch_request(self) -> Response:</pre>
<pre class=”line after”><span class=”ws”> </span>"""Dispatches the request and on top of that performs request</pre>
<pre class=”line after”><span class=”ws”> </span>pre and postprocessing as well as HTTP exception catching and</pre>
<pre class=”line after”><span class=”ws”> </span>error handling.</pre></div>
</div><li><div class=”frame” id=”frame-2552850183104″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\model_server.py”</cite>,
line <em class=”line”>322</em>,
in <code class=”function”>get_new_content_api</code></h4>
<div class=”source “><pre class=”line before”><span class=”ws”></span>def get_new_content_api():</pre>
<pre class=”line before”><span class=”ws”> </span>content = request.args.get('content')</pre>
<pre class=”line before”><span class=”ws”> </span>engine_type = request.args.get('engine_type')</pre>
<pre class=”line before”><span class=”ws”> </span>need_summary = request.args.get('need_summary')</pre>
<pre class=”line before”><span class=”ws”> </span>need_keywords = request.args.get('need_keywords')</pre>
<pre class=”line current”><span class=”ws”> </span>new_content = get_new_content(engine_type,need_summary,need_keywords,content) # 传递 len 参数,使用 30 作为长度</pre>
<pre class=”line after”><span class=”ws”> </span>return new_content</pre>
<pre class=”line after”><span class=”ws”></span>@retry(exceptions=ConnectionError,tries=tries,delay=1)</pre>
<pre class=”line after”><span class=”ws”></span>def get_new_content(engine_type,need_summary,need_keywords,init_content):</pre>
<pre class=”line after”><span class=”ws”> </span>if engine_type == RewriteEnum.EngineType.WENXINYIYAN:</pre>
<pre class=”line after”><span class=”ws”> </span>new_content = get_wp_post_wx_continue(need_summary,need_keywords ,init_content)</pre></div>
</div><li><div class=”frame” id=”frame-2552850183216″>
<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-2552850183328″>
<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-2552850183440″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\retry\api.py”</cite>,
line <em class=”line”>33</em>,
in <code class=”function”>__retry_internal</code></h4>
<div class=”source library”><pre class=”line before”><span class=”ws”> </span>:returns: the result of the f function.</pre>
<pre class=”line before”><span class=”ws”> </span>"""</pre>
<pre class=”line before”><span class=”ws”> </span>_tries, _delay = tries, delay</pre>
<pre class=”line before”><span class=”ws”> </span>while _tries:</pre>
<pre class=”line before”><span class=”ws”> </span>try:</pre>
<pre class=”line current”><span class=”ws”> </span>return f()</pre>
<pre class=”line after”><span class=”ws”> </span>except exceptions as e:</pre>
<pre class=”line after”><span class=”ws”> </span>_tries -= 1</pre>
<pre class=”line after”><span class=”ws”> </span>if not _tries:</pre>
<pre class=”line after”><span class=”ws”> </span>raise</pre>
<pre class=”line after”><span class=”ws”></span> </pre></div>
</div><li><div class=”frame” id=”frame-2552850183552″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\model_server.py”</cite>,
line <em class=”line”>329</em>,
in <code class=”function”>get_new_content</code></h4>
<div class=”source “><pre class=”line before”><span class=”ws”></span>@retry(exceptions=ConnectionError,tries=tries,delay=1)</pre>
<pre class=”line before”><span class=”ws”></span>def get_new_content(engine_type,need_summary,need_keywords,init_content):</pre>
<pre class=”line before”><span class=”ws”> </span>if engine_type == RewriteEnum.EngineType.WENXINYIYAN:</pre>
<pre class=”line before”><span class=”ws”> </span>new_content = get_wp_post_wx_continue(need_summary,need_keywords ,init_content)</pre>
<pre class=”line before”><span class=”ws”> </span>else:</pre>
<pre class=”line current”><span class=”ws”> </span>new_content = get_new_content_chatglm(init_content)</pre>
<pre class=”line after”><span class=”ws”> </span>return new_content</pre>
<pre class=”line after”><span class=”ws”></span>@retry(exceptions=ConnectionError,tries=tries,delay=1)</pre>
<pre class=”line after”><span class=”ws”></span>def get_new_content_chatglm(content):</pre>
<pre class=”line after”><span class=”ws”> </span>payload = {</pre>
<pre class=”line after”><span class=”ws”> </span>"model": "chatglm3-6b",</pre></div>
</div><li><div class=”frame” id=”frame-2552850183776″>
<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-2552850183888″>
<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-2552850184000″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\retry\api.py”</cite>,
line <em class=”line”>33</em>,
in <code class=”function”>__retry_internal</code></h4>
<div class=”source library”><pre class=”line before”><span class=”ws”> </span>:returns: the result of the f function.</pre>
<pre class=”line before”><span class=”ws”> </span>"""</pre>
<pre class=”line before”><span class=”ws”> </span>_tries, _delay = tries, delay</pre>
<pre class=”line before”><span class=”ws”> </span>while _tries:</pre>
<pre class=”line before”><span class=”ws”> </span>try:</pre>
<pre class=”line current”><span class=”ws”> </span>return f()</pre>
<pre class=”line after”><span class=”ws”> </span>except exceptions as e:</pre>
<pre class=”line after”><span class=”ws”> </span>_tries -= 1</pre>
<pre class=”line after”><span class=”ws”> </span>if not _tries:</pre>
<pre class=”line after”><span class=”ws”> </span>raise</pre>
<pre class=”line after”><span class=”ws”></span> </pre></div>
</div><li><div class=”frame” id=”frame-2552850184112″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\model_server.py”</cite>,
line <em class=”line”>357</em>,
in <code class=”function”>get_new_content_chatglm</code></h4>
<div class=”source “><pre class=”line before”><span class=”ws”> </span>}</pre>
<pre class=”line before”><span class=”ws”> </span>headers = {"content-type": "application/json"}</pre>
<pre class=”line before”><span class=”ws”> </span>task_start_time = time.time()</pre>
<pre class=”line before”><span class=”ws”> </span>response = requests.request("POST", chatglm_url, json=payload, headers=headers)</pre>
<pre class=”line before”><span class=”ws”> </span>#print(response)</pre>
<pre class=”line current”><span class=”ws”> </span>data = response.json()</pre>
<pre class=”line after”><span class=”ws”> </span>print(json.dumps(data, indent=4))</pre>
<pre class=”line after”><span class=”ws”> </span>new_content = data['choices'][0]['message']['content']</pre>
<pre class=”line after”><span class=”ws”> </span>new_content = new_content.replace("重新改写后:", "").replace("", "")</pre>
<pre class=”line after”><span class=”ws”> </span>new_content = new_content.replace("重新组织后:", "")</pre>
<pre class=”line after”><span class=”ws”> </span>new_content = new_content.replace("\n", "")</pre></div>
</div><li><div class=”frame” id=”frame-2552850184224″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\requests\models.py”</cite>,
line <em class=”line”>975</em>,
in <code class=”function”>json</code></h4>
<div class=”source library”><pre class=”line before”><span class=”ws”> </span>try:</pre>
<pre class=”line before”><span class=”ws”> </span>return complexjson.loads(self.text, **kwargs)</pre>
<pre class=”line before”><span class=”ws”> </span>except JSONDecodeError as e:</pre>
<pre class=”line before”><span class=”ws”> </span># Catch JSON-related errors and raise as requests.JSONDecodeError</pre>
<pre class=”line before”><span class=”ws”> </span># This aliases json.JSONDecodeError and simplejson.JSONDecodeError</pre>
<pre class=”line current”><span class=”ws”> </span>raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)</pre>
<pre class=”line after”><span class=”ws”></span> </pre>
<pre class=”line after”><span class=”ws”> </span>@property</pre>
<pre class=”line after”><span class=”ws”> </span>def links(self):</pre>
<pre class=”line after”><span class=”ws”> </span>"""Returns the parsed header links of the response, if any."""</pre>
<pre class=”line after”><span class=”ws”></span> </pre></div>
</div>
</ul>
<blockquote>requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
</blockquote>
</div><div class=”plain”>
<p>
This is the Copy/Paste friendly version of the traceback.
</p>
<textarea cols=”50″ rows=”10″ name=”code” readonly>Traceback (most recent call last):
File "F:\project\wxgzh\venv\lib\site-packages\requests\models.py", line 971, in json
return complexjson.loads(self.text, **kwargs)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)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 357, in get_new_content_chatglm
data = response.json()
File "F:\project\wxgzh\venv\lib\site-packages\requests\models.py", line 975, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
</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\requests\models.py”, line 971, in json
return complexjson.loads(self.text, **kwargs)
File “C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\__init__.py”, line 346, in loads
return _default_decoder.decode(s)
File “C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\decoder.py”, line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File “C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\decoder.py”, line 355, in raw_decode
raise JSONDecodeError(“Expecting value”, s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)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 357, in get_new_content_chatglm
data = response.json()
File “F:\project\wxgzh\venv\lib\site-packages\requests\models.py”, line 975, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)–>
5. 【快速高质量语音合成方法CoMoSpeech问世】
<!doctype html>
<html lang=en>
<head>
<title>requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
// Werkzeug Debugger</title>
<link rel=”stylesheet” href=”?__debugger__=yes&cmd=resource&f=style.css”>
<link rel=”shortcut icon”
href=”?__debugger__=yes&cmd=resource&f=console.png”>
<script src=”?__debugger__=yes&cmd=resource&f=debugger.js”></script>
<script>
var CONSOLE_MODE = false,
EVALEX = true,
EVALEX_TRUSTED = false,
SECRET = “uImqR9BO9WQOrgY4YnuS”;
</script>
</head>
<body style=”background-color: #fff”>
<div class=”debugger”>
<h1>JSONDecodeError</h1>
<div class=”detail”>
<p class=”errormsg”>requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
</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-2552850284096″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\requests\models.py”</cite>,
line <em class=”line”>971</em>,
in <code class=”function”>json</code></h4>
<div class=”source library”><pre class=”line before”><span class=”ws”> </span>pass</pre>
<pre class=”line before”><span class=”ws”> </span>except JSONDecodeError as e:</pre>
<pre class=”line before”><span class=”ws”> </span>raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)</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>return complexjson.loads(self.text, **kwargs)</pre>
<pre class=”line after”><span class=”ws”> </span>except JSONDecodeError as e:</pre>
<pre class=”line after”><span class=”ws”> </span># Catch JSON-related errors and raise as requests.JSONDecodeError</pre>
<pre class=”line after”><span class=”ws”> </span># This aliases json.JSONDecodeError and simplejson.JSONDecodeError</pre>
<pre class=”line after”><span class=”ws”> </span>raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)</pre>
<pre class=”line after”><span class=”ws”></span> </pre></div>
</div><li><div class=”frame” id=”frame-2552850284208″>
<h4>File <cite class=”filename”>”C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\__init__.py”</cite>,
line <em class=”line”>346</em>,
in <code class=”function”>loads</code></h4>
<div class=”source “><pre class=”line before”><span class=”ws”> </span>s = s.decode(detect_encoding(s), 'surrogatepass')</pre>
<pre class=”line before”><span class=”ws”></span> </pre>
<pre class=”line before”><span class=”ws”> </span>if (cls is None and object_hook is None and</pre>
<pre class=”line before”><span class=”ws”> </span>parse_int is None and parse_float is None and</pre>
<pre class=”line before”><span class=”ws”> </span>parse_constant is None and object_pairs_hook is None and not kw):</pre>
<pre class=”line current”><span class=”ws”> </span>return _default_decoder.decode(s)</pre>
<pre class=”line after”><span class=”ws”> </span>if cls is None:</pre>
<pre class=”line after”><span class=”ws”> </span>cls = JSONDecoder</pre>
<pre class=”line after”><span class=”ws”> </span>if object_hook is not None:</pre>
<pre class=”line after”><span class=”ws”> </span>kw['object_hook'] = object_hook</pre>
<pre class=”line after”><span class=”ws”> </span>if object_pairs_hook is not None:</pre></div>
</div><li><div class=”frame” id=”frame-2552850284320″>
<h4>File <cite class=”filename”>”C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\decoder.py”</cite>,
line <em class=”line”>337</em>,
in <code class=”function”>decode</code></h4>
<div class=”source “><pre class=”line before”><span class=”ws”> </span>def decode(self, s, _w=WHITESPACE.match):</pre>
<pre class=”line before”><span class=”ws”> </span>"""Return the Python representation of “s“ (a “str“ instance</pre>
<pre class=”line before”><span class=”ws”> </span>containing a JSON document).</pre>
<pre class=”line before”><span class=”ws”></span> </pre>
<pre class=”line before”><span class=”ws”> </span>"""</pre>
<pre class=”line current”><span class=”ws”> </span>obj, end = self.raw_decode(s, idx=_w(s, 0).end())</pre>
<pre class=”line after”><span class=”ws”> </span>end = _w(s, end).end()</pre>
<pre class=”line after”><span class=”ws”> </span>if end != len(s):</pre>
<pre class=”line after”><span class=”ws”> </span>raise JSONDecodeError("Extra data", s, end)</pre>
<pre class=”line after”><span class=”ws”> </span>return obj</pre>
<pre class=”line after”><span class=”ws”></span> </pre></div>
</div><li><div class=”frame” id=”frame-2552850329664″>
<h4>File <cite class=”filename”>”C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\decoder.py”</cite>,
line <em class=”line”>355</em>,
in <code class=”function”>raw_decode</code></h4>
<div class=”source “><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>try:</pre>
<pre class=”line before”><span class=”ws”> </span>obj, end = self.scan_once(s, idx)</pre>
<pre class=”line before”><span class=”ws”> </span>except StopIteration as err:</pre>
<pre class=”line current”><span class=”ws”> </span>raise JSONDecodeError("Expecting value", s, err.value) from None</pre>
<pre class=”line after”><span class=”ws”> </span>return obj, end</pre></div>
</div><li><div class=”exc-divider”>During handling of the above exception, another exception occurred:</div>
<li><div class=”frame” id=”frame-2552850282192″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\flask\app.py”</cite>,
line <em class=”line”>1478</em>,
in <code class=”function”>__call__</code></h4>
<div class=”source library”><pre class=”line before”><span class=”ws”> </span>def __call__(self, environ: dict, start_response: t.Callable) -> t.Any:</pre>
<pre class=”line before”><span class=”ws”> </span>"""The WSGI server calls the Flask application object as the</pre>
<pre class=”line before”><span class=”ws”> </span>WSGI application. This calls :meth:`wsgi_app`, which can be</pre>
<pre class=”line before”><span class=”ws”> </span>wrapped to apply middleware.</pre>
<pre class=”line before”><span class=”ws”> </span>"""</pre>
<pre class=”line current”><span class=”ws”> </span>return self.wsgi_app(environ, start_response)</pre></div>
</div><li><div class=”frame” id=”frame-2552850282304″>
<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-2552850281968″>
<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-2552850282416″>
<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-2552850282528″>
<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-2552850282640″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\flask\app.py”</cite>,
line <em class=”line”>852</em>,
in <code class=”function”>dispatch_request</code></h4>
<div class=”source library”><pre class=”line before”><span class=”ws”> </span>and req.method == "OPTIONS"</pre>
<pre class=”line before”><span class=”ws”> </span>):</pre>
<pre class=”line before”><span class=”ws”> </span>return self.make_default_options_response()</pre>
<pre class=”line before”><span class=”ws”> </span># otherwise dispatch to the handler for that endpoint</pre>
<pre class=”line before”><span class=”ws”> </span>view_args: dict[str, t.Any] = req.view_args # type: ignore[assignment]</pre>
<pre class=”line current”><span class=”ws”> </span>return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)</pre>
<pre class=”line after”><span class=”ws”></span> </pre>
<pre class=”line after”><span class=”ws”> </span>def full_dispatch_request(self) -> Response:</pre>
<pre class=”line after”><span class=”ws”> </span>"""Dispatches the request and on top of that performs request</pre>
<pre class=”line after”><span class=”ws”> </span>pre and postprocessing as well as HTTP exception catching and</pre>
<pre class=”line after”><span class=”ws”> </span>error handling.</pre></div>
</div><li><div class=”frame” id=”frame-2552850282752″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\model_server.py”</cite>,
line <em class=”line”>322</em>,
in <code class=”function”>get_new_content_api</code></h4>
<div class=”source “><pre class=”line before”><span class=”ws”></span>def get_new_content_api():</pre>
<pre class=”line before”><span class=”ws”> </span>content = request.args.get('content')</pre>
<pre class=”line before”><span class=”ws”> </span>engine_type = request.args.get('engine_type')</pre>
<pre class=”line before”><span class=”ws”> </span>need_summary = request.args.get('need_summary')</pre>
<pre class=”line before”><span class=”ws”> </span>need_keywords = request.args.get('need_keywords')</pre>
<pre class=”line current”><span class=”ws”> </span>new_content = get_new_content(engine_type,need_summary,need_keywords,content) # 传递 len 参数,使用 30 作为长度</pre>
<pre class=”line after”><span class=”ws”> </span>return new_content</pre>
<pre class=”line after”><span class=”ws”></span>@retry(exceptions=ConnectionError,tries=tries,delay=1)</pre>
<pre class=”line after”><span class=”ws”></span>def get_new_content(engine_type,need_summary,need_keywords,init_content):</pre>
<pre class=”line after”><span class=”ws”> </span>if engine_type == RewriteEnum.EngineType.WENXINYIYAN:</pre>
<pre class=”line after”><span class=”ws”> </span>new_content = get_wp_post_wx_continue(need_summary,need_keywords ,init_content)</pre></div>
</div><li><div class=”frame” id=”frame-2552850282864″>
<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-2552850282976″>
<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-2552850283088″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\retry\api.py”</cite>,
line <em class=”line”>33</em>,
in <code class=”function”>__retry_internal</code></h4>
<div class=”source library”><pre class=”line before”><span class=”ws”> </span>:returns: the result of the f function.</pre>
<pre class=”line before”><span class=”ws”> </span>"""</pre>
<pre class=”line before”><span class=”ws”> </span>_tries, _delay = tries, delay</pre>
<pre class=”line before”><span class=”ws”> </span>while _tries:</pre>
<pre class=”line before”><span class=”ws”> </span>try:</pre>
<pre class=”line current”><span class=”ws”> </span>return f()</pre>
<pre class=”line after”><span class=”ws”> </span>except exceptions as e:</pre>
<pre class=”line after”><span class=”ws”> </span>_tries -= 1</pre>
<pre class=”line after”><span class=”ws”> </span>if not _tries:</pre>
<pre class=”line after”><span class=”ws”> </span>raise</pre>
<pre class=”line after”><span class=”ws”></span> </pre></div>
</div><li><div class=”frame” id=”frame-2552850283200″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\model_server.py”</cite>,
line <em class=”line”>329</em>,
in <code class=”function”>get_new_content</code></h4>
<div class=”source “><pre class=”line before”><span class=”ws”></span>@retry(exceptions=ConnectionError,tries=tries,delay=1)</pre>
<pre class=”line before”><span class=”ws”></span>def get_new_content(engine_type,need_summary,need_keywords,init_content):</pre>
<pre class=”line before”><span class=”ws”> </span>if engine_type == RewriteEnum.EngineType.WENXINYIYAN:</pre>
<pre class=”line before”><span class=”ws”> </span>new_content = get_wp_post_wx_continue(need_summary,need_keywords ,init_content)</pre>
<pre class=”line before”><span class=”ws”> </span>else:</pre>
<pre class=”line current”><span class=”ws”> </span>new_content = get_new_content_chatglm(init_content)</pre>
<pre class=”line after”><span class=”ws”> </span>return new_content</pre>
<pre class=”line after”><span class=”ws”></span>@retry(exceptions=ConnectionError,tries=tries,delay=1)</pre>
<pre class=”line after”><span class=”ws”></span>def get_new_content_chatglm(content):</pre>
<pre class=”line after”><span class=”ws”> </span>payload = {</pre>
<pre class=”line after”><span class=”ws”> </span>"model": "chatglm3-6b",</pre></div>
</div><li><div class=”frame” id=”frame-2552850283424″>
<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-2552850283536″>
<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-2552850283648″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\retry\api.py”</cite>,
line <em class=”line”>33</em>,
in <code class=”function”>__retry_internal</code></h4>
<div class=”source library”><pre class=”line before”><span class=”ws”> </span>:returns: the result of the f function.</pre>
<pre class=”line before”><span class=”ws”> </span>"""</pre>
<pre class=”line before”><span class=”ws”> </span>_tries, _delay = tries, delay</pre>
<pre class=”line before”><span class=”ws”> </span>while _tries:</pre>
<pre class=”line before”><span class=”ws”> </span>try:</pre>
<pre class=”line current”><span class=”ws”> </span>return f()</pre>
<pre class=”line after”><span class=”ws”> </span>except exceptions as e:</pre>
<pre class=”line after”><span class=”ws”> </span>_tries -= 1</pre>
<pre class=”line after”><span class=”ws”> </span>if not _tries:</pre>
<pre class=”line after”><span class=”ws”> </span>raise</pre>
<pre class=”line after”><span class=”ws”></span> </pre></div>
</div><li><div class=”frame” id=”frame-2552850283760″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\model_server.py”</cite>,
line <em class=”line”>357</em>,
in <code class=”function”>get_new_content_chatglm</code></h4>
<div class=”source “><pre class=”line before”><span class=”ws”> </span>}</pre>
<pre class=”line before”><span class=”ws”> </span>headers = {"content-type": "application/json"}</pre>
<pre class=”line before”><span class=”ws”> </span>task_start_time = time.time()</pre>
<pre class=”line before”><span class=”ws”> </span>response = requests.request("POST", chatglm_url, json=payload, headers=headers)</pre>
<pre class=”line before”><span class=”ws”> </span>#print(response)</pre>
<pre class=”line current”><span class=”ws”> </span>data = response.json()</pre>
<pre class=”line after”><span class=”ws”> </span>print(json.dumps(data, indent=4))</pre>
<pre class=”line after”><span class=”ws”> </span>new_content = data['choices'][0]['message']['content']</pre>
<pre class=”line after”><span class=”ws”> </span>new_content = new_content.replace("重新改写后:", "").replace("", "")</pre>
<pre class=”line after”><span class=”ws”> </span>new_content = new_content.replace("重新组织后:", "")</pre>
<pre class=”line after”><span class=”ws”> </span>new_content = new_content.replace("\n", "")</pre></div>
</div><li><div class=”frame” id=”frame-2552850283872″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\requests\models.py”</cite>,
line <em class=”line”>975</em>,
in <code class=”function”>json</code></h4>
<div class=”source library”><pre class=”line before”><span class=”ws”> </span>try:</pre>
<pre class=”line before”><span class=”ws”> </span>return complexjson.loads(self.text, **kwargs)</pre>
<pre class=”line before”><span class=”ws”> </span>except JSONDecodeError as e:</pre>
<pre class=”line before”><span class=”ws”> </span># Catch JSON-related errors and raise as requests.JSONDecodeError</pre>
<pre class=”line before”><span class=”ws”> </span># This aliases json.JSONDecodeError and simplejson.JSONDecodeError</pre>
<pre class=”line current”><span class=”ws”> </span>raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)</pre>
<pre class=”line after”><span class=”ws”></span> </pre>
<pre class=”line after”><span class=”ws”> </span>@property</pre>
<pre class=”line after”><span class=”ws”> </span>def links(self):</pre>
<pre class=”line after”><span class=”ws”> </span>"""Returns the parsed header links of the response, if any."""</pre>
<pre class=”line after”><span class=”ws”></span> </pre></div>
</div>
</ul>
<blockquote>requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
</blockquote>
</div><div class=”plain”>
<p>
This is the Copy/Paste friendly version of the traceback.
</p>
<textarea cols=”50″ rows=”10″ name=”code” readonly>Traceback (most recent call last):
File "F:\project\wxgzh\venv\lib\site-packages\requests\models.py", line 971, in json
return complexjson.loads(self.text, **kwargs)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)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 357, in get_new_content_chatglm
data = response.json()
File "F:\project\wxgzh\venv\lib\site-packages\requests\models.py", line 975, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
</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\requests\models.py”, line 971, in json
return complexjson.loads(self.text, **kwargs)
File “C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\__init__.py”, line 346, in loads
return _default_decoder.decode(s)
File “C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\decoder.py”, line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File “C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\decoder.py”, line 355, in raw_decode
raise JSONDecodeError(“Expecting value”, s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)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 357, in get_new_content_chatglm
data = response.json()
File “F:\project\wxgzh\venv\lib\site-packages\requests\models.py”, line 975, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)–>
6. 【金山办公将AI技术融入WPS办公套件】
<!doctype html>
<html lang=en>
<head>
<title>requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
// Werkzeug Debugger</title>
<link rel=”stylesheet” href=”?__debugger__=yes&cmd=resource&f=style.css”>
<link rel=”shortcut icon”
href=”?__debugger__=yes&cmd=resource&f=console.png”>
<script src=”?__debugger__=yes&cmd=resource&f=debugger.js”></script>
<script>
var CONSOLE_MODE = false,
EVALEX = true,
EVALEX_TRUSTED = false,
SECRET = “uImqR9BO9WQOrgY4YnuS”;
</script>
</head>
<body style=”background-color: #fff”>
<div class=”debugger”>
<h1>JSONDecodeError</h1>
<div class=”detail”>
<p class=”errormsg”>requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
</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-2552850424768″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\requests\models.py”</cite>,
line <em class=”line”>971</em>,
in <code class=”function”>json</code></h4>
<div class=”source library”><pre class=”line before”><span class=”ws”> </span>pass</pre>
<pre class=”line before”><span class=”ws”> </span>except JSONDecodeError as e:</pre>
<pre class=”line before”><span class=”ws”> </span>raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)</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>return complexjson.loads(self.text, **kwargs)</pre>
<pre class=”line after”><span class=”ws”> </span>except JSONDecodeError as e:</pre>
<pre class=”line after”><span class=”ws”> </span># Catch JSON-related errors and raise as requests.JSONDecodeError</pre>
<pre class=”line after”><span class=”ws”> </span># This aliases json.JSONDecodeError and simplejson.JSONDecodeError</pre>
<pre class=”line after”><span class=”ws”> </span>raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)</pre>
<pre class=”line after”><span class=”ws”></span> </pre></div>
</div><li><div class=”frame” id=”frame-2552850424880″>
<h4>File <cite class=”filename”>”C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\__init__.py”</cite>,
line <em class=”line”>346</em>,
in <code class=”function”>loads</code></h4>
<div class=”source “><pre class=”line before”><span class=”ws”> </span>s = s.decode(detect_encoding(s), 'surrogatepass')</pre>
<pre class=”line before”><span class=”ws”></span> </pre>
<pre class=”line before”><span class=”ws”> </span>if (cls is None and object_hook is None and</pre>
<pre class=”line before”><span class=”ws”> </span>parse_int is None and parse_float is None and</pre>
<pre class=”line before”><span class=”ws”> </span>parse_constant is None and object_pairs_hook is None and not kw):</pre>
<pre class=”line current”><span class=”ws”> </span>return _default_decoder.decode(s)</pre>
<pre class=”line after”><span class=”ws”> </span>if cls is None:</pre>
<pre class=”line after”><span class=”ws”> </span>cls = JSONDecoder</pre>
<pre class=”line after”><span class=”ws”> </span>if object_hook is not None:</pre>
<pre class=”line after”><span class=”ws”> </span>kw['object_hook'] = object_hook</pre>
<pre class=”line after”><span class=”ws”> </span>if object_pairs_hook is not None:</pre></div>
</div><li><div class=”frame” id=”frame-2552850424992″>
<h4>File <cite class=”filename”>”C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\decoder.py”</cite>,
line <em class=”line”>337</em>,
in <code class=”function”>decode</code></h4>
<div class=”source “><pre class=”line before”><span class=”ws”> </span>def decode(self, s, _w=WHITESPACE.match):</pre>
<pre class=”line before”><span class=”ws”> </span>"""Return the Python representation of “s“ (a “str“ instance</pre>
<pre class=”line before”><span class=”ws”> </span>containing a JSON document).</pre>
<pre class=”line before”><span class=”ws”></span> </pre>
<pre class=”line before”><span class=”ws”> </span>"""</pre>
<pre class=”line current”><span class=”ws”> </span>obj, end = self.raw_decode(s, idx=_w(s, 0).end())</pre>
<pre class=”line after”><span class=”ws”> </span>end = _w(s, end).end()</pre>
<pre class=”line after”><span class=”ws”> </span>if end != len(s):</pre>
<pre class=”line after”><span class=”ws”> </span>raise JSONDecodeError("Extra data", s, end)</pre>
<pre class=”line after”><span class=”ws”> </span>return obj</pre>
<pre class=”line after”><span class=”ws”></span> </pre></div>
</div><li><div class=”frame” id=”frame-2552850425216″>
<h4>File <cite class=”filename”>”C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\decoder.py”</cite>,
line <em class=”line”>355</em>,
in <code class=”function”>raw_decode</code></h4>
<div class=”source “><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>try:</pre>
<pre class=”line before”><span class=”ws”> </span>obj, end = self.scan_once(s, idx)</pre>
<pre class=”line before”><span class=”ws”> </span>except StopIteration as err:</pre>
<pre class=”line current”><span class=”ws”> </span>raise JSONDecodeError("Expecting value", s, err.value) from None</pre>
<pre class=”line after”><span class=”ws”> </span>return obj, end</pre></div>
</div><li><div class=”exc-divider”>During handling of the above exception, another exception occurred:</div>
<li><div class=”frame” id=”frame-2552850332800″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\flask\app.py”</cite>,
line <em class=”line”>1478</em>,
in <code class=”function”>__call__</code></h4>
<div class=”source library”><pre class=”line before”><span class=”ws”> </span>def __call__(self, environ: dict, start_response: t.Callable) -> t.Any:</pre>
<pre class=”line before”><span class=”ws”> </span>"""The WSGI server calls the Flask application object as the</pre>
<pre class=”line before”><span class=”ws”> </span>WSGI application. This calls :meth:`wsgi_app`, which can be</pre>
<pre class=”line before”><span class=”ws”> </span>wrapped to apply middleware.</pre>
<pre class=”line before”><span class=”ws”> </span>"""</pre>
<pre class=”line current”><span class=”ws”> </span>return self.wsgi_app(environ, start_response)</pre></div>
</div><li><div class=”frame” id=”frame-2552850332464″>
<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-2552850332688″>
<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-2552850332912″>
<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-2552850333024″>
<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-2552850333136″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\flask\app.py”</cite>,
line <em class=”line”>852</em>,
in <code class=”function”>dispatch_request</code></h4>
<div class=”source library”><pre class=”line before”><span class=”ws”> </span>and req.method == "OPTIONS"</pre>
<pre class=”line before”><span class=”ws”> </span>):</pre>
<pre class=”line before”><span class=”ws”> </span>return self.make_default_options_response()</pre>
<pre class=”line before”><span class=”ws”> </span># otherwise dispatch to the handler for that endpoint</pre>
<pre class=”line before”><span class=”ws”> </span>view_args: dict[str, t.Any] = req.view_args # type: ignore[assignment]</pre>
<pre class=”line current”><span class=”ws”> </span>return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)</pre>
<pre class=”line after”><span class=”ws”></span> </pre>
<pre class=”line after”><span class=”ws”> </span>def full_dispatch_request(self) -> Response:</pre>
<pre class=”line after”><span class=”ws”> </span>"""Dispatches the request and on top of that performs request</pre>
<pre class=”line after”><span class=”ws”> </span>pre and postprocessing as well as HTTP exception catching and</pre>
<pre class=”line after”><span class=”ws”> </span>error handling.</pre></div>
</div><li><div class=”frame” id=”frame-2552850333248″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\model_server.py”</cite>,
line <em class=”line”>322</em>,
in <code class=”function”>get_new_content_api</code></h4>
<div class=”source “><pre class=”line before”><span class=”ws”></span>def get_new_content_api():</pre>
<pre class=”line before”><span class=”ws”> </span>content = request.args.get('content')</pre>
<pre class=”line before”><span class=”ws”> </span>engine_type = request.args.get('engine_type')</pre>
<pre class=”line before”><span class=”ws”> </span>need_summary = request.args.get('need_summary')</pre>
<pre class=”line before”><span class=”ws”> </span>need_keywords = request.args.get('need_keywords')</pre>
<pre class=”line current”><span class=”ws”> </span>new_content = get_new_content(engine_type,need_summary,need_keywords,content) # 传递 len 参数,使用 30 作为长度</pre>
<pre class=”line after”><span class=”ws”> </span>return new_content</pre>
<pre class=”line after”><span class=”ws”></span>@retry(exceptions=ConnectionError,tries=tries,delay=1)</pre>
<pre class=”line after”><span class=”ws”></span>def get_new_content(engine_type,need_summary,need_keywords,init_content):</pre>
<pre class=”line after”><span class=”ws”> </span>if engine_type == RewriteEnum.EngineType.WENXINYIYAN:</pre>
<pre class=”line after”><span class=”ws”> </span>new_content = get_wp_post_wx_continue(need_summary,need_keywords ,init_content)</pre></div>
</div><li><div class=”frame” id=”frame-2552850333360″>
<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-2552850333472″>
<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-2552850333584″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\retry\api.py”</cite>,
line <em class=”line”>33</em>,
in <code class=”function”>__retry_internal</code></h4>
<div class=”source library”><pre class=”line before”><span class=”ws”> </span>:returns: the result of the f function.</pre>
<pre class=”line before”><span class=”ws”> </span>"""</pre>
<pre class=”line before”><span class=”ws”> </span>_tries, _delay = tries, delay</pre>
<pre class=”line before”><span class=”ws”> </span>while _tries:</pre>
<pre class=”line before”><span class=”ws”> </span>try:</pre>
<pre class=”line current”><span class=”ws”> </span>return f()</pre>
<pre class=”line after”><span class=”ws”> </span>except exceptions as e:</pre>
<pre class=”line after”><span class=”ws”> </span>_tries -= 1</pre>
<pre class=”line after”><span class=”ws”> </span>if not _tries:</pre>
<pre class=”line after”><span class=”ws”> </span>raise</pre>
<pre class=”line after”><span class=”ws”></span> </pre></div>
</div><li><div class=”frame” id=”frame-2552850423872″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\model_server.py”</cite>,
line <em class=”line”>329</em>,
in <code class=”function”>get_new_content</code></h4>
<div class=”source “><pre class=”line before”><span class=”ws”></span>@retry(exceptions=ConnectionError,tries=tries,delay=1)</pre>
<pre class=”line before”><span class=”ws”></span>def get_new_content(engine_type,need_summary,need_keywords,init_content):</pre>
<pre class=”line before”><span class=”ws”> </span>if engine_type == RewriteEnum.EngineType.WENXINYIYAN:</pre>
<pre class=”line before”><span class=”ws”> </span>new_content = get_wp_post_wx_continue(need_summary,need_keywords ,init_content)</pre>
<pre class=”line before”><span class=”ws”> </span>else:</pre>
<pre class=”line current”><span class=”ws”> </span>new_content = get_new_content_chatglm(init_content)</pre>
<pre class=”line after”><span class=”ws”> </span>return new_content</pre>
<pre class=”line after”><span class=”ws”></span>@retry(exceptions=ConnectionError,tries=tries,delay=1)</pre>
<pre class=”line after”><span class=”ws”></span>def get_new_content_chatglm(content):</pre>
<pre class=”line after”><span class=”ws”> </span>payload = {</pre>
<pre class=”line after”><span class=”ws”> </span>"model": "chatglm3-6b",</pre></div>
</div><li><div class=”frame” id=”frame-2552850424096″>
<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-2552850424208″>
<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-2552850424320″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\retry\api.py”</cite>,
line <em class=”line”>33</em>,
in <code class=”function”>__retry_internal</code></h4>
<div class=”source library”><pre class=”line before”><span class=”ws”> </span>:returns: the result of the f function.</pre>
<pre class=”line before”><span class=”ws”> </span>"""</pre>
<pre class=”line before”><span class=”ws”> </span>_tries, _delay = tries, delay</pre>
<pre class=”line before”><span class=”ws”> </span>while _tries:</pre>
<pre class=”line before”><span class=”ws”> </span>try:</pre>
<pre class=”line current”><span class=”ws”> </span>return f()</pre>
<pre class=”line after”><span class=”ws”> </span>except exceptions as e:</pre>
<pre class=”line after”><span class=”ws”> </span>_tries -= 1</pre>
<pre class=”line after”><span class=”ws”> </span>if not _tries:</pre>
<pre class=”line after”><span class=”ws”> </span>raise</pre>
<pre class=”line after”><span class=”ws”></span> </pre></div>
</div><li><div class=”frame” id=”frame-2552850424432″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\model_server.py”</cite>,
line <em class=”line”>357</em>,
in <code class=”function”>get_new_content_chatglm</code></h4>
<div class=”source “><pre class=”line before”><span class=”ws”> </span>}</pre>
<pre class=”line before”><span class=”ws”> </span>headers = {"content-type": "application/json"}</pre>
<pre class=”line before”><span class=”ws”> </span>task_start_time = time.time()</pre>
<pre class=”line before”><span class=”ws”> </span>response = requests.request("POST", chatglm_url, json=payload, headers=headers)</pre>
<pre class=”line before”><span class=”ws”> </span>#print(response)</pre>
<pre class=”line current”><span class=”ws”> </span>data = response.json()</pre>
<pre class=”line after”><span class=”ws”> </span>print(json.dumps(data, indent=4))</pre>
<pre class=”line after”><span class=”ws”> </span>new_content = data['choices'][0]['message']['content']</pre>
<pre class=”line after”><span class=”ws”> </span>new_content = new_content.replace("重新改写后:", "").replace("", "")</pre>
<pre class=”line after”><span class=”ws”> </span>new_content = new_content.replace("重新组织后:", "")</pre>
<pre class=”line after”><span class=”ws”> </span>new_content = new_content.replace("\n", "")</pre></div>
</div><li><div class=”frame” id=”frame-2552850424544″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\requests\models.py”</cite>,
line <em class=”line”>975</em>,
in <code class=”function”>json</code></h4>
<div class=”source library”><pre class=”line before”><span class=”ws”> </span>try:</pre>
<pre class=”line before”><span class=”ws”> </span>return complexjson.loads(self.text, **kwargs)</pre>
<pre class=”line before”><span class=”ws”> </span>except JSONDecodeError as e:</pre>
<pre class=”line before”><span class=”ws”> </span># Catch JSON-related errors and raise as requests.JSONDecodeError</pre>
<pre class=”line before”><span class=”ws”> </span># This aliases json.JSONDecodeError and simplejson.JSONDecodeError</pre>
<pre class=”line current”><span class=”ws”> </span>raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)</pre>
<pre class=”line after”><span class=”ws”></span> </pre>
<pre class=”line after”><span class=”ws”> </span>@property</pre>
<pre class=”line after”><span class=”ws”> </span>def links(self):</pre>
<pre class=”line after”><span class=”ws”> </span>"""Returns the parsed header links of the response, if any."""</pre>
<pre class=”line after”><span class=”ws”></span> </pre></div>
</div>
</ul>
<blockquote>requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
</blockquote>
</div><div class=”plain”>
<p>
This is the Copy/Paste friendly version of the traceback.
</p>
<textarea cols=”50″ rows=”10″ name=”code” readonly>Traceback (most recent call last):
File "F:\project\wxgzh\venv\lib\site-packages\requests\models.py", line 971, in json
return complexjson.loads(self.text, **kwargs)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)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 357, in get_new_content_chatglm
data = response.json()
File "F:\project\wxgzh\venv\lib\site-packages\requests\models.py", line 975, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
</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\requests\models.py”, line 971, in json
return complexjson.loads(self.text, **kwargs)
File “C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\__init__.py”, line 346, in loads
return _default_decoder.decode(s)
File “C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\decoder.py”, line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File “C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\decoder.py”, line 355, in raw_decode
raise JSONDecodeError(“Expecting value”, s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)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 357, in get_new_content_chatglm
data = response.json()
File “F:\project\wxgzh\venv\lib\site-packages\requests\models.py”, line 975, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)–>
7. 【百度2023年第一季度财报公布】
<!doctype html>
<html lang=en>
<head>
<title>requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
// Werkzeug Debugger</title>
<link rel=”stylesheet” href=”?__debugger__=yes&cmd=resource&f=style.css”>
<link rel=”shortcut icon”
href=”?__debugger__=yes&cmd=resource&f=console.png”>
<script src=”?__debugger__=yes&cmd=resource&f=debugger.js”></script>
<script>
var CONSOLE_MODE = false,
EVALEX = true,
EVALEX_TRUSTED = false,
SECRET = “uImqR9BO9WQOrgY4YnuS”;
</script>
</head>
<body style=”background-color: #fff”>
<div class=”debugger”>
<h1>JSONDecodeError</h1>
<div class=”detail”>
<p class=”errormsg”>requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
</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-2552850467072″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\requests\models.py”</cite>,
line <em class=”line”>971</em>,
in <code class=”function”>json</code></h4>
<div class=”source library”><pre class=”line before”><span class=”ws”> </span>pass</pre>
<pre class=”line before”><span class=”ws”> </span>except JSONDecodeError as e:</pre>
<pre class=”line before”><span class=”ws”> </span>raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)</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>return complexjson.loads(self.text, **kwargs)</pre>
<pre class=”line after”><span class=”ws”> </span>except JSONDecodeError as e:</pre>
<pre class=”line after”><span class=”ws”> </span># Catch JSON-related errors and raise as requests.JSONDecodeError</pre>
<pre class=”line after”><span class=”ws”> </span># This aliases json.JSONDecodeError and simplejson.JSONDecodeError</pre>
<pre class=”line after”><span class=”ws”> </span>raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)</pre>
<pre class=”line after”><span class=”ws”></span> </pre></div>
</div><li><div class=”frame” id=”frame-2552850467184″>
<h4>File <cite class=”filename”>”C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\__init__.py”</cite>,
line <em class=”line”>346</em>,
in <code class=”function”>loads</code></h4>
<div class=”source “><pre class=”line before”><span class=”ws”> </span>s = s.decode(detect_encoding(s), 'surrogatepass')</pre>
<pre class=”line before”><span class=”ws”></span> </pre>
<pre class=”line before”><span class=”ws”> </span>if (cls is None and object_hook is None and</pre>
<pre class=”line before”><span class=”ws”> </span>parse_int is None and parse_float is None and</pre>
<pre class=”line before”><span class=”ws”> </span>parse_constant is None and object_pairs_hook is None and not kw):</pre>
<pre class=”line current”><span class=”ws”> </span>return _default_decoder.decode(s)</pre>
<pre class=”line after”><span class=”ws”> </span>if cls is None:</pre>
<pre class=”line after”><span class=”ws”> </span>cls = JSONDecoder</pre>
<pre class=”line after”><span class=”ws”> </span>if object_hook is not None:</pre>
<pre class=”line after”><span class=”ws”> </span>kw['object_hook'] = object_hook</pre>
<pre class=”line after”><span class=”ws”> </span>if object_pairs_hook is not None:</pre></div>
</div><li><div class=”frame” id=”frame-2552850467296″>
<h4>File <cite class=”filename”>”C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\decoder.py”</cite>,
line <em class=”line”>337</em>,
in <code class=”function”>decode</code></h4>
<div class=”source “><pre class=”line before”><span class=”ws”> </span>def decode(self, s, _w=WHITESPACE.match):</pre>
<pre class=”line before”><span class=”ws”> </span>"""Return the Python representation of “s“ (a “str“ instance</pre>
<pre class=”line before”><span class=”ws”> </span>containing a JSON document).</pre>
<pre class=”line before”><span class=”ws”></span> </pre>
<pre class=”line before”><span class=”ws”> </span>"""</pre>
<pre class=”line current”><span class=”ws”> </span>obj, end = self.raw_decode(s, idx=_w(s, 0).end())</pre>
<pre class=”line after”><span class=”ws”> </span>end = _w(s, end).end()</pre>
<pre class=”line after”><span class=”ws”> </span>if end != len(s):</pre>
<pre class=”line after”><span class=”ws”> </span>raise JSONDecodeError("Extra data", s, end)</pre>
<pre class=”line after”><span class=”ws”> </span>return obj</pre>
<pre class=”line after”><span class=”ws”></span> </pre></div>
</div><li><div class=”frame” id=”frame-2552850467520″>
<h4>File <cite class=”filename”>”C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\decoder.py”</cite>,
line <em class=”line”>355</em>,
in <code class=”function”>raw_decode</code></h4>
<div class=”source “><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>try:</pre>
<pre class=”line before”><span class=”ws”> </span>obj, end = self.scan_once(s, idx)</pre>
<pre class=”line before”><span class=”ws”> </span>except StopIteration as err:</pre>
<pre class=”line current”><span class=”ws”> </span>raise JSONDecodeError("Expecting value", s, err.value) from None</pre>
<pre class=”line after”><span class=”ws”> </span>return obj, end</pre></div>
</div><li><div class=”exc-divider”>During handling of the above exception, another exception occurred:</div>
<li><div class=”frame” id=”frame-2552850464944″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\flask\app.py”</cite>,
line <em class=”line”>1478</em>,
in <code class=”function”>__call__</code></h4>
<div class=”source library”><pre class=”line before”><span class=”ws”> </span>def __call__(self, environ: dict, start_response: t.Callable) -> t.Any:</pre>
<pre class=”line before”><span class=”ws”> </span>"""The WSGI server calls the Flask application object as the</pre>
<pre class=”line before”><span class=”ws”> </span>WSGI application. This calls :meth:`wsgi_app`, which can be</pre>
<pre class=”line before”><span class=”ws”> </span>wrapped to apply middleware.</pre>
<pre class=”line before”><span class=”ws”> </span>"""</pre>
<pre class=”line current”><span class=”ws”> </span>return self.wsgi_app(environ, start_response)</pre></div>
</div><li><div class=”frame” id=”frame-2552850465168″>
<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-2552850465280″>
<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-2552850465392″>
<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-2552850465504″>
<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-2552850465616″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\flask\app.py”</cite>,
line <em class=”line”>852</em>,
in <code class=”function”>dispatch_request</code></h4>
<div class=”source library”><pre class=”line before”><span class=”ws”> </span>and req.method == "OPTIONS"</pre>
<pre class=”line before”><span class=”ws”> </span>):</pre>
<pre class=”line before”><span class=”ws”> </span>return self.make_default_options_response()</pre>
<pre class=”line before”><span class=”ws”> </span># otherwise dispatch to the handler for that endpoint</pre>
<pre class=”line before”><span class=”ws”> </span>view_args: dict[str, t.Any] = req.view_args # type: ignore[assignment]</pre>
<pre class=”line current”><span class=”ws”> </span>return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)</pre>
<pre class=”line after”><span class=”ws”></span> </pre>
<pre class=”line after”><span class=”ws”> </span>def full_dispatch_request(self) -> Response:</pre>
<pre class=”line after”><span class=”ws”> </span>"""Dispatches the request and on top of that performs request</pre>
<pre class=”line after”><span class=”ws”> </span>pre and postprocessing as well as HTTP exception catching and</pre>
<pre class=”line after”><span class=”ws”> </span>error handling.</pre></div>
</div><li><div class=”frame” id=”frame-2552850465728″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\model_server.py”</cite>,
line <em class=”line”>322</em>,
in <code class=”function”>get_new_content_api</code></h4>
<div class=”source “><pre class=”line before”><span class=”ws”></span>def get_new_content_api():</pre>
<pre class=”line before”><span class=”ws”> </span>content = request.args.get('content')</pre>
<pre class=”line before”><span class=”ws”> </span>engine_type = request.args.get('engine_type')</pre>
<pre class=”line before”><span class=”ws”> </span>need_summary = request.args.get('need_summary')</pre>
<pre class=”line before”><span class=”ws”> </span>need_keywords = request.args.get('need_keywords')</pre>
<pre class=”line current”><span class=”ws”> </span>new_content = get_new_content(engine_type,need_summary,need_keywords,content) # 传递 len 参数,使用 30 作为长度</pre>
<pre class=”line after”><span class=”ws”> </span>return new_content</pre>
<pre class=”line after”><span class=”ws”></span>@retry(exceptions=ConnectionError,tries=tries,delay=1)</pre>
<pre class=”line after”><span class=”ws”></span>def get_new_content(engine_type,need_summary,need_keywords,init_content):</pre>
<pre class=”line after”><span class=”ws”> </span>if engine_type == RewriteEnum.EngineType.WENXINYIYAN:</pre>
<pre class=”line after”><span class=”ws”> </span>new_content = get_wp_post_wx_continue(need_summary,need_keywords ,init_content)</pre></div>
</div><li><div class=”frame” id=”frame-2552850465840″>
<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-2552850465952″>
<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-2552850466064″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\retry\api.py”</cite>,
line <em class=”line”>33</em>,
in <code class=”function”>__retry_internal</code></h4>
<div class=”source library”><pre class=”line before”><span class=”ws”> </span>:returns: the result of the f function.</pre>
<pre class=”line before”><span class=”ws”> </span>"""</pre>
<pre class=”line before”><span class=”ws”> </span>_tries, _delay = tries, delay</pre>
<pre class=”line before”><span class=”ws”> </span>while _tries:</pre>
<pre class=”line before”><span class=”ws”> </span>try:</pre>
<pre class=”line current”><span class=”ws”> </span>return f()</pre>
<pre class=”line after”><span class=”ws”> </span>except exceptions as e:</pre>
<pre class=”line after”><span class=”ws”> </span>_tries -= 1</pre>
<pre class=”line after”><span class=”ws”> </span>if not _tries:</pre>
<pre class=”line after”><span class=”ws”> </span>raise</pre>
<pre class=”line after”><span class=”ws”></span> </pre></div>
</div><li><div class=”frame” id=”frame-2552850466176″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\model_server.py”</cite>,
line <em class=”line”>329</em>,
in <code class=”function”>get_new_content</code></h4>
<div class=”source “><pre class=”line before”><span class=”ws”></span>@retry(exceptions=ConnectionError,tries=tries,delay=1)</pre>
<pre class=”line before”><span class=”ws”></span>def get_new_content(engine_type,need_summary,need_keywords,init_content):</pre>
<pre class=”line before”><span class=”ws”> </span>if engine_type == RewriteEnum.EngineType.WENXINYIYAN:</pre>
<pre class=”line before”><span class=”ws”> </span>new_content = get_wp_post_wx_continue(need_summary,need_keywords ,init_content)</pre>
<pre class=”line before”><span class=”ws”> </span>else:</pre>
<pre class=”line current”><span class=”ws”> </span>new_content = get_new_content_chatglm(init_content)</pre>
<pre class=”line after”><span class=”ws”> </span>return new_content</pre>
<pre class=”line after”><span class=”ws”></span>@retry(exceptions=ConnectionError,tries=tries,delay=1)</pre>
<pre class=”line after”><span class=”ws”></span>def get_new_content_chatglm(content):</pre>
<pre class=”line after”><span class=”ws”> </span>payload = {</pre>
<pre class=”line after”><span class=”ws”> </span>"model": "chatglm3-6b",</pre></div>
</div><li><div class=”frame” id=”frame-2552850466400″>
<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-2552850466512″>
<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-2552850466624″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\retry\api.py”</cite>,
line <em class=”line”>33</em>,
in <code class=”function”>__retry_internal</code></h4>
<div class=”source library”><pre class=”line before”><span class=”ws”> </span>:returns: the result of the f function.</pre>
<pre class=”line before”><span class=”ws”> </span>"""</pre>
<pre class=”line before”><span class=”ws”> </span>_tries, _delay = tries, delay</pre>
<pre class=”line before”><span class=”ws”> </span>while _tries:</pre>
<pre class=”line before”><span class=”ws”> </span>try:</pre>
<pre class=”line current”><span class=”ws”> </span>return f()</pre>
<pre class=”line after”><span class=”ws”> </span>except exceptions as e:</pre>
<pre class=”line after”><span class=”ws”> </span>_tries -= 1</pre>
<pre class=”line after”><span class=”ws”> </span>if not _tries:</pre>
<pre class=”line after”><span class=”ws”> </span>raise</pre>
<pre class=”line after”><span class=”ws”></span> </pre></div>
</div><li><div class=”frame” id=”frame-2552850466736″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\model_server.py”</cite>,
line <em class=”line”>357</em>,
in <code class=”function”>get_new_content_chatglm</code></h4>
<div class=”source “><pre class=”line before”><span class=”ws”> </span>}</pre>
<pre class=”line before”><span class=”ws”> </span>headers = {"content-type": "application/json"}</pre>
<pre class=”line before”><span class=”ws”> </span>task_start_time = time.time()</pre>
<pre class=”line before”><span class=”ws”> </span>response = requests.request("POST", chatglm_url, json=payload, headers=headers)</pre>
<pre class=”line before”><span class=”ws”> </span>#print(response)</pre>
<pre class=”line current”><span class=”ws”> </span>data = response.json()</pre>
<pre class=”line after”><span class=”ws”> </span>print(json.dumps(data, indent=4))</pre>
<pre class=”line after”><span class=”ws”> </span>new_content = data['choices'][0]['message']['content']</pre>
<pre class=”line after”><span class=”ws”> </span>new_content = new_content.replace("重新改写后:", "").replace("", "")</pre>
<pre class=”line after”><span class=”ws”> </span>new_content = new_content.replace("重新组织后:", "")</pre>
<pre class=”line after”><span class=”ws”> </span>new_content = new_content.replace("\n", "")</pre></div>
</div><li><div class=”frame” id=”frame-2552850466848″>
<h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\requests\models.py”</cite>,
line <em class=”line”>975</em>,
in <code class=”function”>json</code></h4>
<div class=”source library”><pre class=”line before”><span class=”ws”> </span>try:</pre>
<pre class=”line before”><span class=”ws”> </span>return complexjson.loads(self.text, **kwargs)</pre>
<pre class=”line before”><span class=”ws”> </span>except JSONDecodeError as e:</pre>
<pre class=”line before”><span class=”ws”> </span># Catch JSON-related errors and raise as requests.JSONDecodeError</pre>
<pre class=”line before”><span class=”ws”> </span># This aliases json.JSONDecodeError and simplejson.JSONDecodeError</pre>
<pre class=”line current”><span class=”ws”> </span>raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)</pre>
<pre class=”line after”><span class=”ws”></span> </pre>
<pre class=”line after”><span class=”ws”> </span>@property</pre>
<pre class=”line after”><span class=”ws”> </span>def links(self):</pre>
<pre class=”line after”><span class=”ws”> </span>"""Returns the parsed header links of the response, if any."""</pre>
<pre class=”line after”><span class=”ws”></span> </pre></div>
</div>
</ul>
<blockquote>requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
</blockquote>
</div><div class=”plain”>
<p>
This is the Copy/Paste friendly version of the traceback.
</p>
<textarea cols=”50″ rows=”10″ name=”code” readonly>Traceback (most recent call last):
File "F:\project\wxgzh\venv\lib\site-packages\requests\models.py", line 971, in json
return complexjson.loads(self.text, **kwargs)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)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 357, in get_new_content_chatglm
data = response.json()
File "F:\project\wxgzh\venv\lib\site-packages\requests\models.py", line 975, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
</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\requests\models.py”, line 971, in json
return complexjson.loads(self.text, **kwargs)
File “C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\__init__.py”, line 346, in loads
return _default_decoder.decode(s)
File “C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\decoder.py”, line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File “C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\decoder.py”, line 355, in raw_decode
raise JSONDecodeError(“Expecting value”, s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)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 357, in get_new_content_chatglm
data = response.json()
File “F:\project\wxgzh\venv\lib\site-packages\requests\models.py”, line 975, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)–>
8. 【腾讯云宣布降价并推出新产品】
腾讯云降低核心云产品价格,部分产品折扣高达40%;推出新一代高性能计算集群HCC;TI平台为开发者和企业客户提供全栈AI开发服务;发布小样本数智能生产平台。
9. 【Nuro公司裁员并停止商业化无人车部署】
据悉,无人车公司Nuro宣布大规模裁员,影响340人,占员工总数的30%。公司停止了其无人车的商业化部署,并暂停了第三代无人送货车R3的生产。Nuro曾获得21.3亿美元的投资,估值达86亿美元。然而,融资困难和高运营成本导致了这一决定。
10. 【谷歌Bard聊天机器人与大型语言模型的局限性】
谷歌Bard这样的大型语言模型(LLMs)具有诸多的局限性。在一项实验中,Bard无法识别单词“ketchup”中的字母“e”;LLMs缺乏智能,因为它们是基于数据训练的,无法像人类一样思考;语言不等同于知识,智能先于语言;聊天机器人可以揭示人类智能中被视为理所当然的方面。
11. 【Zoom投资AI初创公司Anthropic并计划整合Claude AI助手】
视频会议平台Zoom投资AI初创公司Anthropic,计划将Claude AI助手整合到其生产力平台中。Claude将首先整合到Zoom的全渠道联系中心产品中。Zoom已经与OpenAI合作,推出了其对话智能产品IQ。
12. 【OpenAI发布新的开源语言模型】
OpenAI将在四年后发布其首个开源语言模型,预计将改变大型模型的竞争格局。自ChatGPT创建以来,已经出现了几个开源模型。开源AI社区在模型和应用方面取得了重大进展。
13. 【Midjourney在中国推出后又消失了】
据报道,艺术生成平台Midjourney通过微信账号在中国推出,该账号发布了一篇文章称已开始接受Beta测试用户的申请,但第二天该帖子被删除。Midjourney在中国面临着履行合规要求和与国内已有的竞争对手竞争的挑战。
14. 【特斯拉股东大会:无继任计划,联合创始人回归,两款电动车亮相】
特斯拉在德克萨斯州奥斯汀举行年度股东大会,选举Straubel为独立董事。埃隆·马斯克透露了两款新电动车,并宣布特斯拉将尝试广告。马斯克认为特斯拉的长期价值将在其人形机器人Optimus中体现。
15. 【申请参加VB Transform 2023】
VentureBeat将于2023年7月11日至12日在旧金山举办VB Transform 2023活动。拥有新型生成AI技术的公司可以申请参加此次活动。将选择10个最具破坏性的产品在主舞台上展示,获胜者将在三个类别中获奖。申请截止日期为2023年6月1日,最多可展示20家创新公司的技术。
16. 【OpenAI CEO强调AI监管的必要性】
OpenAI首席执行官Sam Altman在参议院司法委员会听证会上强调了监管AI的重要性。他提出了对超过某些能力的AI模型进行许可和测试要求的建议。参议员们承认AI的变革性质以及了解其对选举、就业和安全的影响的必要性。AI专家和伦理学家,包括Timnit Gebru博士和Meredith Whitaker,也对AI监管提出了关注。
17. 【中关村科学城创新创业大赛启动】
中关村科学城创新创业大赛启动,重点关注人工智能和互联网3.0产业。比赛分为软硬件基础设施、内容生产和创作工具、虚拟和现实世界互动、安全和隐私四个核心赛道,分别面向初创企业和成长期企业。入围者将获得资金、人才、场地、投资和融资、场景建设以及产业链对接服务。
感谢您的关注,AI前沿观察将继续为您带来前沿、全面的人工智能资讯。请大家积极参与互动,点赞、评论、转发,让更多人了解AI的前沿动态。明天的速报,我们不见不散!
AI时代,拥有个人微信机器人AI助手!AI时代不落人后!
免费ChatGPT问答,办公、写作、生活好得力助手!
搜索微信号aigc666aigc999或上边扫码,即可拥有个人AI助手!
转载请注明: