Skip to content

Commit b5034f2

Browse files
committed
release v0.7.1
Former-commit-id: 1c91007
1 parent 6e6267f commit b5034f2

File tree

3 files changed

+37
-18
lines changed

3 files changed

+37
-18
lines changed

setup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55

66

77
def get_version():
8-
with open(os.path.join("src", "llmtuner", "__init__.py"), "r", encoding="utf-8") as f:
8+
with open(os.path.join("src", "llmtuner", "cli.py"), "r", encoding="utf-8") as f:
99
file_content = f.read()
10-
pattern = r"{0}\W*=\W*\"([^\"]+)\"".format("__version__")
10+
pattern = r"{}\W*=\W*\"([^\"]+)\"".format("VERSION")
1111
(version,) = re.findall(pattern, file_content)
1212
return version
1313

src/llmtuner/__init__.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
# Level: api, webui > chat, eval, train > data, model > extras, hparams
22

3-
__version__ = "0.7.1.dev0"
3+
from .cli import VERSION
4+
5+
6+
__version__ = VERSION

src/llmtuner/cli.py

+31-15
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,41 @@
11
import sys
22
from enum import Enum, unique
33

4-
from . import __version__
54
from .api.app import run_api
65
from .chat.chat_model import run_chat
76
from .eval.evaluator import run_eval
87
from .train.tuner import export_model, run_exp
98
from .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

Comments
 (0)