11import sys
22from enum import Enum , unique
33
4- from . import __version__
54from .api .app import run_api
65from .chat .chat_model import run_chat
76from .eval .evaluator import run_eval
87from .train .tuner import export_model , run_exp
98from .webui .interface import run_web_demo , run_web_ui
109
1110
12- USAGE = """
13- Usage:
14- llamafactory-cli api -h: launch an API server
15- llamafactory-cli chat -h: launch a chat interface in CLI
16- llamafactory-cli eval -h: do evaluation
17- llamafactory-cli export -h: merge LoRA adapters and export model
18- llamafactory-cli train -h: do training
19- llamafactory-cli webchat -h: launch a chat interface in Web UI
20- llamafactory-cli webui: launch LlamaBoard
21- llamafactory-cli version: show version info
22- """
11+ USAGE = (
12+ "-" * 70
13+ + "\n "
14+ + "| Usage: |\n "
15+ + "| llamafactory-cli api -h: launch an OpenAI-style API server |\n "
16+ + "| llamafactory-cli chat -h: launch a chat interface in CLI |\n "
17+ + "| llamafactory-cli eval -h: evaluate models |\n "
18+ + "| llamafactory-cli export -h: merge LoRA adapters and export model |\n "
19+ + "| llamafactory-cli train -h: train models |\n "
20+ + "| llamafactory-cli webchat -h: launch a chat interface in Web UI |\n "
21+ + "| llamafactory-cli webui: launch LlamaBoard |\n "
22+ + "| llamafactory-cli version: show version info |\n "
23+ + "-" * 70
24+ )
25+
26+ VERSION = "0.7.1"
27+
28+ WELCOME = (
29+ "-" * 58
30+ + "\n "
31+ + "| Welcome to LLaMA Factory, version {}" .format (VERSION )
32+ + " " * (21 - len (VERSION ))
33+ + "|\n |"
34+ + " " * 56
35+ + "|\n "
36+ + "| Project page: https://github.com/hiyouga/LLaMA-Factory |\n "
37+ + "-" * 58
38+ )
2339
2440
2541@unique
@@ -31,7 +47,7 @@ class Command(str, Enum):
3147 TRAIN = "train"
3248 WEBDEMO = "webchat"
3349 WEBUI = "webui"
34- VERSION = "version"
50+ VER = "version"
3551 HELP = "help"
3652
3753
@@ -51,8 +67,8 @@ def main():
5167 run_web_demo ()
5268 elif command == Command .WEBUI :
5369 run_web_ui ()
54- elif command == Command .VERSION :
55- print ("Welcome to LLaMA Factory, version {}" . format ( __version__ ) )
70+ elif command == Command .VER :
71+ print (WELCOME )
5672 elif command == Command .HELP :
5773 print (USAGE )
5874 else :
0 commit comments