Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🙋 问题交流 - 图像识别不行 #1000

Open
isseluxx opened this issue Sep 27, 2024 · 32 comments
Open

🙋 问题交流 - 图像识别不行 #1000

isseluxx opened this issue Sep 27, 2024 · 32 comments
Labels
question Further information is requested

Comments

@isseluxx
Copy link

操作系统

Windows

Python 版本

3.10.11

AI Vtuber 版本

20240913

描述问题

图像识别不行,Gemini和智普AI,能补充一下吗?像 open ai 和开源 blip_image_captioning_large 来进行图像识别?感谢您所做的出色工作。
(抱歉,我正在使用翻译器的语言)

复现步骤

图像识别不行,Gemini和智普AI,能补充一下吗?像 open ai 和开源 blip_image_captioning_large 来进行图像识别?感谢您所做的出色工作。
(抱歉,我正在使用翻译器的语言)

期望的结果

No response

截图或日志

No response

@isseluxx isseluxx added the question Further information is requested label Sep 27, 2024
@isseluxx
Copy link
Author

log:`2024-09-27 15:01:51.206 | INFO | main:http_api_thread:256 - HTTP API线程已启动!
2024-09-27 15:48:28.050 | INFO | main:image_recognition_screenshot_and_send:6344 - 3.0后触发截图识别
2024-09-27 15:48:31.306 | INFO | utils.common:capture_window_by_title:1523 - 截图已保存到:D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\out\screenshots\Immersive Translate - Text Translation: One-click text translation, while comparing multiple translation services. - Google Chrome.png
2024-09-27 15:49:23.249 | ERROR | utils.gpt_model.gemini:get_resp_with_img:117 - Traceback (most recent call last):
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\google\api_core\grpc_helpers.py", line 79, in error_remapped_callable
return callable_(*args, **kwargs)
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\grpc_channel.py", line 1161, in call
return _end_unary_response_blocking(state, call, False, None)
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\grpc_channel.py", line 1004, in _end_unary_response_blocking
raise _InactiveRpcError(state) # pytype: disable=not-instantiable
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
status = StatusCode.UNAVAILABLE
details = "failed to connect to all addresses; last error: UNAVAILABLE: ipv4:127.0.0.1:10809: Connection refused"
debug_error_string = "UNKNOWN:failed to connect to all addresses; last error: UNAVAILABLE: ipv4:127.0.0.1:10809: Connection refused {created_time:"2024-09-27T12:49:23.098599271+00:00", grpc_status:14}"

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\google\api_core\retry.py", line 207, in retry_target
result = target()
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\google\api_core\timeout.py", line 120, in func_with_timeout
return func(*args, **kwargs)
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\google\api_core\grpc_helpers.py", line 81, in error_remapped_callable
raise exceptions.from_grpc_error(exc) from exc
google.api_core.exceptions.ServiceUnavailable: 503 failed to connect to all addresses; last error: UNAVAILABLE: ipv4:127.0.0.1:10809: Connection refused

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\utils\gpt_model\gemini.py", line 103, in get_resp_with_img
response = model.generate_content(
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\google\generativeai\generative_models.py", line 243, in generate_content
response = self._client.generate_content(request)
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\google\ai\generativelanguage_v1beta\services\generative_service\client.py", line 566, in generate_content
response = rpc(
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\google\api_core\gapic_v1\method.py", line 131, in call
return wrapped_func(*args, **kwargs)
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\google\api_core\retry.py", line 372, in retry_wrapped_func
return retry_target(
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\google\api_core\retry.py", line 226, in retry_target
raise exceptions.RetryError(
google.api_core.exceptions.RetryError: Deadline of 60.0s exceeded while calling target function, last exception: 503 failed to connect to all addresses; last error: UNAVAILABLE: ipv4:127.0.0.1:10809: Connection refused

2024-09-27 15:49:25.408 | ERROR | utils.common:send_request:1234 - Traceback (most recent call last):
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\urllib3\connection.py", line 196, in _new_conn
sock = connection.create_connection(
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\urllib3\util\connection.py", line 85, in create_connection
raise err
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\urllib3\util\connection.py", line 73, in create_connection
sock.connect(sa)
ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\urllib3\connectionpool.py", line 789, in urlopen
response = self._make_request(
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\urllib3\connectionpool.py", line 495, in _make_request
conn.request(
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\urllib3\connection.py", line 398, in request
self.endheaders()
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\http\client.py", line 1278, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\http\client.py", line 1038, in _send_output
self.send(msg)
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\http\client.py", line 976, in send
self.connect()
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\urllib3\connection.py", line 236, in connect
self.sock = self._new_conn()
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\urllib3\connection.py", line 211, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x000002263A8656F0>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it

The above exception was the direct cause of the following exception:

urllib3.exceptions.ProxyError: ('Unable to connect to proxy', NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000002263A8656F0>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it'))

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\requests\adapters.py", line 667, in send
resp = conn.urlopen(
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\urllib3\connectionpool.py", line 843, in urlopen
retries = retries.increment(
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\urllib3\util\retry.py", line 519, in increment
raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='127.0.0.1', port=10809): Max retries exceeded with url: http://127.0.0.1:8082/send (Caused by ProxyError('Unable to connect to proxy', NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000002263A8656F0>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\utils\common.py", line 1216, in send_request
response = requests.post(url, headers=headers, data=json.dumps(json_data), timeout=timeout)
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\requests\api.py", line 115, in post
return request("post", url, data=data, json=json, **kwargs)
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\requests\api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\requests\sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\requests\sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\requests\adapters.py", line 694, in send
raise ProxyError(e, request=request)
requests.exceptions.ProxyError: HTTPConnectionPool(host='127.0.0.1', port=10809): Max retries exceeded with url: http://127.0.0.1:8082/send (Caused by ProxyError('Unable to connect to proxy', NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000002263A8656F0>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it')))

2024-09-27 15:49:25.412 | ERROR | utils.common:send_request:1235 - 请求出错: HTTPConnectionPool(host='127.0.0.1', port=10809): Max retries exceeded with url: http://127.0.0.1:8082/send (Caused by ProxyError('Unable to connect to proxy', NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000002263A8656F0>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it')))
`

