import os # ! UI Markdown information MODEL_TITLE = """
SeaLLMs - Large Language Models for Southeast Asia
""" # # # MODEL_DESC = f"""
SeaLMMM-7B-early - multilingual multimodal assistant for Southeast Asia. It handles both text-only (LLMs and vision instructions (LVMs). SeaLMMM-7B has not finished training.
The chatbot may produce false and harmful content! By using our service, you are required to agree to our Terms Of Use """.strip() MODEL_TITLE = """
SeaLLMs - Large Language Models for Southeast Asia
""" # Explore SeaLMMM-7B - our multi-modal version of SeaLLMs. #
# # # # # #
MODEL_DESC = f""" This demo page hosts SeaLLM-Chat, our latest chatbot version of SeaLLMs, serving as a helpful assistant for Southeast Asian languages. 🇬🇧 🇻🇳 🇮🇩 🇹🇭 🇲🇾 🇰🇭 🇱🇦 🇵🇭 🇲🇲.
Despite our best efforts in red teaming and safety fine-tuning and enforcement, the chatbot may still produce false and harmful content! By using our service, you agree to our Terms Of Use """.strip() # # NOTE: The chatbot may produce false and harmful content and does not have up-to-date knowledge. # By using our service, you are required to agree to our Terms Of Use, which includes # not to use our service to generate any harmful, inappropriate or illegal content. # The service collects user dialogue data for testing and improvement under # (CC-BY) or similar license. So do not enter any personal information! # """ By using our service, you are required to agree to our Terms Of Use, which includes not to use our service to generate any harmful, inappropriate or illegal content. The service collects user dialogue data for testing and improvement under (CC-BY) or similar license. So do not enter any personal information! """ # MODEL_INFO = """ #

Model Name: {model_path}

# """ MODEL_INFO = "" CITE_MARKDOWN = """ ## Citation If you find our project useful, hope you can star our repo and cite our paper as follows: ``` @article{damonlpsg2023seallm, author = {Xuan-Phi Nguyen*, Wenxuan Zhang*, Xin Li*, Mahani Aljunied*, Weiwen Xu, Hou Pong Chan, Zhiqiang Hu, Chenhui Shen^, Yew Ken Chia^, Xingxuan Li, Jianyu Wang, Qingyu Tan, Liying Cheng, Guanzheng Chen, Yue Deng, Sen Yang, Chaoqun Liu, Hang Zhang, Lidong Bing}, title = {SeaLLMs - Large Language Models for Southeast Asia}, year = 2023, } ``` """ # .panel-full-width.svelte-1ylopk1.svelte-1ylopk1.svelte-1ylopk1 { CSS = """ .message-wrap.svelte-1lcyrx4>div.svelte-1lcyrx4 img { min-width: 200px; min-height: 150px; max-height: 600px; max-width; 90%; width: auto; object-fit: contain; } .panel-full-width.svelte-1lcyrx4.svelte-1lcyrx4.svelte-1lcyrx4 { padding: calc(var(--spacing-xxl) * 1); width: 100% } .panel-full-width { padding: calc(var(--spacing-xxl) * 1); width: 100% } img.tag { max-height: 1.5em; width: auto; } span.prose { font-size: var(--text-lg); } """ USE_PANEL = bool(int(os.environ.get("USE_PANEL", "1"))) CHATBOT_HEIGHT = int(os.environ.get("CHATBOT_HEIGHT", "500")) ALLOWED_PATHS = ["seal_logo.png"] DEMOS = os.environ.get("DEMOS", "") DEMOS = DEMOS.split(",") if DEMOS.strip() != "" else [ "DocChatInterfaceDemo", "ChatInterfaceDemo", "TextCompletionDemo", # "RagChatInterfaceDemo", # "VisionChatInterfaceDemo", # "VisionDocChatInterfaceDemo", ] # DEMOS=DocChatInterfaceDemo,ChatInterfaceDemo,RagChatInterfaceDemo,TextCompletionDemo # ! server info DELETE_FOLDER = os.environ.get("DELETE_FOLDER", "") PORT = int(os.environ.get("PORT", "7860")) PROXY = os.environ.get("PROXY", "").strip() # ! backend info BACKEND = os.environ.get("BACKEND", "debug") # ! model information # for RAG RAG_EMBED_MODEL_NAME = os.environ.get("RAG_EMBED_MODEL_NAME", "sentence-transformers/all-MiniLM-L6-v2") CHUNK_SIZE = int(os.environ.get("CHUNK_SIZE", "1024")) CHUNK_OVERLAP = int(os.environ.get("CHUNK_SIZE", "50")) DEFAULT_SYSTEM_PROMPT = """You are an intelligent and helpful assistant. Today is {cur_datetime}. You should give concise responses to very simple questions, but provide thorough responses to more complex and open-ended questions. You should provide thorough help with writing, analysis, question answering, math, coding, and all sorts of other tasks. It uses markdown for coding. """.strip() DEFAULT_SYSTEM_PROMPT = """You are a helpful, intelligent and respectful AI assistant.""" SYSTEM_PROMPT = os.environ.get("SYSTEM_PROMPT", DEFAULT_SYSTEM_PROMPT) MAX_TOKENS = int(os.environ.get("MAX_TOKENS", "2048")) TEMPERATURE = float(os.environ.get("TEMPERATURE", "0.1")) # ! these values currently not used FREQUENCE_PENALTY = float(os.environ.get("FREQUENCE_PENALTY", "0.0")) PRESENCE_PENALTY = float(os.environ.get("PRESENCE_PENALTY", "0.0")) # Transformers or vllm MODEL_PATH = os.environ.get("MODEL_PATH", "SeaLLMs/SeaLLM-7B-v2") MODEL_NAME = os.environ.get("MODEL_NAME", "Cool-Chatbot") DTYPE = os.environ.get("DTYPE", "bfloat16") DEVICE = os.environ.get("DEVICE", "cuda") # VLLM GPU_MEMORY_UTILIZATION = float(os.environ.get("GPU_MEMORY_UTILIZATION", "0.9")) TENSOR_PARALLEL = int(os.environ.get("TENSOR_PARALLEL", "1")) QUANTIZATION = str(os.environ.get("QUANTIZATION", "")) STREAM_YIELD_MULTIPLE = int(os.environ.get("STREAM_YIELD_MULTIPLE", "1")) # how many iterations to perform safety check on response STREAM_CHECK_MULTIPLE = int(os.environ.get("STREAM_CHECK_MULTIPLE", "0")) # llama.cpp DEFAULT_CHAT_TEMPLATE = os.environ.get("DEFAULT_CHAT_TEMPLATE", "chatml") N_CTX = int(os.environ.get("N_CTX", "4096")) N_GPU_LAYERS = int(os.environ.get("N_GPU_LAYERS", "-1")) # llava.llama.cpp # Multimodal IMAGE_TOKEN = os.environ.get("IMAGE_TOKEN", "[IMAGE]<|image|>[/IMAGE]") IMAGE_TOKEN_INTERACTIVE = bool(int(os.environ.get("IMAGE_TOKEN_INTERACTIVE", "0"))) IMAGE_TOKEN_LENGTH = int(os.environ.get("IMAGE_TOKEN_LENGTH", "576")) MAX_PACHES = int(os.environ.get("MAX_PACHES", "1")) """ # claude style You are SeaLLM, you are a helpful, respectful and honest AI assistant. Based on your internal clock, the current date time: {cur_datetime}. Your knowledge base was last updated on August 2023. Thus, you should answers questions about events prior to and after August 2023 the way a highly informed individual in August 2023 would if they were talking to someone from the above date, and can let the human know this when relevant. You should give concise responses to very simple questions, but provide thorough responses to more complex and open-ended questions. You should provide thorough help with writing, analysis, question answering, math, coding, and all sorts of other tasks. It uses markdown for coding. You are a helpful, respectful and honest AI assistant. You should give concise responses to very simple questions, but provide thorough responses to more complex and open-ended questions. You should provide thorough help with writing, analysis, question answering, math, coding, and all sorts of other tasks. It uses markdown for coding. If the user asks the following specific information, you provide the user with the correct information accordingly. The current date is {cur_datetime}. Your name is SeaLLM. # --- You are an intelligent and helpful assistant. Today is {cur_datetime}. You should give concise responses to very simple questions, but provide thorough responses to more complex and open-ended questions. You should provide thorough help with writing, analysis, question answering, math, coding, and all sorts of other tasks. It uses markdown for coding. """