tuxedocat's picture
init
a7566b2
raw
history blame
2.53 kB
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 = """
<div style="padding: 30px; text-align: center; display: flex; flex-direction: column; align-items: center;">
<img src="https://d23iyfk1a359di.cloudfront.net/files/topics/26317_ext_03_0.jpg" style="width: 80%; max-width: 550px; height: auto; opacity: 0.55; ">
<h1 style="font-size: 28px; margin-bottom: 2px; opacity: 0.55;">CALM3-22B-Chat</h1>
</div>
"""
CSS = """
#chatbot {
height: auto !important;
max_height: none !important;
overflow: auto !important;
flex-grow: 1 !important;
}
"""