File size: 2,408 Bytes
4ee8f13
 
 
 
 
 
 
 
 
 
 
9e03ce7
 
 
 
4ee8f13
 
 
1c0c0fd
 
4ee8f13
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import os
from pathlib import Path

SECRET_PREFIX = os.environ.get("SECRET_PREFIX", "")
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

BASE_HOST = os.environ.get("BASE_HOST", "")
BASE_ENDPOINT = os.environ.get("BASE_ENDPOINT", "")
CHATTY_HOST = os.environ.get("CHATTY_HOST", "")
CHATTY_ENDPOINT = os.environ.get("CHATTY_ENDPOINT", "")
ROOT_DIR = Path(__file__).parent.absolute()

MODELS = {
    "llava-calm2-siglip-chatty": {"host": CHATTY_HOST, "endpoint": CHATTY_ENDPOINT},
    "llava-calm2-siglip": {"host": BASE_HOST, "endpoint": BASE_ENDPOINT},
}

HEADER = """
# LLaVA-CALM2-SigLIP
LLaVA-CALM2-SigLIPは、calm2-7b-chatとsiglip-so400m-patch14-384からファインチューニングされたLLaVAモデルです。
## Models
- **llava-calm2-siglip**: 公開データを用いて学習されたVLM
- **llava-calm2-siglip-chatty**: よりチャットに最適化するように学習したVLM
"""

FOOTER = """
## Term 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;">LLaVA-CALM2-SigLIP</h1>
   <p style="font-size: 18px; margin-bottom: 2px; opacity: 0.65;">LLaVA-CALM2-SigLIP is a LLaVA model fine-tuned from calm2-7b-chat and siglip-so400m-patch14-384</p>
</div>
"""

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