import os from pathlib import Path from dataclasses import dataclass SECRET_PREFIX = os.environ.get("SECRET_PREFIX") if SECRET_PREFIX is None: raise ValueError("SECRET_PREFIX is not set") PROJECT_ID = os.environ.get("PROJECT_ID") ROLE_SUBJECT = os.environ.get("ROLE_SUBJECT") CREDENTIALS = os.environ.get("CREDENTIALS") os.environ[SECRET_PREFIX + "PROJECT_ID"] = PROJECT_ID os.environ[SECRET_PREFIX + "ROLE_SUBJECT"] = ROLE_SUBJECT os.environ[SECRET_PREFIX + "CREDENTIALS"] = CREDENTIALS ROOT_DIR = Path(__file__).parent.absolute() AUTH_CMD = os.environ.get("AUTH_CMD", "").split(" ") LLM_BASE_URL = os.environ.get("LLM_BASE_URL") LLM_ENDPOINT = os.environ.get("LLM_ENDPOINT") LLM_HOST = os.environ.get("LLM_HOST") @dataclass class ModelInfo: name: str endpoint: str host: str _MODELS = [ModelInfo("calm3-22b-chat", LLM_ENDPOINT, LLM_HOST)] MODELS = {model.name: model for model in _MODELS} SYSTEM_PROMPTS = { "assistant": "あなたは親切なAIアシスタントです。", } EXAMPLES = [ [ "サイバーエージェントってどんな会社?", ], [ "AIの進化で人類の暮らしはどうなると思いますか?", ], [ "大規模言語モデルの仕組みについて詳しく説明して。", ], [ "大規模言語モデルの仕組みについて、子供でもわかるように易しく説明して。", ], ] HEADER = """ # CALM3-22B-Chat """ FOOTER = """ ## Terms of Use Please note that by using this service, you agree to the following terms: This model is provided for research purposes only. CyberAgent expressly disclaim any liability for direct, indirect, special, incidental, or consequential damages, as well as for any losses that may result from using this model, regardless of the outcomes. It is essential for users to fully understand these limitations before employing the model. ## License The service is a research preview intended for non-commercial use only. """ PLACEHOLDER = """

CALM3-22B-Chat

""" CSS = """ #chatbot { height: auto !important; max_height: none !important; overflow: auto !important; flex-grow: 1 !important; } """