Download src/config.py from robot4/romtion: direct link, hf CLI and curl.
- Browser
- Download file 792 Bytes
-
https://huggingface.co/spaces/robot4/romtion/resolve/5442735d84d22addfef47adeb77458ca22cfdd39/src/config.py
- Command line
-
hf download hf://spaces/robot4/romtion@5442735d84d22addfef47adeb77458ca22cfdd39/src/config.py
-
curl -L -o config.py https://huggingface.co/spaces/robot4/romtion/resolve/5442735d84d22addfef47adeb77458ca22cfdd39/src/config.py
792 Bytes
| import os | |
| class Config: | |
| # 路径配置 | |
| ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | |
| DATA_DIR = os.path.join(ROOT_DIR, 'data') | |
| CHECKPOINT_DIR = os.path.join(ROOT_DIR, 'checkpoints') | |
| RESULTS_DIR = os.path.join(ROOT_DIR, 'results') | |
| OUTPUT_DIR = CHECKPOINT_DIR # Alias for compatibility | |
| # 模型配置 | |
| BASE_MODEL = "google-bert/bert-base-chinese" | |
| NUM_LABELS = 3 | |
| MAX_LENGTH = 128 | |
| # 训练配置 | |
| BATCH_SIZE = 32 | |
| LEARNING_RATE = 2e-5 | |
| NUM_EPOCHS = 3 | |
| WARMUP_RATIO = 0.1 | |
| WEIGHT_DECAY = 0.01 | |
| LOGGING_STEPS = 100 | |
| SAVE_STEPS = 500 | |
| EVAL_STEPS = 500 | |
| # 标签映射 | |
| LABEL2ID = {'negative': 0, 'neutral': 1, 'positive': 2} | |
| ID2LABEL = {0: 'negative', 1: 'neutral', 2: 'positive'} | |