customizable ascii art (#506)

This commit is contained in:
Wing Lian
2023-08-29 10:13:42 -07:00
committed by GitHub
parent 5ac3392075
commit 548787daae
2 changed files with 8 additions and 10 deletions

View File

@@ -24,3 +24,4 @@ rouge-score==0.1.2
scipy scipy
scikit-learn==1.2.2 scikit-learn==1.2.2
pynvml pynvml
art

View File

@@ -16,6 +16,7 @@ import transformers
import yaml import yaml
# add src to the pythonpath so we don't need to pip install this # add src to the pythonpath so we don't need to pip install this
from art import text2art
from optimum.bettertransformer import BetterTransformer from optimum.bettertransformer import BetterTransformer
from transformers import GenerationConfig, TextStreamer from transformers import GenerationConfig, TextStreamer
@@ -53,16 +54,12 @@ class TrainerCliArgs:
shard: bool = field(default=False) shard: bool = field(default=False)
def print_axolotl_text_art(): def print_axolotl_text_art(suffix=None):
ascii_art = """ font = "nancyj"
dP dP dP ascii_text = " axolotl"
88 88 88 if suffix:
.d8888b. dP. .dP .d8888b. 88 .d8888b. d8888P 88 ascii_text += f" x {suffix}"
88' `88 `8bd8' 88' `88 88 88' `88 88 88 ascii_art = text2art(" axolotl", font=font)
88. .88 .d88b. 88. .88 88 88. .88 88 88
`88888P8 dP' `dP `88888P' dP `88888P' dP dP
"""
if is_main_process(): if is_main_process():
print(ascii_art) print(ascii_art)