We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
不是很懂gradio也不太懂web端,想知道这个项目如果启动后,是否满足多人同时在各自pc上同时调用
The text was updated successfully, but these errors were encountered:
你好,可以多人同时调用,专门做过这个适配,每次访问这个链接产生的数据和代码运行环境都是相互隔离的
Sorry, something went wrong.
好的谢谢,想请教下,这个相互隔离的代码部分在什么地方呢,或者这个隔离是gradio 服务自身支持的呢?
互相隔离的代码主要是通过web_ui.py中的这个函数:
web_ui.py
def initialization(state_dict: Dict) -> None: if not os.path.exists('cache'): os.mkdir('cache') if state_dict["bot_backend"] is None: state_dict["bot_backend"] = BotBackend() if 'OPENAI_API_KEY' in os.environ: del os.environ['OPENAI_API_KEY']
每次访问网址的时候,调研这个函数,它会专门为会话实例化一个BotBackend,其中包含了数据和代码执行环境。state_dict只和当前会话中使用。
BotBackend
state_dict
No branches or pull requests
不是很懂gradio也不太懂web端,想知道这个项目如果启动后,是否满足多人同时在各自pc上同时调用
The text was updated successfully, but these errors were encountered: