From cbb3a09dd8f529d851165c81c31b9caa1a52329d Mon Sep 17 00:00:00 2001 From: carry <2641257231@qq.com> Date: Thu, 10 Apr 2025 22:05:04 +0800 Subject: [PATCH] =?UTF-8?q?feat(tools):=20=E6=B7=BB=E5=8A=A0=E6=A8=A1?= =?UTF-8?q?=E5=9E=8B=E5=90=8D=E7=A7=B0=E8=8E=B7=E5=8F=96=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 tools 目录下新增 model.py 文件 - 实现 get_model_name 函数,用于获取模型的名称 - 更新 tools/__init__.py,导入新的 get_model_name 函数 --- tools/__init__.py | 4 +++- tools/model.py | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 tools/model.py diff --git a/tools/__init__.py b/tools/__init__.py index 1c1e383..901f13c 100644 --- a/tools/__init__.py +++ b/tools/__init__.py @@ -1,2 +1,4 @@ from .parse_markdown import parse_markdown -from .scan_doc_dir import * \ No newline at end of file +from .scan_doc_dir import * +from .json_example import generate_example_json +from .model import get_model_name \ No newline at end of file diff --git a/tools/model.py b/tools/model.py new file mode 100644 index 0000000..4c84d05 --- /dev/null +++ b/tools/model.py @@ -0,0 +1,4 @@ +import os + +def get_model_name(model): + return os.path.basename(model.name_or_path) \ No newline at end of file