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

大佬你好,请问可以提供下本地部署gradio界面的代码吗? #73

Open
zhangdanfeng888 opened this issue Jan 5, 2024 · 5 comments

Comments

@zhangdanfeng888
Copy link

我现在想在本地部署并尝试demo,可否提供下gradio界面的代码呢?

@ryanzhangfan
Copy link
Collaborator

请参考这里的示例

@zhangdanfeng888
Copy link
Author

请参考这里的示例

谢谢!但是在运行python fronted.py时,成功打开gradio界面,按照提示输入图像和text后点生成报错:
Running on local URL: http://0.0.0.0:9002

To create a public link, set share=True in launch().
2024-01-08 05:58:55 - meta.py: 230 - [INFO] - 2024010805580818ca5ee973eb4cad9fa00879d4c0af94: create new round of chat
2024-01-08 05:58:55 - meta.py: 233 - [INFO] - 2024010805580818ca5ee973eb4cad9fa00879d4c0af94: APPEND [USER] prompt element, type: IMAGE, message: [I:448x448]
2024-01-08 05:59:05 - meta.py: 233 - [INFO] - 2024010805580818ca5ee973eb4cad9fa00879d4c0af94: APPEND [USER] prompt element, type: TEXT, message: T:Describe this picture.
2024-01-08 05:59:07 - meta.py: 278 - [INFO] - 2024010805580818ca5ee973eb4cad9fa00879d4c0af94: format chat prompt: ['You are a helpful assistant, dedicated to delivering comprehensive and meticulous responses.', ' [USER]: ', <PIL.Image.Image image mode=RGB size=448x448 at 0x7F9CB813E200>, 'Describe this picture.', ' [ASSISTANT]:']
2024-01-08 05:59:07 - chat_frontend.py: 107 - [INFO] - 2024010805580818ca5ee973eb4cad9fa00879d4c0af94: construct chat reqeust with prompt [['TEXT', 'You are a helpful assistant, dedicated to delivering comprehensive and meticulous responses.'], ['TEXT', ' [USER]: '], ['IMAGE', '[]'], ['TEXT', 'Describe this picture.'], ['TEXT', ' [ASSISTANT]:']]
2024-01-08 05:59:07 - chat_frontend.py: 133 - [INFO] - 2024010805580818ca5ee973eb4cad9fa00879d4c0af94: get response with status code: 502, time: 3.310ms
2024-01-08 05:59:07 - meta.py: 233 - [INFO] - 2024010805580818ca5ee973eb4cad9fa00879d4c0af94: APPEND [ASSISTANT] prompt element, type: ERROR, message: T:Generate Failed: http failed with code 502, msg:
image

请问这是什么原因?

@zhangdanfeng888
Copy link
Author

请参考这里的示例

谢谢!但是在运行python fronted.py时,成功打开gradio界面,按照提示输入图像和text后点生成报错: Running on local URL: http://0.0.0.0:9002在本地 URL 上运行:http://0.0.0.0:9002

To create a public link, set share=True in launch().要创建公共链接,请将 launch() 中。 share=True 2024-01-08 05:58:55 - meta.py: 230 - [INFO] - 2024010805580818ca5ee973eb4cad9fa00879d4c0af94: create new round of chat2024-01-08 05:58:55 - meta.py: 230 - [信息] - 2024010805580818ca5ee973eb4cad9fa00879d4c0af94:创建新一轮聊天 2024-01-08 05:58:55 - meta.py: 233 - [INFO] - 2024010805580818ca5ee973eb4cad9fa00879d4c0af94: APPEND [USER] prompt element, type: IMAGE, message: [I:448x448]2024-01-08 05:58:55 - meta.py: 233 - [信息] - 2024010805580818ca5ee973eb4cad9fa00879d4c0af94:追加 [USER] 提示元素,类型:IMAGE,消息:[I:448x448] 2024-01-08 05:59:05 - meta.py: 233 - [INFO] - 2024010805580818ca5ee973eb4cad9fa00879d4c0af94: APPEND [USER] prompt element, type: TEXT, message: T:Describe this picture.2024-01-08 05:59:05 - meta.py: 233 - [INFO] - 2024010805580818ca5ee973eb4cad9fa00879d4c0af94: APPEND [USER] prompt element, type: TEXT, message: T:Describe this picture. 2024-01-08 05:59:07 - meta.py: 278 - [INFO] - 2024010805580818ca5ee973eb4cad9fa00879d4c0af94: format chat prompt: ['You are a helpful assistant, dedicated to delivering comprehensive and meticulous responses.', ' [USER]: ', <PIL.Image.Image image mode=RGB size=448x448 at 0x7F9CB813E200>, 'Describe this picture.', ' [ASSISTANT]:']2024-01-08 05:59:07 - meta.py: 278 - [信息] - 2024010805580818ca5ee973eb4cad9fa00879d4c0af94: 格式聊天提示: ['你是一个乐于助人的助手,致力于提供全面而细致的回复', ' [USER]: ', , '描述这张图片.', ' [助手]:'] 2024-01-08 05:59:07 - chat_frontend.py: 107 - [INFO] - 2024010805580818ca5ee973eb4cad9fa00879d4c0af94: construct chat reqeust with prompt [['TEXT', 'You are a helpful assistant, dedicated to delivering comprehensive and meticulous responses.'], ['TEXT', ' [USER]: '], ['IMAGE', '[]'], ['TEXT', 'Describe this picture.'], ['TEXT', ' [ASSISTANT]:']]2024-01-08 05:59:07 - chat_frontend.py: 107 - [信息] - 2024010805580818ca5ee973eb4cad9fa00879d4c0af94:使用提示 [['TEXT', 'You are a helpful assistant, 致力于提供全面细致的回复。'], ['TEXT', ' [USER]: '], ['IMAGE', '[]'], ['TEXT', 'Describe this picture.'], ['TEXT', ' [ASSISTANT]:']] 2024-01-08 05:59:07 - chat_frontend.py: 133 - [INFO] - 2024010805580818ca5ee973eb4cad9fa00879d4c0af94: get response with status code: 502, time: 3.310ms2024-01-08 05:59:07 - chat_frontend.py: 133 - [信息] - 2024010805580818ca5ee973eb4cad9fa00879d4c0af94:获取响应,状态代码:502,时间:3.310ms 2024-01-08 05:59:07 - meta.py: 233 - [INFO] - 2024010805580818ca5ee973eb4cad9fa00879d4c0af94: APPEND [ASSISTANT] prompt element, type: ERROR, message: T:Generate Failed: http failed with code 502, msg:2024-01-08 05:59:07 - meta.py: 233 - [信息] - 2024010805580818ca5ee973eb4cad9fa00879d4c0af94: APPEND [ASSISTANT] prompt element,类型:ERROR,消息:T:Generate Failed:http 失败,代码为 502,msg: image

请问这是什么原因?

看了一下代码,应该是chat_fronted.py中第112行的post方法没有访问到地址导致的:
image
我现在的fronted.py未做任何修改:
image
应该如何修改才能成功生成呢?

@zhangdanfeng888
Copy link
Author

@ryanzhangfan 大佬,麻烦看一下,多谢多谢~

@ryanzhangfan
Copy link
Collaborator

1、如果想在本地使用demo,需要同时在本地启动前端(gradio界面)和后端(模型)。教程都在我发的那个链接里。
2、如果想使用部署在云端的模型,请通过我们已经部署好的前端访问,链接1链接2

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

No branches or pull requests

2 participants