ryanzhangfan commited on
Commit
1f3535b
β€’
1 Parent(s): b59d320

add fast demo link

Browse files
app.py CHANGED
@@ -6,7 +6,7 @@
6
  # Email : zhangfan@baai.ac.cn
7
  # Institute : Beijing Academy of Artificial Intelligence (BAAI)
8
  # Create On : 2023-12-11 15:34
9
- # Last Modified : 2023-12-21 06:45
10
  # File Name : app.py
11
  # Description :
12
  #
@@ -42,6 +42,7 @@ if __name__ == "__main__":
42
  [<a href='https://baaivision.github.io/emu2' target='_blank' rel='noopener'>project page</a>] \
43
  [<a href='https://github.com/baaivision/Emu' target='_blank' rel='noopener'>code</a>] \
44
  [<a href='https://arxiv.org/abs/2312.13286' target='_blank' rel='noopener'>paper</a>] \
 
45
  </h2> \
46
  <h3 align='center'> \
47
  πŸ€—HF models: \
 
6
  # Email : zhangfan@baai.ac.cn
7
  # Institute : Beijing Academy of Artificial Intelligence (BAAI)
8
  # Create On : 2023-12-11 15:34
9
+ # Last Modified : 2023-12-22 10:35
10
  # File Name : app.py
11
  # Description :
12
  #
 
42
  [<a href='https://baaivision.github.io/emu2' target='_blank' rel='noopener'>project page</a>] \
43
  [<a href='https://github.com/baaivision/Emu' target='_blank' rel='noopener'>code</a>] \
44
  [<a href='https://arxiv.org/abs/2312.13286' target='_blank' rel='noopener'>paper</a>] \
45
+ [<a href='https://emu.ssi.plus' target='_blank' rel='noopener'>FAST demo</a>] \
46
  </h2> \
47
  <h3 align='center'> \
48
  πŸ€—HF models: \
demo/chat_frontend.py CHANGED
@@ -6,7 +6,7 @@
6
  # Email : zhangfan@baai.ac.cn
7
  # Institute : Beijing Academy of Artificial Intelligence (BAAI)
8
  # Create On : 2023-12-12 18:05
9
- # Last Modified : 2023-12-21 06:13
10
  # File Name : chat_frontend.py
11
  # Description :
12
  #
@@ -23,7 +23,7 @@ import gradio as gr
23
  from .meta import ConvMeta, Role, DataMeta
24
  from .utils import extract_frames
25
  from .utils import frontend_logger as logging
26
- from .constants import TERM_OF_USE, GUIDANCE, RECOMMEND
27
 
28
  CONTROLLER_URL = ""
29
 
@@ -164,7 +164,7 @@ def build_chat(args):
164
  with gr.Blocks(title="Emu", theme=gr.themes.Default(primary_hue="blue", secondary_hue="blue")) as demo:
165
  state = gr.State()
166
 
167
- gr.Markdown(GUIDANCE)
168
  gr.Markdown(RECOMMEND)
169
 
170
  with gr.Row():
 
6
  # Email : zhangfan@baai.ac.cn
7
  # Institute : Beijing Academy of Artificial Intelligence (BAAI)
8
  # Create On : 2023-12-12 18:05
9
+ # Last Modified : 2023-12-22 10:29
10
  # File Name : chat_frontend.py
11
  # Description :
12
  #
 
23
  from .meta import ConvMeta, Role, DataMeta
24
  from .utils import extract_frames
25
  from .utils import frontend_logger as logging
26
+ from .constants import TERM_OF_USE, CHAT_GUIDANCE, RECOMMEND
27
 
28
  CONTROLLER_URL = ""
29
 
 
164
  with gr.Blocks(title="Emu", theme=gr.themes.Default(primary_hue="blue", secondary_hue="blue")) as demo:
165
  state = gr.State()
166
 
167
+ gr.Markdown(CHAT_GUIDANCE)
168
  gr.Markdown(RECOMMEND)
169
 
170
  with gr.Row():
demo/constants.py CHANGED
@@ -51,5 +51,6 @@ TERM_OF_USE = "### Terms of use\nπŸ“ŒBy using this service, users are required t
51
 
52
  LICENSE = "### License\nπŸ“ŒThe service is a research preview intended for non-commercial use only, subject to the model [License](https://github.com/facebookresearch/llama/blob/main/MODEL_CARD.md) of LLaMA, [Terms of Use](https://openai.com/policies/terms-of-use) of content by OpenAI, and [Privacy Practices](https://chromewebstore.google.com/detail/sharegpt-share-your-chatg/daiacboceoaocpibfodeljbdfacokfjb) of ShareGPT. Please contact us if you find any potential violation."
53
 
