命令行窗口返回信息如下:
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软件窗口一开始是报返回错误,后来好像服务器拒绝连接,然后就报:连接被服务器关闭了。
设置里面参数如下图:
![image](https://private-user-images.githubusercontent.com/131220899/238128986-8ef63ef5-3728-49ad-9f7f-86e72dd47d27.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQyMjA5MjYsIm5iZiI6MTcyNDIyMDYyNiwicGF0aCI6Ii8xMzEyMjA4OTkvMjM4MTI4OTg2LThlZjYzZWY1LTM3MjgtNDlhZC05ZjdmLTg2ZTcyZGQ0N2QyNy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwODIxJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDgyMVQwNjEwMjZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT03NDkwYjg1Y2EyYWQ5YzcxYzA2ODY4NzBkMzRmZjkzODNiNmQ4ODdkYTVkNzAxN2E5OGJmNWRiYWE2MTA0OWE4JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.2Z73TG0ODsJZ14RDppP30SZrjx2pLX7pORZuEjUnavc)
参数应该没问题。
ChatALL界面报错如下图:
![image](https://private-user-images.githubusercontent.com/131220899/238129004-fdc2253d-f130-49ae-bc37-915097caa17f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQyMjA5MjYsIm5iZiI6MTcyNDIyMDYyNiwicGF0aCI6Ii8xMzEyMjA4OTkvMjM4MTI5MDA0LWZkYzIyNTNkLWYxMzAtNDlhZS1iYzM3LTkxNTA5N2NhYTE3Zi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwODIxJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDgyMVQwNjEwMjZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT02ZjJlOGMzNDI1ZTc2NTIzOWUwOWJkZTg1NzI4NmJlMDc2OTE1MTY0ZmI1Y2Y2MmU1ZGZkMDA0YjJkNTdiNDZmJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.vIMmE7A0YzaOJp56qwv_4ZAyCtoIheh2i1qi6U85WY0)
最后就是连接被服务器拒绝了。。。
机器环境:
联想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页面对话一直都正常,见下图:
![image](https://private-user-images.githubusercontent.com/131220899/238129223-0272d707-a11d-4c48-b59e-1b2bb59518de.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQyMjA5MjYsIm5iZiI6MTcyNDIyMDYyNiwicGF0aCI6Ii8xMzEyMjA4OTkvMjM4MTI5MjIzLTAyNzJkNzA3LWExMWQtNGM0OC1iNTllLTFiMmJiNTk1MThkZS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwODIxJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDgyMVQwNjEwMjZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT01OTBjOGY1YTAyMTlmMjBkYzU2YzNlZjdjMDljMDYzODkzZmNkYTNlYjlmMzAzYzAwODE2ZmNiM2M4NDcwYTFjJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.1aaupuHWk6w1UspTVwjlZ08m0li7TFUfyen9I9FJkpc)
估计是ChatALL软件调用方式有不太完善的地方,请版主分析。
另外,ChatGLM支持API调用?版主为什么不采用更稳定的API调用呢?
还有一个问题就是,ChatALL点击扫帚图标,清空对话历史后,输入框再也无法输入了。