@isseluxx
Copy link
Author

Screenshot_690

@Ikaros-521
Copy link
Owner

log:`2024-09-27 15:01:51.206 | INFO | main:http_api_thread:256 - HTTP API线程已启动! 2024-09-27 15:48:28.050 | INFO | main:image_recognition_screenshot_and_send:6344 - 3.0后触发截图识别 2024-09-27 15:48:31.306 | INFO | utils.common:capture_window_by_title:1523 - 截图已保存到:D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\out\screenshots\Immersive Translate - Text Translation: One-click text translation, while comparing multiple translation services. - Google Chrome.png 2024-09-27 15:49:23.249 | ERROR | utils.gpt_model.gemini:get_resp_with_img:117 - Traceback (most recent call last): File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\google\api_core\grpc_helpers.py", line 79, in error_remapped_callable return callable_(*args, **kwargs) File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\grpc_channel.py", line 1161, in call return _end_unary_response_blocking(state, call, False, None) File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\grpc_channel.py", line 1004, in _end_unary_response_blocking raise _InactiveRpcError(state) # pytype: disable=not-instantiable grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with: status = StatusCode.UNAVAILABLE details = "failed to connect to all addresses; last error: UNAVAILABLE: ipv4:127.0.0.1:10809: Connection refused" debug_error_string = "UNKNOWN:failed to connect to all addresses; last error: UNAVAILABLE: ipv4:127.0.0.1:10809: Connection refused {created_time:"2024-09-27T12:49:23.098599271+00:00", grpc_status:14}"

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\google\api_core\retry.py", line 207, in retry_target result = target() File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\google\api_core\timeout.py", line 120, in func_with_timeout return func(*args, **kwargs) File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\google\api_core\grpc_helpers.py", line 81, in error_remapped_callable raise exceptions.from_grpc_error(exc) from exc google.api_core.exceptions.ServiceUnavailable: 503 failed to connect to all addresses; last error: UNAVAILABLE: ipv4:127.0.0.1:10809: Connection refused

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\utils\gpt_model\gemini.py", line 103, in get_resp_with_img response = model.generate_content( File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\google\generativeai\generative_models.py", line 243, in generate_content response = self._client.generate_content(request) File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\google\ai\generativelanguage_v1beta\services\generative_service\client.py", line 566, in generate_content response = rpc( File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\google\api_core\gapic_v1\method.py", line 131, in call return wrapped_func(*args, **kwargs) File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\google\api_core\retry.py", line 372, in retry_wrapped_func return retry_target( File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\google\api_core\retry.py", line 226, in retry_target raise exceptions.RetryError( google.api_core.exceptions.RetryError: Deadline of 60.0s exceeded while calling target function, last exception: 503 failed to connect to all addresses; last error: UNAVAILABLE: ipv4:127.0.0.1:10809: Connection refused

2024-09-27 15:49:25.408 | ERROR | utils.common:send_request:1234 - Traceback (most recent call last): File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\urllib3\connection.py", line 196, in _new_conn sock = connection.create_connection( File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\urllib3\util\connection.py", line 85, in create_connection raise err File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\urllib3\util\connection.py", line 73, in create_connection sock.connect(sa) ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\urllib3\connectionpool.py", line 789, in urlopen response = self._make_request( File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\urllib3\connectionpool.py", line 495, in _make_request conn.request( File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\urllib3\connection.py", line 398, in request self.endheaders() File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\http\client.py", line 1278, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\http\client.py", line 1038, in _send_output self.send(msg) File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\http\client.py", line 976, in send self.connect() File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\urllib3\connection.py", line 236, in connect self.sock = self._new_conn() File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\urllib3\connection.py", line 211, in _new_conn raise NewConnectionError( urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x000002263A8656F0>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it

The above exception was the direct cause of the following exception:

urllib3.exceptions.ProxyError: ('Unable to connect to proxy', NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000002263A8656F0>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it'))

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\requests\adapters.py", line 667, in send resp = conn.urlopen( File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\urllib3\connectionpool.py", line 843, in urlopen retries = retries.increment( File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\urllib3\util\retry.py", line 519, in increment raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='127.0.0.1', port=10809): Max retries exceeded with url: http://127.0.0.1:8082/send (Caused by ProxyError('Unable to connect to proxy', NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000002263A8656F0>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\utils\common.py", line 1216, in send_request response = requests.post(url, headers=headers, data=json.dumps(json_data), timeout=timeout) File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\requests\api.py", line 115, in post return request("post", url, data=data, json=json, **kwargs) File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\requests\api.py", line 59, in request return session.request(method=method, url=url, **kwargs) File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\requests\sessions.py", line 589, in request resp = self.send(prep, **send_kwargs) File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\requests\sessions.py", line 703, in send r = adapter.send(request, **kwargs) File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\requests\adapters.py", line 694, in send raise ProxyError(e, request=request) requests.exceptions.ProxyError: HTTPConnectionPool(host='127.0.0.1', port=10809): Max retries exceeded with url: http://127.0.0.1:8082/send (Caused by ProxyError('Unable to connect to proxy', NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000002263A8656F0>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it')))

2024-09-27 15:49:25.412 | ERROR | utils.common:send_request:1235 - 请求出错: HTTPConnectionPool(host='127.0.0.1', port=10809): Max retries exceeded with url: http://127.0.0.1:8082/send (Caused by ProxyError('Unable to connect to proxy', NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000002263A8656F0>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it'))) `

