Skip to content

Commit

Permalink
code.core>modify.refactor: add log to show no definition tags into `a…
Browse files Browse the repository at this point in the history
…utotagdef` subcommand
  • Loading branch information
pwnfan committed Aug 1, 2023
1 parent 602f7e2 commit 41e7b74
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions tagmark/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,11 @@ def auto_tag_def(
tag_definitions=_tags_info,
little_info_tag_is_ok=little_info_tag_is_ok,
)
if _new_tag_definitions:
__logger.info(
msg="no definition tags found!",
no_definition_tags=_new_tag_definitions.keys(),
)

new_tags_info: dict[str:dict] = _tags_info.copy()
for _tag, _definition in _new_tag_definitions.items():
Expand Down
3 changes: 2 additions & 1 deletion tagmark/tools/autotagdef.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def auto_define_tags(
for _tag, _tag_value in tqdm(tag_infos.items()):
_tag_item: TagItem = TagItem(tag=_tag, **_tag_value)

if _tag_item.definition:
if _tag_item.definition and _tag_item.definition.strip():
auto_tag_make_stats.count_already_defined += 1
continue
else:
Expand Down Expand Up @@ -94,6 +94,7 @@ def auto_define_tags(
msg=f"Error occurs when getting the definition tag {_tag} from gpt",
exc_info=True,
)
new_tag_definitions[_tag] = None
auto_tag_make_stats.count_auto_made_fail += 1

return new_tag_definitions, auto_tag_make_stats

0 comments on commit 41e7b74

Please sign in to comment.