命令行窗口返回信息如下:
Traceback (most recent call last):
File "C:\Python\Python311\Lib\site-packages\gradio\routes.py", line 395, in run_predict
output = await app.get_blocks().process_api(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python\Python311\Lib\site-packages\gradio\blocks.py", line 1191, in process_api
inputs = self.preprocess_data(fn_index, inputs, state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python\Python311\Lib\site-packages\gradio\blocks.py", line 1027, in preprocess_data
self.validate_inputs(fn_index, inputs)
File "C:\Python\Python311\Lib\site-packages\gradio\blocks.py", line 1014, in validate_inputs
raise ValueError(
ValueError: An event handler (predict) didn't receive enough input values (needed: 6, got: 1).
Check if the event handler calls a Javascript function, and make sure its return value is correct.
Wanted inputs:
[textbox, chatbot, slider, slider, slider, state]
Received inputs:
["广州这个城市怎么样?"]
Traceback (most recent call last):
File "C:\Python\Python311\Lib\site-packages\gradio\routes.py", line 395, in run_predict
output = await app.get_blocks().process_api(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python\Python311\Lib\site-packages\gradio\blocks.py", line 1191, in process_api
inputs = self.preprocess_data(fn_index, inputs, state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python\Python311\Lib\site-packages\gradio\blocks.py", line 1027, in preprocess_data
self.validate_inputs(fn_index, inputs)
File "C:\Python\Python311\Lib\site-packages\gradio\blocks.py", line 1014, in validate_inputs
raise ValueError(
ValueError: An event handler (predict) didn't receive enough input values (needed: 6, got: 1).
Check if the event handler calls a Javascript function, and make sure its return value is correct.
Wanted inputs:
[textbox, chatbot, slider, slider, slider, state]
Received inputs:
["广州这个城市怎么样?"]
Traceback (most recent call last):
File "C:\Python\Python311\Lib\site-packages\gradio\routes.py", line 395, in run_predict
output = await app.get_blocks().process_api(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python\Python311\Lib\site-packages\gradio\blocks.py", line 1191, in process_api
inputs = self.preprocess_data(fn_index, inputs, state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python\Python311\Lib\site-packages\gradio\blocks.py", line 1027, in preprocess_data
self.validate_inputs(fn_index, inputs)
File "C:\Python\Python311\Lib\site-packages\gradio\blocks.py", line 1014, in validate_inputs
raise ValueError(
ValueError: An event handler (predict) didn't receive enough input values (needed: 6, got: 1).
Check if the event handler calls a Javascript function, and make sure its return value is correct.
Wanted inputs:
[textbox, chatbot, slider, slider, slider, state]
Received inputs:
["你好!"]
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "C:\Python\Python311\Lib\site-packages\uvicorn\protocols\websockets\websockets_impl.py", line 254, in run_asgi
result = await self.app(self.scope, self.asgi_receive, self.asgi_send)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python\Python311\Lib\site-packages\uvicorn\middleware\proxy_headers.py", line 78, in call
return await self.app(scope, receive, send)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python\Python311\Lib\site-packages\fastapi\applications.py", line 276, in call
await super().call(scope, receive, send)
File "C:\Python\Python311\Lib\site-packages\starlette\applications.py", line 122, in call
await self.middleware_stack(scope, receive, send)
File "C:\Python\Python311\Lib\site-packages\starlette\middleware\errors.py", line 149, in call
await self.app(scope, receive, send)
File "C:\Python\Python311\Lib\site-packages\starlette\middleware\cors.py", line 76, in call
await self.app(scope, receive, send)
File "C:\Python\Python311\Lib\site-packages\starlette\middleware\exceptions.py", line 79, in call
raise exc
File "C:\Python\Python311\Lib\site-packages\starlette\middleware\exceptions.py", line 68, in call
await self.app(scope, receive, sender)
File "C:\Python\Python311\Lib\site-packages\fastapi\middleware\asyncexitstack.py", line 21, in call
raise e
File "C:\Python\Python311\Lib\site-packages\fastapi\middleware\asyncexitstack.py", line 18, in call
await self.app(scope, receive, send)
File "C:\Python\Python311\Lib\site-packages\starlette\routing.py", line 718, in call
await route.handle(scope, receive, send)
File "C:\Python\Python311\Lib\site-packages\starlette\routing.py", line 341, in handle
await self.app(scope, receive, send)
File "C:\Python\Python311\Lib\site-packages\starlette\routing.py", line 82, in app
await func(session)
File "C:\Python\Python311\Lib\site-packages\fastapi\routing.py", line 289, in app
await dependant.call(**values)
File "C:\Python\Python311\Lib\site-packages\gradio\routes.py", line 518, in join_queue
if blocks.dependencies[event.fn_index].get("every", 0):
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
TypeError: list indices must be integers or slices, not str
ERROR: closing handshake failed
Traceback (most recent call last):
File "C:\Python\Python311\Lib\site-packages\websockets\legacy\server.py", line 248, in handler
await self.close()
File "C:\Python\Python311\Lib\site-packages\websockets\legacy\protocol.py", line 766, in close
await self.write_close_frame(Close(code, reason))
File "C:\Python\Python311\Lib\site-packages\websockets\legacy\protocol.py", line 1232, in write_close_frame
await self.write_frame(True, OP_CLOSE, data, _state=State.CLOSING)
File "C:\Python\Python311\Lib\site-packages\websockets\legacy\protocol.py", line 1205, in write_frame
await self.drain()
File "C:\Python\Python311\Lib\site-packages\websockets\legacy\protocol.py", line 1194, in drain
await self.ensure_open()
File "C:\Python\Python311\Lib\site-packages\websockets\legacy\protocol.py", line 935, in ensure_open
raise self.connection_closed_exc()
websockets.exceptions.ConnectionClosedError: sent 1000 (OK); no close frame received
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "C:\Python\Python311\Lib\site-packages\uvicorn\protocols\websockets\websockets_impl.py", line 254, in run_asgi
result = await self.app(self.scope, self.asgi_receive, self.asgi_send)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python\Python311\Lib\site-packages\uvicorn\middleware\proxy_headers.py", line 78, in call
return await self.app(scope, receive, send)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python\Python311\Lib\site-packages\fastapi\applications.py", line 276, in call
await super().call(scope, receive, send)
File "C:\Python\Python311\Lib\site-packages\starlette\applications.py", line 122, in call
await self.middleware_stack(scope, receive, send)
File "C:\Python\Python311\Lib\site-packages\starlette\middleware\errors.py", line 149, in call
await self.app(scope, receive, send)
File "C:\Python\Python311\Lib\site-packages\starlette\middleware\cors.py", line 76, in call
await self.app(scope, receive, send)
File "C:\Python\Python311\Lib\site-packages\starlette\middleware\exceptions.py", line 79, in call
raise exc
File "C:\Python\Python311\Lib\site-packages\starlette\middleware\exceptions.py", line 68, in call
await self.app(scope, receive, sender)
File "C:\Python\Python311\Lib\site-packages\fastapi\middleware\asyncexitstack.py", line 21, in call
raise e
File "C:\Python\Python311\Lib\site-packages\fastapi\middleware\asyncexitstack.py", line 18, in call
await self.app(scope, receive, send)
File "C:\Python\Python311\Lib\site-packages\starlette\routing.py", line 718, in call
await route.handle(scope, receive, send)
File "C:\Python\Python311\Lib\site-packages\starlette\routing.py", line 341, in handle
await self.app(scope, receive, send)
File "C:\Python\Python311\Lib\site-packages\starlette\routing.py", line 82, in app
await func(session)
File "C:\Python\Python311\Lib\site-packages\fastapi\routing.py", line 289, in app
await dependant.call(**values)
File "C:\Python\Python311\Lib\site-packages\gradio\routes.py", line 518, in join_queue
if blocks.dependencies[event.fn_index].get("every", 0):
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
TypeError: list indices must be integers or slices, not str
ERROR: closing handshake failed
Traceback (most recent call last):
File "C:\Python\Python311\Lib\site-packages\websockets\legacy\server.py", line 248, in handler
await self.close()
File "C:\Python\Python311\Lib\site-packages\websockets\legacy\protocol.py", line 766, in close
await self.write_close_frame(Close(code, reason))
File "C:\Python\Python311\Lib\site-packages\websockets\legacy\protocol.py", line 1232, in write_close_frame
await self.write_frame(True, OP_CLOSE, data, _state=State.CLOSING)
File "C:\Python\Python311\Lib\site-packages\websockets\legacy\protocol.py", line 1205, in write_frame
await self.drain()
File "C:\Python\Python311\Lib\site-packages\websockets\legacy\protocol.py", line 1194, in drain
await self.ensure_open()
File "C:\Python\Python311\Lib\site-packages\websockets\legacy\protocol.py", line 935, in ensure_open
raise self.connection_closed_exc()
websockets.exceptions.ConnectionClosedError: sent 1000 (OK); no close frame received
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "C:\Python\Python311\Lib\site-packages\uvicorn\protocols\websockets\websockets_impl.py", line 254, in run_asgi
result = await self.app(self.scope, self.asgi_receive, self.asgi_send)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python\Python311\Lib\site-packages\uvicorn\middleware\proxy_headers.py", line 78, in call
return await self.app(scope, receive, send)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python\Python311\Lib\site-packages\fastapi\applications.py", line 276, in call
await super().call(scope, receive, send)
File "C:\Python\Python311\Lib\site-packages\starlette\applications.py", line 122, in call
await self.middleware_stack(scope, receive, send)
File "C:\Python\Python311\Lib\site-packages\starlette\middleware\errors.py", line 149, in call
await self.app(scope, receive, send)
File "C:\Python\Python311\Lib\site-packages\starlette\middleware\cors.py", line 76, in call
await self.app(scope, receive, send)
File "C:\Python\Python311\Lib\site-packages\starlette\middleware\exceptions.py", line 79, in call
raise exc
File "C:\Python\Python311\Lib\site-packages\starlette\middleware\exceptions.py", line 68, in call
await self.app(scope, receive, sender)
File "C:\Python\Python311\Lib\site-packages\fastapi\middleware\asyncexitstack.py", line 21, in call
raise e
File "C:\Python\Python311\Lib\site-packages\fastapi\middleware\asyncexitstack.py", line 18, in call
await self.app(scope, receive, send)
File "C:\Python\Python311\Lib\site-packages\starlette\routing.py", line 718, in call
await route.handle(scope, receive, send)
File "C:\Python\Python311\Lib\site-packages\starlette\routing.py", line 341, in handle
await self.app(scope, receive, send)
File "C:\Python\Python311\Lib\site-packages\starlette\routing.py", line 82, in app
await func(session)
File "C:\Python\Python311\Lib\site-packages\fastapi\routing.py", line 289, in app
await dependant.call(**values)
File "C:\Python\Python311\Lib\site-packages\gradio\routes.py", line 518, in join_queue
if blocks.dependencies[event.fn_index].get("every", 0):
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
TypeError: list indices must be integers or slices, not str
ERROR: closing handshake failed
Traceback (most recent call last):
File "C:\Python\Python311\Lib\site-packages\websockets\legacy\server.py", line 248, in handler
await self.close()
File "C:\Python\Python311\Lib\site-packages\websockets\legacy\protocol.py", line 766, in close
await self.write_close_frame(Close(code, reason))
File "C:\Python\Python311\Lib\site-packages\websockets\legacy\protocol.py", line 1232, in write_close_frame
await self.write_frame(True, OP_CLOSE, data, _state=State.CLOSING)
File "C:\Python\Python311\Lib\site-packages\websockets\legacy\protocol.py", line 1205, in write_frame
await self.drain()
File "C:\Python\Python311\Lib\site-packages\websockets\legacy\protocol.py", line 1194, in drain
await self.ensure_open()
File "C:\Python\Python311\Lib\site-packages\websockets\legacy\protocol.py", line 935, in ensure_open
raise self.connection_closed_exc()
websockets.exceptions.ConnectionClosedError: sent 1000 (OK); no close frame received
ChatALL软件窗口一开始是报返回错误,后来好像服务器拒绝连接,然后就报:连接被服务器关闭了。
设置里面参数如下图:
参数应该没问题。
ChatALL界面报错如下图:
最后就是连接被服务器拒绝了。。。
机器环境:
联想P52笔记本,Windows 11 x64 版本,最新更新。
内存32GB,NIVIDA P3200显卡,6GB显存。
Python 3.11.3、Torch+CUDA是2.0+cu117,ChatGLM-6B原模型,通过.half().quantize(4).cuda()量化加载。
Gradio的Web页面对话一直都正常,见下图:
估计是ChatALL软件调用方式有不太完善的地方,请版主分析。
另外,ChatGLM支持API调用?版主为什么不采用更稳定的API调用呢?
还有一个问题就是,ChatALL点击扫帚图标,清空对话历史后,输入框再也无法输入了。