谷歌代理连接失败

google.api_core.exceptions.RetryError: Deadline of 60.0s exceeded while calling target function, last exception: 503 failed to connect to all addresses; last error: UNAVAILABLE: ipv4:127.0.0.1:10809: Connection refused

@Ikaros-521
Copy link
Owner

Caused by ProxyError('Unable to connect to proxy', NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000002263A8656F0>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it'

你确定你开了代理 并且端口正确吗

@isseluxx
Copy link
Author

感谢您回答我的问题,我尝试了这个代理:http://guardian-antenna-finish-sublime.trycloudflare.com,但我遇到了这个问题,日志:`2024-09-27 16:23:26.108 | INFO | main:image_recognition_screenshot_and_send:6344 - 3.0后触发截图识别
2024-09-27 16:23:29.285 | INFO | utils.common:capture_window_by_title:1523 - 截图已保存到:D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\out\screenshots\bad adcens ip.png ‎- Photos.png
2024-09-27 16:24:24.000 | ERROR | utils.gpt_model.gemini:get_resp_with_img:117 - Traceback (most recent call last):
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\google\api_core\grpc_helpers.py", line 79, in error_remapped_callable
return callable_(*args, **kwargs)
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\grpc_channel.py", line 1161, in call
return _end_unary_response_blocking(state, call, False, None)
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\grpc_channel.py", line 1004, in _end_unary_response_blocking
raise _InactiveRpcError(state) # pytype: disable=not-instantiable
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
status = StatusCode.UNAVAILABLE
details = "failed to connect to all addresses; last error: UNKNOWN: ipv4:104.16.231.132:443: HTTP proxy returned response code 400"
debug_error_string = "UNKNOWN:failed to connect to all addresses; last error: UNKNOWN: ipv4:104.16.231.132:443: HTTP proxy returned response code 400 {grpc_status:14, created_time:"2024-09-27T13:24:23.99744159+00:00"}"

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\google\api_core\retry.py", line 207, in retry_target
result = target()
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\google\api_core\timeout.py", line 120, in func_with_timeout
return func(*args, **kwargs)
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\google\api_core\grpc_helpers.py", line 81, in error_remapped_callable
raise exceptions.from_grpc_error(exc) from exc
google.api_core.exceptions.ServiceUnavailable: 503 failed to connect to all addresses; last error: UNKNOWN: ipv4:104.16.231.132:443: HTTP proxy returned response code 400

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\utils\gpt_model\gemini.py", line 103, in get_resp_with_img
response = model.generate_content(
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\google\generativeai\generative_models.py", line 243, in generate_content
response = self._client.generate_content(request)
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\google\ai\generativelanguage_v1beta\services\generative_service\client.py", line 566, in generate_content
response = rpc(
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\google\api_core\gapic_v1\method.py", line 131, in call
return wrapped_func(*args, **kwargs)
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\google\api_core\retry.py", line 372, in retry_wrapped_func
return retry_target(
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\google\api_core\retry.py", line 226, in retry_target
raise exceptions.RetryError(
google.api_core.exceptions.RetryError: Deadline of 60.0s exceeded while calling target function, last exception: 503 failed to connect to all addresses; last error: UNKNOWN: ipv4:104.16.231.132:443: HTTP proxy returned response code 400

2024-09-27 16:24:24.221 | ERROR | utils.common:send_request:1234 - Traceback (most recent call last):
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\utils\common.py", line 1221, in send_request
response.raise_for_status()
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\requests\models.py", line 1024, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: http://127.0.0.1:8082/send

2024-09-27 16:24:24.227 | ERROR | utils.common:send_request:1235 - 请求出错: 403 Client Error: Forbidden for url: http://127.0.0.1:8082/send
`

@isseluxx
Copy link
Author

如果您可以添加 blip_image_captioning_large 或/和 OpenAI,那就太好了

@Ikaros-521
Copy link
Owner

Ikaros-521 commented Sep 27, 2024

感谢您回答我的问题,我尝试了这个代理:http://guardian-antenna-finish-sublime.trycloudflare.com,但我遇到了这个问题,日志:`2024-09-27 16:23:26.108 | INFO | main:image_recognition_screenshot_and_send:6344 - 3.0后触发截图识别 2024-09-27 16:23:29.285 | INFO | utils.common:capture_window_by_title:1523 - 截图已保存到:D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\out\screenshots\bad adcens ip.png ‎- Photos.png 2024-09-27 16:24:24.000 | ERROR | utils.gpt_model.gemini:get_resp_with_img:117 - Traceback (most recent call last): File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\google\api_core\grpc_helpers.py", line 79, in error_remapped_callable return callable_(*args, **kwargs) File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\grpc_channel.py", line 1161, in call return _end_unary_response_blocking(state, call, False, None) File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\grpc_channel.py", line 1004, in _end_unary_response_blocking raise _InactiveRpcError(state) # pytype: disable=not-instantiable grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with: status = StatusCode.UNAVAILABLE details = "failed to connect to all addresses; last error: UNKNOWN: ipv4:104.16.231.132:443: HTTP proxy returned response code 400" debug_error_string = "UNKNOWN:failed to connect to all addresses; last error: UNKNOWN: ipv4:104.16.231.132:443: HTTP proxy returned response code 400 {grpc_status:14, created_time:"2024-09-27T13:24:23.99744159+00:00"}"

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\google\api_core\retry.py", line 207, in retry_target result = target() File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\google\api_core\timeout.py", line 120, in func_with_timeout return func(*args, **kwargs) File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\google\api_core\grpc_helpers.py", line 81, in error_remapped_callable raise exceptions.from_grpc_error(exc) from exc google.api_core.exceptions.ServiceUnavailable: 503 failed to connect to all addresses; last error: UNKNOWN: ipv4:104.16.231.132:443: HTTP proxy returned response code 400

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\utils\gpt_model\gemini.py", line 103, in get_resp_with_img response = model.generate_content( File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\google\generativeai\generative_models.py", line 243, in generate_content response = self._client.generate_content(request) File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\google\ai\generativelanguage_v1beta\services\generative_service\client.py", line 566, in generate_content response = rpc( File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\google\api_core\gapic_v1\method.py", line 131, in call return wrapped_func(*args, **kwargs) File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\google\api_core\retry.py", line 372, in retry_wrapped_func return retry_target( File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\google\api_core\retry.py", line 226, in retry_target raise exceptions.RetryError( google.api_core.exceptions.RetryError: Deadline of 60.0s exceeded while calling target function, last exception: 503 failed to connect to all addresses; last error: UNKNOWN: ipv4:104.16.231.132:443: HTTP proxy returned response code 400

2024-09-27 16:24:24.221 | ERROR | utils.common:send_request:1234 - Traceback (most recent call last): File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\utils\common.py", line 1221, in send_request response.raise_for_status() File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\requests\models.py", line 1024, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: http://127.0.0.1:8082/send

2024-09-27 16:24:24.227 | ERROR | utils.common:send_request:1235 - 请求出错: 403 Client Error: Forbidden for url: http://127.0.0.1:8082/send `

代理不能代理 localhost,8082是程序内部HTTP服务,代理影响了数据发送
The proxy cannot proxy localhost, and 8082 is an internal HTTP service of the program. The proxy has affected the data transmission

@Ikaros-521
Copy link
Owner

Ikaros-521 commented Sep 27, 2024

如果您可以添加 blip_image_captioning_large 或/和 OpenAI,那就太好了

OpenAI 没有密钥(没经费),blip_image_captioning_large 没听说过,有空的话可以看看
OpenAI has no key (no budget), and I haven't heard of blip_image_captioning_large; if you have time, you can check it out

@isseluxx
Copy link
Author

谢谢你的回答,我不知道 Gemini 代理是如何工作的,如何在启动 (1.双击我启动程序.bat) 之前启动代理?
(127.0.0.1:10809) 是默认代理,我该如何运行它?

@Ikaros-521
Copy link
Owner

谢谢你的回答,我不知道 Gemini 代理是如何工作的,如何在启动 (1.双击我启动程序.bat) 之前启动代理? (127.0.0.1:10809) 是默认代理,我该如何运行它?

如果你是在国外 可以直接访问gemini api,那就不需要启动代理。在“聊天”模式下,一键运行程序,然后再进行 摄像头识别操作
If you are abroad and can directly access the Gemini API, then there is no need to start the proxy. In 'chat' mode, run the program with one click, and then proceed with the camera recognition operation

@isseluxx
Copy link
Author

是的,我来自国外,可以直接访问 Gemini API,但是当我一键运行程序并尝试运行图像识别时,我遇到了第一个问题。

@Ikaros-521
Copy link
Owner

是的,我来自国外,可以直接访问 Gemini API,但是当我一键运行程序并尝试运行图像识别时,我遇到了第一个问题。

第一个问题日志说明 并没有关闭代理,导致请求发送失败,配置修改后需要保存重启
The first issue in the log indicates that the proxy was not turned off, which led to a request sending failure. After modifying the configuration, it needs to be saved and the system restarted

@isseluxx
Copy link
Author

我应该删除 (127.0.0.1:10809) 并将其留空吗?
关闭代理?

@isseluxx
Copy link
Author

log: `2024-09-27 17:16:37.333 | INFO | utils.common:capture_window_by_title:1523 - 截图已保存到:D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\out\screenshots\Channel content - YouTube Studio - Opera.png
2024-09-27 17:16:39.729 | ERROR | utils.gpt_model.gemini:get_resp_with_img:117 - Traceback (most recent call last):
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\google\api_core\grpc_helpers.py", line 79, in error_remapped_callable
return callable_(*args, **kwargs)
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\grpc_channel.py", line 1161, in call
return _end_unary_response_blocking(state, call, False, None)
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\grpc_channel.py", line 1004, in _end_unary_response_blocking
raise _InactiveRpcError(state) # pytype: disable=not-instantiable
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
status = StatusCode.NOT_FOUND
details = "Gemini 1.0 Pro Vision has been deprecated on July 12, 2024. Consider switching to different model, for example gemini-1.5-flash."
debug_error_string = "UNKNOWN:Error received from peer ipv6:%5B2a00:1450:4006:800::200a%5D:443 {grpc_message:"Gemini 1.0 Pro Vision has been deprecated on July 12, 2024. Consider switching to different model, for example gemini-1.5-flash.", grpc_status:5, created_time:"2024-09-27T14:16:39.714903561+00:00"}"

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\utils\gpt_model\gemini.py", line 103, in get_resp_with_img
response = model.generate_content(
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\google\generativeai\generative_models.py", line 243, in generate_content
response = self._client.generate_content(request)
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\google\ai\generativelanguage_v1beta\services\generative_service\client.py", line 566, in generate_content
response = rpc(
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\google\api_core\gapic_v1\method.py", line 131, in call
return wrapped_func(*args, **kwargs)
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\google\api_core\retry.py", line 372, in retry_wrapped_func
return retry_target(
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\google\api_core\retry.py", line 207, in retry_target
result = target()
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\google\api_core\timeout.py", line 120, in func_with_timeout
return func(*args, **kwargs)
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\google\api_core\grpc_helpers.py", line 81, in error_remapped_callable
raise exceptions.from_grpc_error(exc) from exc
google.api_core.exceptions.NotFound: 404 Gemini 1.0 Pro Vision has been deprecated on July 12, 2024. Consider switching to different model, for example gemini-1.5-flash.

2024-09-27 17:16:39.780 | ERROR | utils.common:send_request:1234 - Traceback (most recent call last):
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\utils\common.py", line 1221, in send_request
response.raise_for_status()
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\requests\models.py", line 1024, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 422 Client Error: Unprocessable Entity for url: http://127.0.0.1:8082/send

2024-09-27 17:16:39.790 | ERROR | utils.common:send_request:1235 - 请求出错: 422 Client Error: Unprocessable Entity for url: http://127.0.0.1:8082/send`

@Ikaros-521
Copy link
Owner

我应该删除 (127.0.0.1:10809) 并将其留空吗? 关闭代理?

清空吧,不过我可能默认写死了走代理过
Clear it, but I might have hardcoded it to go through the proxy by default.

@Ikaros-521
Copy link
Owner

配置留空的情况下,gemini不会走代理过,可以尝试一下
另外 这个gemini的模型 可能失效了 需要替换,源码内是写死的,需要直接修改源码了

google.api_core.exceptions.NotFound: 404 Gemini 1.0 Pro Vision has been deprecated on July 12, 2024. Consider switching to different model, for example gemini-1.5-flash.

@isseluxx
Copy link
Author

非常感谢您的帮助,我尝试修改源代码并从 Gemini 中删除 http/https 代理,我还将模型更改为 gemini-1.5-flash,结果是 Gemini llm 运行良好,但image_recognition在 Gemini 和 Zhipu AI 上不起作用,我收到了这个日志。

`2024-09-29 02:37:27.596 | INFO | main:image_recognition_screenshot_and_send:6345 - 3.0后触发截图识别
2024-09-29 02:37:30.844 | INFO | utils.common:capture_window_by_title:1523 - 截图已保存到:D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\out\screenshots\image.jpg ‎- Photos.png
2024-09-29 02:37:34.615 | ERROR | utils.common:send_request:1234 - Traceback (most recent call last):
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\utils\common.py", line 1221, in send_request
response.raise_for_status()
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\requests\models.py", line 1024, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 422 Client Error: Unprocessable Entity for url: http://127.0.0.1:8082/send

2024-09-29 02:37:34.617 | ERROR | utils.common:send_request:1235 - 请求出错: 422 Client Error: Unprocessable Entity for url: http://127.0.0.1:8082/send
`

Screenshot_692

@isseluxx
Copy link
Author

2024-09-29 14:23:09.899 | WARNING | utils.my_handle:image_recognition_schedule_handle:3441 - 警告:gemini无返回 2024-09-29 14:23:23.191 | INFO | __main__:image_recognition_schedule_task:1494 - 图像识别-窗口截图 定时任务触发 2024-09-29 14:23:23.338 | ERROR | utils.common:convert_digits_to_chinese:318 - 转换数字到中文时出错: 'NoneType' object is not iterable 2024-09-29 14:23:24.382 | INFO | utils.common:capture_window_by_title:1523 - 截图已保存到:D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\out\screenshots\image.jpg ‎- Photos.png 2024-09-29 14:23:24.561 | ERROR | utils.my_handle:llm_handle:1562 - Traceback (most recent call last): File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\utils\my_handle.py", line 1542, in llm_handle resp_content = chat_model_methods.get(chat_type, lambda: data["content"])() File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\utils\my_handle.py", line 1537, in <lambda> "gemini": lambda: self.image_recognition_model.get_resp_with_img(data["content"], data["img_data"]), AttributeError: 'NoneType' object has no attribute 'get_resp_with_img'

Screenshot_693

@Ikaros-521
Copy link
Owner

2024-09-29 14:23:09.899 | WARNING | utils.my_handle:image_recognition_schedule_handle:3441 - 警告:gemini无返回 2024-09-29 14:23:23.191 | INFO | __main__:image_recognition_schedule_task:1494 - 图像识别-窗口截图 定时任务触发 2024-09-29 14:23:23.338 | ERROR | utils.common:convert_digits_to_chinese:318 - 转换数字到中文时出错: 'NoneType' object is not iterable 2024-09-29 14:23:24.382 | INFO | utils.common:capture_window_by_title:1523 - 截图已保存到:D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\out\screenshots\image.jpg ‎- Photos.png 2024-09-29 14:23:24.561 | ERROR | utils.my_handle:llm_handle:1562 - Traceback (most recent call last): File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\utils\my_handle.py", line 1542, in llm_handle resp_content = chat_model_methods.get(chat_type, lambda: data["content"])() File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\utils\my_handle.py", line 1537, in <lambda> "gemini": lambda: self.image_recognition_model.get_resp_with_img(data["content"], data["img_data"]), AttributeError: 'NoneType' object has no attribute 'get_resp_with_img'

Screenshot_693

这很奇怪,感觉是实例化失败了,我看看我这能不能测试一下吧
This is quite strange. It seems like the instantiation failed. Let me see if I can test it out

@Ikaros-521
Copy link
Owner

I looked at gemini changed a lot, and it is indeed difficult to restore and use it for a while.
我看了下gemini改了很多,确实 一时半会难以恢复可用了。

@isseluxx
Copy link
Author

I looked at gemini changed a lot, and it is indeed difficult to restore and use it for a while. 我看了下gemini改了很多,确实 一时半会难以恢复可用了。

非常感谢您抽出时间关注这件事,如果有更好的选择,您可以添加,这将有很大帮助

@Ikaros-521
Copy link
Owner

Ikaros-521 commented Sep 29, 2024

2024-09-29 14:23:09.899 | WARNING | utils.my_handle:image_recognition_schedule_handle:3441 - 警告:gemini无返回 2024-09-29 14:23:23.191 | INFO | __main__:image_recognition_schedule_task:1494 - 图像识别-窗口截图 定时任务触发 2024-09-29 14:23:23.338 | ERROR | utils.common:convert_digits_to_chinese:318 - 转换数字到中文时出错: 'NoneType' object is not iterable 2024-09-29 14:23:24.382 | INFO | utils.common:capture_window_by_title:1523 - 截图已保存到:D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\out\screenshots\image.jpg ‎- Photos.png 2024-09-29 14:23:24.561 | ERROR | utils.my_handle:llm_handle:1562 - Traceback (most recent call last): File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\utils\my_handle.py", line 1542, in llm_handle resp_content = chat_model_methods.get(chat_type, lambda: data["content"])() File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\utils\my_handle.py", line 1537, in <lambda> "gemini": lambda: self.image_recognition_model.get_resp_with_img(data["content"], data["img_data"]), AttributeError: 'NoneType' object has no attribute 'get_resp_with_img'

image

zhipu ai 修改源码 模型为 glm-4v-plus 可以哦回复使用

@isseluxx
Copy link
Author

我将型号更改为 glm-4v-plus,当我按下屏幕截图并发送时,我得到了此日志,

`2024-09-29 17:02:27.034 | INFO | main:http_api_thread:256 - HTTP API线程已启动!
2024-09-29 17:02:40.191 | INFO | main:image_recognition_screenshot_and_send:6362 - 3.0后触发截图识别
2024-09-29 17:02:43.414 | INFO | utils.common:capture_window_by_title:1523 - 截图已保存到:D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\out\screenshots\image.jpg ‎- Photos.png
2024-09-29 17:02:43.904 | ERROR | utils.gpt_model.zhipu:get_zhipu_resp:221 - Traceback (most recent call last):
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\utils\gpt_model\zhipu.py", line 216, in get_zhipu_resp
top_p=float(self.config_data["top_p"]),
KeyError: 'top_p'

2024-09-29 17:02:43.910 | ERROR | utils.common:send_request:1234 - Traceback (most recent call last):
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\utils\common.py", line 1221, in send_request
response.raise_for_status()
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\requests\models.py", line 1024, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 422 Client Error: Unprocessable Entity for url: http://127.0.0.1:8082/send`

当我激活 (循环截图并发送) 时,我得到了这个日志,

`2024-09-29 17:01:29.128 | INFO | main:http_api_thread:256 - HTTP API线程已启动!
2024-09-29 17:01:36.346 | INFO | main:image_recognition_schedule_task:1494 - 图像识别-窗口截图 定时任务触发
2024-09-29 17:01:36.449 | ERROR | utils.common:convert_digits_to_chinese:318 - 转换数字到中文时出错: 'NoneType' object is not iterable
2024-09-29 17:01:44.712 | INFO | utils.common:capture_window_by_title:1523 - 截图已保存到:D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\out\screenshots\image.jpg ‎- Photos.png
2024-09-29 17:01:45.276 | INFO | utils.gpt_model.gpt:get:86 - GPT_MODEL: 进入get方法
2024-09-29 17:01:45.530 | ERROR | utils.gpt_model.zhipu:get_zhipu_resp:221 - Traceback (most recent call last):
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\utils\gpt_model\zhipu.py", line 216, in get_zhipu_resp
top_p=float(self.config_data["top_p"]),
KeyError: 'top_p'

2024-09-29 17:01:45.715 | WARNING | utils.my_handle:llm_handle:1555 - LLM没有正确返回数据,请排查配置、网络等是否正常。如果排查后都没有问题,可能是接口改动导致的兼容性问题,可以前往官方仓库提交issue,传送门:https://github.com/Ikaros-521/AI-Vtuber/issues
2024-09-29 17:01:46.011 | INFO | main:callback:818 - callback接口 收到数据:{'type': 'llm', 'data': {'type': 'zhipu', 'username': None, 'content_type': 'answer', 'content': '错误:zhipu无返回,请查看日志', 'timestamp': '2024-09-29 22:01:45'}}
2024-09-29 17:01:46.041 | WARNING | utils.my_handle:image_recognition_schedule_handle:3442 - 警告:zhipu无返回
2024-09-29 17:01:51.348 | INFO | main:image_recognition_schedule_task:1494 - 图像识别-窗口截图 定时任务触发
2024-09-29 17:01:51.450 | ERROR | utils.common:convert_digits_to_chinese:318 - 转换数字到中文时出错: 'NoneType' object is not iterable
2024-09-29 17:01:52.958 | INFO | utils.common:capture_window_by_title:1523 - 截图已保存到:D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\out\screenshots\image.jpg ‎- Photos.png
2024-09-29 17:01:53.472 | INFO | utils.gpt_model.gpt:get:86 - GPT_MODEL: 进入get方法
2024-09-29 17:01:53.697 | ERROR | utils.gpt_model.zhipu:get_zhipu_resp:221 - Traceback (most recent call last):
File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\utils\gpt_model\zhipu.py", line 216, in get_zhipu_resp
top_p=float(self.config_data["top_p"]),
KeyError: 'top_p'`

@Ikaros-521
Copy link
Owner

我将型号更改为 glm-4v-plus,当我按下屏幕截图并发送时,我得到了此日志,

`2024-09-29 17:02:27.034 | INFO | main:http_api_thread:256 - HTTP API线程已启动! 2024-09-29 17:02:40.191 | INFO | main:image_recognition_screenshot_and_send:6362 - 3.0后触发截图识别 2024-09-29 17:02:43.414 | INFO | utils.common:capture_window_by_title:1523 - 截图已保存到:D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\out\screenshots\image.jpg ‎- Photos.png 2024-09-29 17:02:43.904 | ERROR | utils.gpt_model.zhipu:get_zhipu_resp:221 - Traceback (most recent call last): File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\utils\gpt_model\zhipu.py", line 216, in get_zhipu_resp top_p=float(self.config_data["top_p"]), KeyError: 'top_p'

2024-09-29 17:02:43.910 | ERROR | utils.common:send_request:1234 - Traceback (most recent call last): File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\utils\common.py", line 1221, in send_request response.raise_for_status() File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\Miniconda3\lib\site-packages\requests\models.py", line 1024, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 422 Client Error: Unprocessable Entity for url: http://127.0.0.1:8082/send`

当我激活 (循环截图并发送) 时,我得到了这个日志,

`2024-09-29 17:01:29.128 | INFO | main:http_api_thread:256 - HTTP API线程已启动! 2024-09-29 17:01:36.346 | INFO | main:image_recognition_schedule_task:1494 - 图像识别-窗口截图 定时任务触发 2024-09-29 17:01:36.449 | ERROR | utils.common:convert_digits_to_chinese:318 - 转换数字到中文时出错: 'NoneType' object is not iterable 2024-09-29 17:01:44.712 | INFO | utils.common:capture_window_by_title:1523 - 截图已保存到:D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\out\screenshots\image.jpg ‎- Photos.png 2024-09-29 17:01:45.276 | INFO | utils.gpt_model.gpt:get:86 - GPT_MODEL: 进入get方法 2024-09-29 17:01:45.530 | ERROR | utils.gpt_model.zhipu:get_zhipu_resp:221 - Traceback (most recent call last): File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\utils\gpt_model\zhipu.py", line 216, in get_zhipu_resp top_p=float(self.config_data["top_p"]), KeyError: 'top_p'

2024-09-29 17:01:45.715 | WARNING | utils.my_handle:llm_handle:1555 - LLM没有正确返回数据,请排查配置、网络等是否正常。如果排查后都没有问题,可能是接口改动导致的兼容性问题,可以前往官方仓库提交issue,传送门:https://github.com/Ikaros-521/AI-Vtuber/issues 2024-09-29 17:01:46.011 | INFO | main:callback:818 - callback接口 收到数据:{'type': 'llm', 'data': {'type': 'zhipu', 'username': None, 'content_type': 'answer', 'content': '错误:zhipu无返回,请查看日志', 'timestamp': '2024-09-29 22:01:45'}} 2024-09-29 17:01:46.041 | WARNING | utils.my_handle:image_recognition_schedule_handle:3442 - 警告:zhipu无返回 2024-09-29 17:01:51.348 | INFO | main:image_recognition_schedule_task:1494 - 图像识别-窗口截图 定时任务触发 2024-09-29 17:01:51.450 | ERROR | utils.common:convert_digits_to_chinese:318 - 转换数字到中文时出错: 'NoneType' object is not iterable 2024-09-29 17:01:52.958 | INFO | utils.common:capture_window_by_title:1523 - 截图已保存到:D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\out\screenshots\image.jpg ‎- Photos.png 2024-09-29 17:01:53.472 | INFO | utils.gpt_model.gpt:get:86 - GPT_MODEL: 进入get方法 2024-09-29 17:01:53.697 | ERROR | utils.gpt_model.zhipu:get_zhipu_resp:221 - Traceback (most recent call last): File "D:\AiRina\AI-Vtuber-20240913\AI-Vtuber-20240913\utils\gpt_model\zhipu.py", line 216, in get_zhipu_resp top_p=float(self.config_data["top_p"]), KeyError: 'top_p'`

我的天,还真的,奇怪了,好久没用动这块代码了,怎么变得莫名其妙了,我看看

@Ikaros-521
Copy link
Owner

#1004
Try to fix with this committed change, during which the zhipu library version was changed, plus the internal api interface, this piece is not synchronized with maintenance updates
尝试使用这个提交的更改内容修复,期间改了zhipu的库版本,加上内部api接口,这块没有同步维护更新

@isseluxx
Copy link
Author

非常感谢你,智普 AI image_recognition运行良好,

我现在正在尝试添加 (gpt-4-vision-preview),但直到现在都没有运气

也许这个链接会有所帮助:
https://community.openai.com/t/how-to-get-an-image-described/607957/3

@Ikaros-521
Copy link
Owner

非常感谢你,智普 AI image_recognition运行良好,

我现在正在尝试添加 (gpt-4-vision-preview),但直到现在都没有运气

也许这个链接会有所帮助: https://community.openai.com/t/how-to-get-an-image-described/607957/3

是的 其实我很早就想添加gpt的识别了,只不过 生活压力有点大

@isseluxx
Copy link
Author

isseluxx commented Oct 3, 2024

blip-image-captioning-large.zip
你好,我不能添加(gpt-4-vision-preview)不幸的是。

在过去的日子里,我试图添加(blip-image-captioning-large)
https://huggingface.co/Salesforce/blip-image-captioning-large
这是一个免费图片字幕生成器,但也没有运气。
我附在这里(blip-image-captioning-large.zip)
修改的文件:
-webui.py
-my_handle.py
-config.json
-utils/blip_image_captioning/blip.py

当你有时间的时候你能看看代码吗?
谢谢你为这个美妙的项目所做的出色工作

@Ikaros-521
Copy link
Owner

blip-image-captioning-large.zip 你好,我不能添加(gpt-4-vision-preview)不幸的是。

在过去的日子里,我试图添加(blip-image-captioning-large) https://huggingface.co/Salesforce/blip-image-captioning-large 这是一个免费图片字幕生成器,但也没有运气。 我附在这里(blip-image-captioning-large.zip) 修改的文件: -webui.py -my_handle.py -config.json -utils/blip_image_captioning/blip.py

当你有时间的时候你能看看代码吗? 谢谢你为这个美妙的项目所做的出色工作

Oh! This is fantastic! Thank you for your contribution to the project. I will proceed with the integration of this model in the future
哦!这真是太棒了,感谢您对项目做出的贡献,后续我这边会推进这项模型的接入工作

@isseluxx
Copy link
Author

isseluxx commented Oct 3, 2024

gpt.zip
感谢你们的工作和时间,
当我尝试添加 (gpt-4-vision-preview) 但没有运气时,我附加了文件,
修改的文件:
-webui.py
-config.json
-utils/my_handle.py
-utils/gpt_model/chatgpt.py
-utils/gpt_model/gpt.py

当你有时间时,你可以检查代码。
谢谢

@Ikaros-521
Copy link
Owner

blip-image-captioning-large.zip 你好,我不能添加(gpt-4-vision-preview)不幸的是。

在过去的日子里,我试图添加(blip-image-captioning-large) https://huggingface.co/Salesforce/blip-image-captioning-large 这是一个免费图片字幕生成器,但也没有运气。 我附在这里(blip-image-captioning-large.zip) 修改的文件: -webui.py -my_handle.py -config.json -utils/blip_image_captioning/blip.py

当你有时间的时候你能看看代码吗? 谢谢你为这个美妙的项目所做的出色工作

已并入 main主线:#1011

@isseluxx
Copy link
Author

isseluxx commented Oct 4, 2024

非常感谢,blip-image-captioning 运行良好,你是最好的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants