Emu2 / demo /constants.py
ryanzhangfan's picture
add router hint and highlight fast demo
a7c6ff5
EVA_IMAGE_SIZE = 448
OPENAI_DATASET_MEAN = (0.48145466, 0.4578275, 0.40821073)
OPENAI_DATASET_STD = (0.26862954, 0.26130258, 0.27577711)
DEFAULT_IMAGE_FILE_SUFFIX = ['jpg', '0.png', 'png', 'jpeg', 'webp']
DEFAULT_TEXT_FILE_SUFFIX = ['txt', '0.txt']
IGNORE_INDEX = -100
# special tokens
# START
DEFAULT_PAD_TOKEN = "[PAD]"
DEFAULT_BOS_TOKEN = '<s>'
DEFAULT_EOS_TOKEN = '</s>'
DEFAULT_UNK_TOKEN = "<unk>"
DEFAULT_IMG_TOKEN = "[IMG]"
DEFAULT_IMG_END_TOKEN = "[/IMG]"
DEFAULT_IMAGE_TOKEN = "<image>"
DEFAULT_gIMG_TOKEN = "[gIMG]"
DEFAULT_gIMG_END_TOKEN = "[/gIMG]"
DEFAULT_EOC_TOKEN = "[EOC]"
DEFAULT_VIDEO_TOKEN = "[VIDEO]"
GRD_SYMBOL = "<grounding>"
BOP_SYMBOL = "<phrase>"
EOP_SYMBOL = "</phrase>"
BOO_SYMBOL = "<object>"
EOO_SYMBOL = "</object>"
DOM_SYMBOL = "</delimiter_of_multi_objects/>"
REC_SYMBOL = "<REC>"
USER_TOKEN = "[USER]"
ASSISTANT_TOKEN = "[ASSISTANT]"
# END
# special token id
# START
IMAGE = 32003
BOI = 32001
VIDEO = 32004
# END
DEFAULT_IMG_PLACEHOLDER = "[<IMG_PLH>]"
DEFAULT_VID_PLACEHOLDER = "[<VID_PLH>]"
FAKE_VIDEO_END_TOKEN = "[/VIDEO]"
# LICENSE & TERM OF USE
TERM_OF_USE = "### Terms of use\nπŸ“ŒBy using this service, users are required to agree to the following terms: The service is a research preview intended for non-commercial use only. It only provides limited safety measures and may generate offensive content. It must not be used for any illegal, harmful, violent, racist, or sexual purposes. The service may collect user dialogue data for future research."
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."
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>"
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>"
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>"
CHAT_ROUTER = "<font size=4>🚏<b><u>ROUTER</u></b>🚏:This tab can <b><u>_ONLY_</u></b> generate <b><u>_TEXT_</u></b> output. If you want to generate images, please use <b>_Multimodal Generation_</b>.</font>"
GEN_ROUTER = "<font size=4>🚏<b><u>ROUTER</u></b>🚏:This tab can <b><u>_ONLY_</u></b> generate <b><u>_IMAGE_</u></b> output. If you want to generate texts, please use <b>_Multimodal Chat_</b>.</font>"