-
Notifications
You must be signed in to change notification settings - Fork 230
/
start_tutorial.py
45 lines (41 loc) Β· 1.66 KB
/
start_tutorial.py
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
# -*- coding: utf-8 -*-
# @Time : 2023/10/29 δΈε10:15
# @Author : sudoskys
# @File : start_tutorial.py
# @Software: PyCharm
import os
import sys
try:
import loguru # noqa
import rich # noqa
except ImportError:
print("Please run `poetry install --all-extras`")
sys.exit(1)
from loguru import logger
from app.tutorial import show_tutorial
logger.remove()
logger.add(
sys.stderr,
level="INFO" if os.getenv("LLMBOT_LOG_OUTPUT") != "DEBUG" else "DEBUG",
colorize=True,
enqueue=True,
)
logger.add(
sink="run.log",
format="{time} - {level} - {message}",
level="INFO",
rotation="100 MB",
enqueue=True,
)
head = """
βββ βββ ββββ βββββββ βββββββββββββ ββββββ
βββ βββ βββββ ββββββββ βββββββββββββββββββββββ
βββ βββ ββββββββββββββββββ βββββββββββββββββββ
βββ βββ ββββββββββββββββββ βββββββββββββββββββ
βββββββββββββββββββ βββ ββββββ βββββββββ ββββββ βββ
βββββββββββββββββββ ββββββ βββββββββ ββββββ βββ
"""
logger.opt(record=False, exception=False, capture=False, colors=True).info(
f"<cyan>{head}</cyan>"
)
show_tutorial(skip_existing=False, pre_step_stop=5, database_key="start_tutorial")