54
- GUIDANCE = "<font size=4>πŸ’‘<b><u>NOTE</u></b>πŸ’‘: You can <b><u>_ONLY_</u></b> input one modality at a time. Please <b><u>_CLICK_</u></b> Add button after entering one modality input. And then input the <b><u>_NEXT_</u></b> modality.</font>"
 
55
  RECOMMEND = "<font size=2>Strongly <b><u>_RECOMMAND_</u></b> reading the [user guide](https://jwolpxeehx.feishu.cn/docx/RYHNd1tvEo8k8Mx9HeMcvvxWnvZ) before trying out this demo.</font>"
 
51
 
52
  LICENSE = "### License\nπŸ“ŒThe service is a research preview intended for non-commercial use only, subject to the model [License](https://github.com/facebookresearch/llama/blob/main/MODEL_CARD.md) of LLaMA, [Terms of Use](https://openai.com/policies/terms-of-use) of content by OpenAI, and [Privacy Practices](https://chromewebstore.google.com/detail/sharegpt-share-your-chatg/daiacboceoaocpibfodeljbdfacokfjb) of ShareGPT. Please contact us if you find any potential violation."
53
 
54
+ CHAT_GUIDANCE = "<font size=4>πŸ’‘<b><u>NOTE</u></b>πŸ’‘: You can <b><u>_ONLY_</u></b> input one modality at a time. Please <b><u>_CLICK_</u></b> Add button after entering one modality input. And then input the <b><u>_NEXT_</u></b> modality.</font>"
55
+ GEN_GUIDANCE = "<font size=4>πŸ’‘<b><u>NOTE</u></b>πŸ’‘: You can <b><u>_ONLY_</u></b> input one modality at a time (except for <b><u>_location-binded_</u></b> inputs). Please <b><u>_CLICK_</u></b> Add button after entering one modality input. And then input the <b><u>_NEXT_</u></b> modality.</font>"
56
  RECOMMEND = "<font size=2>Strongly <b><u>_RECOMMAND_</u></b> reading the [user guide](https://jwolpxeehx.feishu.cn/docx/RYHNd1tvEo8k8Mx9HeMcvvxWnvZ) before trying out this demo.</font>"
demo/generation_frontend.py CHANGED
@@ -6,7 +6,7 @@
6
  # Email : zhangfan@baai.ac.cn
7
  # Institute : Beijing Academy of Artificial Intelligence (BAAI)
8
  # Create On : 2023-12-11 15:35
9
- # Last Modified : 2023-12-21 07:12
10
  # File Name : generation_frontend.py
11
  # Description :
12
  #
@@ -24,7 +24,7 @@ import gradio as gr
24
  from .constants import EVA_IMAGE_SIZE
25
  from .meta import ConvMeta, Role, DataMeta
26
  from .utils import frontend_logger as logging
27
- from .constants import TERM_OF_USE, GUIDANCE, RECOMMEND
28
 
29
  CONTROLLER_URL = ""
30
 
@@ -161,7 +161,7 @@ def build_generation(args):
161
  state = gr.State()
162
 
163
  gr.Markdown("<font size=5><center><b>This demo</b> can accept a mix of <b><u>_texts_</u></b>, <b><u>_locations_</u></b> and <b><u>_images_</u></b> as input, and generating images in context</center></font>")
164
- gr.Markdown(GUIDANCE)
165
  gr.Markdown(RECOMMEND)
166
  gr.Markdown("<font size=4>πŸ’‘<b><u>Tips</b></u>πŸ’‘:</font> To achieve better generation quality\n \
167
  - If subject-driven generation does not follow the given prompt, randomly bind a central bounding box with the input image or text often helps resolve the issue.\n \
 
6
  # Email : zhangfan@baai.ac.cn
7
  # Institute : Beijing Academy of Artificial Intelligence (BAAI)
8
  # Create On : 2023-12-11 15:35
9
+ # Last Modified : 2023-12-22 10:29
10
  # File Name : generation_frontend.py
11
  # Description :
12
  #
 
24
  from .constants import EVA_IMAGE_SIZE
25
  from .meta import ConvMeta, Role, DataMeta
26
  from .utils import frontend_logger as logging
27
+ from .constants import TERM_OF_USE, GEN_GUIDANCE, RECOMMEND
28
 
29
  CONTROLLER_URL = ""
30
 
 
161
  state = gr.State()
162
 
163
  gr.Markdown("<font size=5><center><b>This demo</b> can accept a mix of <b><u>_texts_</u></b>, <b><u>_locations_</u></b> and <b><u>_images_</u></b> as input, and generating images in context</center></font>")
164
+ gr.Markdown(GEN_GUIDANCE)
165
  gr.Markdown(RECOMMEND)
166
  gr.Markdown("<font size=4>πŸ’‘<b><u>Tips</b></u>πŸ’‘:</font> To achieve better generation quality\n \
167
  - If subject-driven generation does not follow the given prompt, randomly bind a central bounding box with the input image or text often helps resolve the issue.\n \