1
1
import sys
2
2
from enum import Enum , unique
3
3
4
- from . import __version__
5
4
from .api .app import run_api
6
5
from .chat .chat_model import run_chat
7
6
from .eval .evaluator import run_eval
8
7
from .train .tuner import export_model , run_exp
9
8
from .webui .interface import run_web_demo , run_web_ui
10
9
11
10
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
+ )
23
39
24
40
25
41
@unique
@@ -31,7 +47,7 @@ class Command(str, Enum):
31
47
TRAIN = "train"
32
48
WEBDEMO = "webchat"
33
49
WEBUI = "webui"
34
- VERSION = "version"
50
+ VER = "version"
35
51
HELP = "help"
36
52
37
53
@@ -51,8 +67,8 @@ def main():
51
67
run_web_demo ()
52
68
elif command == Command .WEBUI :
53
69
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 )
56
72
elif command == Command .HELP :
57
73
print (USAGE )
58
74
else :
0 commit comments