feat(tools): 添加模型名称获取函数

- 在 tools 目录下新增 model.py 文件
- 实现 get_model_name 函数,用于获取模型的名称
- 更新 tools/__init__.py,导入新的 get_model_name 函数
This commit is contained in:
carry 2025-04-10 22:05:04 +08:00
parent 2e552c186d
commit cbb3a09dd8
2 changed files with 7 additions and 1 deletions

View File

@ -1,2 +1,4 @@
from .parse_markdown import parse_markdown
from .scan_doc_dir import *
from .json_example import generate_example_json
from .model import get_model_name

4
tools/model.py Normal file
View File

@ -0,0 +1,4 @@
import os
def get_model_name(model):
return os.path.basename(model.name_or_path)