IndexError: Cannot choose from an empty sequence // Werkzeug Debugger var CONSOLE_MODE = false, EVALEX = true, EVALEX_TRUSTED = false, SECRET = "Cztug1SITH6VWk19YYTC";
IndexError
IndexError: Cannot choose from an empty sequence
Traceback(most recent call last)
The above exception was the direct cause of the following exception:File "/usr/local/python3/lib/python3.7/site-packages/flask/app.py", line2551, in__call__
def __call__(self, environ: dict, start_response: t.Callable) -> t.Any:
"""The WSGI server calls the Flask application object as the
WSGI application. This calls :meth:`wsgi_app`, which can be
wrapped to apply middleware.
"""
return self.wsgi_app(environ, start_response)
File "/usr/local/python3/lib/python3.7/site-packages/flask/app.py", line2531, inwsgi_app
try:
ctx.push()
response = self.full_dispatch_request()
except Exception as e:
error = e
response = self.handle_exception(e)
except: # noqa: B001
error = sys.exc_info()[1]
raise
return response(environ, start_response)
finally:
File "/usr/local/python3/lib/python3.7/site-packages/flask/app.py", line2528, inwsgi_app
ctx = self.request_context(environ)
error: t.Optional[BaseException] = None
try:
try:
ctx.push()
response = self.full_dispatch_request()
except Exception as e:
error = e
response = self.handle_exception(e)
except: # noqa: B001
error = sys.exc_info()[1]
File "/usr/local/python3/lib/python3.7/site-packages/flask/app.py", line1825, infull_dispatch_request
request_started.send(self)
rv = self.preprocess_request()
if rv is None:
rv = self.dispatch_request()
except Exception as e:
rv = self.handle_user_exception(e)
return self.finalize_request(rv)
def finalize_request(
self,
rv: t.Union[ft.ResponseReturnValue, HTTPException],
File "/usr/local/python3/lib/python3.7/site-packages/flask/app.py", line1823, infull_dispatch_request
try:
request_started.send(self)
rv = self.preprocess_request()
if rv is None:
rv = self.dispatch_request()
except Exception as e:
rv = self.handle_user_exception(e)
return self.finalize_request(rv)
def finalize_request(
File "/usr/local/python3/lib/python3.7/site-packages/flask/app.py", line1799, indispatch_request
and req.method == "OPTIONS"
):
return self.make_default_options_response()
# otherwise dispatch to the handler for that endpoint
view_args: t.Dict[str, t.Any] = req.view_args # type: ignore[assignment]
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
def full_dispatch_request(self) -> Response:
"""Dispatches the request and on top of that performs request
pre and postprocessing as well as HTTP exception catching and
error handling.
File "/www/wwwroot/chat.py", line39, ingen_header
# post入参访问方式二:from-data(k-v)格式参数
@api.route('/gen_header', methods=['post'])
def gen_header():
wd = flask.request.values.get('wd')
future = executor.submit(do_heavy_work,wd)
return str(future.result())
def do_heavy_work(wd):
prompt = wd
#openai.api_key = api_key_list[-1]
openai.api_key = random.choice(api_key_list)
File "/usr/local/python3/lib/python3.7/concurrent/futures/_base.py", line435, inresult
self._condition.wait(timeout)
if self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]:
raise CancelledError()
elif self._state == FINISHED:
return self.__get_result()
else:
raise TimeoutError()
def exception(self, timeout=None):
"""Return the exception raised by the call that the future represents.
File "/usr/local/python3/lib/python3.7/concurrent/futures/_base.py", line384, in__get_result
with self._condition:
return self._state in [CANCELLED, CANCELLED_AND_NOTIFIED, FINISHED]
def __get_result(self):
if self._exception:
raise self._exception
else:
return self._result
def add_done_callback(self, fn):
"""Attaches a callable that will be called when the future finishes.IndexError: Cannot choose from an empty sequence
This is the Copy/Paste friendly version of the traceback.
concurrent.futures.process._RemoteTraceback: """Traceback (most recent call last): File "/usr/local/python3/lib/python3.7/concurrent/futures/process.py", line 239, in _process_worker r = call_item.fn(*call_item.args, **call_item.kwargs) File "/www/wwwroot/chat.py", line 44, in do_heavy_work openai.api_key = random.choice(api_key_list) File "/usr/local/python3/lib/python3.7/random.py", line 261, in choice raise IndexError('Cannot choose from an empty sequence') from NoneIndexError: Cannot choose from an empty sequence"""The above exception was the direct cause of the following exception:Traceback (most recent call last): File "/usr/local/python3/lib/python3.7/site-packages/flask/app.py", line 2551, in __call__ return self.wsgi_app(environ, start_response) File "/usr/local/python3/lib/python3.7/site-packages/flask/app.py", line 2531, in wsgi_app response = self.handle_exception(e) File "/usr/local/python3/lib/python3.7/site-packages/flask/app.py", line 2528, in wsgi_app response = self.full_dispatch_request() File "/usr/local/python3/lib/python3.7/site-packages/flask/app.py", line 1825, in full_dispatch_request rv = self.handle_user_exception(e) File "/usr/local/python3/lib/python3.7/site-packages/flask/app.py", line 1823, in full_dispatch_request rv = self.dispatch_request() File "/usr/local/python3/lib/python3.7/site-packages/flask/app.py", line 1799, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) File "/www/wwwroot/chat.py", line 39, in gen_header return str(future.result()) File "/usr/local/python3/lib/python3.7/concurrent/futures/_base.py", line 435, in result return self.__get_result() File "/usr/local/python3/lib/python3.7/concurrent/futures/_base.py", line 384, in __get_result raise self._exceptionIndexError: Cannot choose from an empty sequenceThe debugger caught an exception in your WSGI application. You can now look at the traceback which led to the error. 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.Brought to you byDON'T PANIC, your friendly Werkzeug powered traceback interpreter.Console Locked
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.
PIN:
你有哪些不错的网站推荐?
不错的网站推荐:
1、秘书
秘书是专为自媒体人打造的免费无版权、可商用素材网站,主要有图片、音频和视频,以及隐藏的超级福利,绝对是经典大作。无需登录就能下载素材,资源全部免费,绝对是个宝藏网站。
2、videvo
videvo这个站包含了大量的视频、音乐和音效的下载,在视频方面它更加丰富的是,你可以找到很实用的动画,比如倒计时、地球自转等,很多素材资源都可以免费下载和商用,干货满满!
3、办公资源
不管你现在是学生还是职业人士,PPT是必不可少的一个必选项,这个网站有各种各样的PPT模板、课件、图表,支持一键修改套用,此外还有全套PPT教程供我们学习,真的很良心。
4、OfficePLUS
说到PPT模板你可能没想到,其实微软也有一个自己的模板网站,需要登录微软账号无限下载,如果不登的话,一个月只有3次下载次数,模板设计感十足,可以应付绝大部分场合。
5、Wallhaven
国外的图片网站,打开速度相对较慢,但正常访问还是没问题的。里面不仅图片资源广泛,风格与类型也极其之多,图片画质从1080P到2K、4K甚至8K,是一个专注于高画质的图片平台。
宝子们,我最近发现了一个神仙网站,不用登陆,不用注册,就可以浏览全站!
锵锵~那个网站就叫做“种草之家”你输入种草之家有两个,是那个看起来比较简陋,都是不用登陆的那一个,我为什么说它宝藏嘞?你听我慢慢跟你说~
首先嘞,这个网站是一个种草分享网站,种草生活平价好物,安利高质量电影,推荐优质书籍,分享美味零食,还有安利化妆品等等的网站,而且它还有好看的壁纸推荐,好句摘抄等等,是不是看起来有点杂,没关系,它都给你分好类了,你想看那个点相应的类目just
ok~然后吼~里面推荐的东西(大概)都是站主自己买过觉得OK的,我一开始还不信,后来,被站主的一篇小零食的文章馋到了,就那个萨拉咪小鸡腿,试了一下,呜呜,是真的香
┭┮﹏┭┮,后来又陆陆续续买了一些那个网站推荐的东西,基本都没踩过雷。
然后除了吃吃喝喝,那个网站还推荐一些书,我看了几本,都还不错,但是最最重要的是,它还安利了好多宝藏网站,身为一个时时要上网查资料的大学生,这些网站可以说救我狗命好伐!大家可以去看它最近发的几篇网站推荐的文章,你会回来感谢我的(dog)~
有哪些相见恨晚的在线网站?
百度脑图

艺屿EYESVOT|艺术网站
山与君说两个艺术爱好者一见就相见恨晚的在线网站。
一,数字敦煌
网站将敦煌的壁画运用VR、3D等科技手段,高清还原壁画的本来面貌,对于敦煌壁画研究者和爱好者,真是绝好的材料。
主页
莫高窟
全景漫游
高清图
二,谷歌艺文
特色是权威,高清,免费。小编每次进入APP或其官网就舍不得关闭,更重要的是谷歌的贴心翻译,在众多翻译软件中,谷歌是翻译得最准确的。
今天官网主页
详细分类,欲罢不能啊
全景漫游视频也很酷。
喜欢的朋友们,记得点个赞哦。
艺屿EYESVOT,山与君与你分享所思所感!
分享10个让你大开眼界的网站!全是私藏精品!
超小众,但绝对是真相定理界别,让你看一个爱一个!

版权声明:免责声明:本文来源网友投稿及网络整合仅代表文章作者的个人观点,与本站无关。其原创性、真实性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容文字的真实性、完整性和原创性本站不作任何保证或承诺,请读者仅作参考,并自行核实相关内容。投诉邮箱:1765130767@qq.com.