您的位置:首页 > 教育 > 锐评 > 郴州文明网网站_商标查询入口_西地那非片说明书_广东知名seo推广多少钱

郴州文明网网站_商标查询入口_西地那非片说明书_广东知名seo推广多少钱

2025/2/24 17:22:55 来源:https://blog.csdn.net/xinvictory/article/details/144561807  浏览:    关键词:郴州文明网网站_商标查询入口_西地那非片说明书_广东知名seo推广多少钱
郴州文明网网站_商标查询入口_西地那非片说明书_广东知名seo推广多少钱

环境:

代理服务器:http://10.*.*.*:8118解决上互联网

错误:

webui.py的代码如下:

import os
import logging
from llamafactory.webui.interface import create_ui# 设置日志级别为DEBUG以获取更多信息
logging.basicConfig(level=logging.DEBUG)os.environ["GRADIO_ANALYTICS_ENABLED"] = "0"
def main():gradio_share =Falseserver_name = "172.*.*.*"# 创建UI对象ui = create_ui()    try:# 尝试启动UI,不创建共享链接,也不自动打开浏览器窗口ui.queue().launch(share=False,#True, server_name=server_name,inbrowser=False,prevent_thread_lock=False  # 让服务器占用主线程)logging.info("grado接口启动成功。")except ValueError as e:if "When localhost is not accessible" in str(e):logging.warning("忽略关于本地主机可访问性的错误,因为我们在本地网络中运行.{e}")else:logging.error(f"Unexpected ValueError: {e}")raise  # 如果是其他类型的ValueError,则重新抛出异常except Exception as e:logging.error(f"An unexpected error occurred: {e}")raise  # 重新抛出所有其他异常以便进一步调试if __name__ == "__main__":main()

执行python src/webui.py会报如下错误:

DEBUG:asyncio:Using selector: EpollSelector

Running on local URL:  http://172.*.*.*:7861

DEBUG:httpcore.connection:connect_tcp.started host='10.*.*.*' port=8118 local_address=None timeout=None socket_options=None

DEBUG:httpcore.connection:connect_tcp.complete return_value=<httpcore._backends.sync.SyncStream object at 0x7f2d931ec7f0>

DEBUG:httpcore.http11:send_request_headers.started request=<Request [b'GET']>

DEBUG:httpcore.http11:send_request_headers.complete

DEBUG:httpcore.http11:send_request_body.started request=<Request [b'GET']>

DEBUG:httpcore.http11:send_request_body.complete

DEBUG:httpcore.http11:receive_response_headers.started request=<Request [b'GET']>

DEBUG:httpcore.http11:receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'date', b'Tue, 17 Dec 2024 11:37:06 GMT'), (b'server', b'uvicorn'), (b'content-length', b'4'), (b'content-type', b'application/json'), (b'Proxy-Connection', b'keep-alive')])

INFO:httpx:HTTP Request: GET http://172.*.*.*:7861/startup-events "HTTP/1.1 200 OK"

DEBUG:httpcore.http11:receive_response_body.started request=<Request [b'GET']>

DEBUG:httpcore.http11:receive_response_body.complete

DEBUG:httpcore.http11:response_closed.started

DEBUG:httpcore.http11:response_closed.complete

DEBUG:httpcore.connection:close.started

DEBUG:httpcore.connection:close.complete

DEBUG:httpcore.connection:connect_tcp.started host='10.*.*.*' port=8118 local_address=None timeout=3 socket_options=None

DEBUG:httpcore.connection:connect_tcp.failed exception=ConnectTimeout(TimeoutError('timed out'))

WARNING:root:Ignoring error about localhost accessibility since we are running in a local network.

解决方案: 

临时关闭代理服务。

unset HTTP_PROXY

unset HTTPS_PROXY

unset http_proxy

unset https_proxy

再执行 python src/webui.py就没有问题。

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com