Ax art (#405)
Browse files* axolotl text art :D
* only print art on rank0
* lint and pr feedback
- scripts/finetune.py +16 -1
scripts/finetune.py
CHANGED
|
@@ -21,6 +21,7 @@ from axolotl.logging_config import configure_logging
|
|
| 21 |
from axolotl.utils.config import normalize_config, validate_config
|
| 22 |
from axolotl.utils.data import prepare_dataset
|
| 23 |
from axolotl.utils.dict import DictDefault
|
|
|
|
| 24 |
from axolotl.utils.models import load_model, load_tokenizer
|
| 25 |
from axolotl.utils.tokenization import check_dataset_labels
|
| 26 |
from axolotl.utils.trainer import setup_trainer
|
|
@@ -33,10 +34,23 @@ sys.path.insert(0, src_dir)
|
|
| 33 |
configure_logging()
|
| 34 |
LOG = logging.getLogger("axolotl.scripts")
|
| 35 |
|
| 36 |
-
|
| 37 |
os.environ["HF_HUB_ENABLE_HF_TRANSFER"] = "1"
|
| 38 |
|
| 39 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
def get_multi_line_input() -> Optional[str]:
|
| 41 |
print("Give me an instruction (Ctrl + D to finish): ")
|
| 42 |
instruction = ""
|
|
@@ -146,6 +160,7 @@ def train(
|
|
| 146 |
prepare_ds_only: bool = False,
|
| 147 |
**kwargs,
|
| 148 |
):
|
|
|
|
| 149 |
if Path(config).is_dir():
|
| 150 |
config = choose_config(config)
|
| 151 |
|
|
|
|
| 21 |
from axolotl.utils.config import normalize_config, validate_config
|
| 22 |
from axolotl.utils.data import prepare_dataset
|
| 23 |
from axolotl.utils.dict import DictDefault
|
| 24 |
+
from axolotl.utils.distributed import is_main_process
|
| 25 |
from axolotl.utils.models import load_model, load_tokenizer
|
| 26 |
from axolotl.utils.tokenization import check_dataset_labels
|
| 27 |
from axolotl.utils.trainer import setup_trainer
|
|
|
|
| 34 |
configure_logging()
|
| 35 |
LOG = logging.getLogger("axolotl.scripts")
|
| 36 |
|
|
|
|
| 37 |
os.environ["HF_HUB_ENABLE_HF_TRANSFER"] = "1"
|
| 38 |
|
| 39 |
|
| 40 |
+
def print_axolotl_text_art():
|
| 41 |
+
ascii_art = """
|
| 42 |
+
dP dP dP
|
| 43 |
+
88 88 88
|
| 44 |
+
.d8888b. dP. .dP .d8888b. 88 .d8888b. d8888P 88
|
| 45 |
+
88' `88 `8bd8' 88' `88 88 88' `88 88 88
|
| 46 |
+
88. .88 .d88b. 88. .88 88 88. .88 88 88
|
| 47 |
+
`88888P8 dP' `dP `88888P' dP `88888P' dP dP
|
| 48 |
+
"""
|
| 49 |
+
|
| 50 |
+
if is_main_process():
|
| 51 |
+
print(ascii_art)
|
| 52 |
+
|
| 53 |
+
|
| 54 |
def get_multi_line_input() -> Optional[str]:
|
| 55 |
print("Give me an instruction (Ctrl + D to finish): ")
|
| 56 |
instruction = ""
|
|
|
|
| 160 |
prepare_ds_only: bool = False,
|
| 161 |
**kwargs,
|
| 162 |
):
|
| 163 |
+
print_axolotl_text_art()
|
| 164 |
if Path(config).is_dir():
|
| 165 |
config = choose_config(config)
|
| 166 |
|