Spaces:
Runtime error
Runtime error
from functools import partial | |
from typing import Optional | |
import click | |
from ditk import logging | |
from gchar.utils import GLOBAL_CONTEXT_SETTINGS | |
from gchar.utils import print_version as _origin_print_version | |
from .tags import save_recommended_tags | |
print_version = partial(_origin_print_version, 'cyberharem.dataset') | |
def cli(): | |
pass # pragma: no cover | |
def retag(workdir, name: Optional[str] = None): | |
logging.try_init_root(logging.INFO) | |
from ..publish.steps import find_steps_in_workdir | |
pt_name, _ = find_steps_in_workdir(workdir) | |
name = name or '_'.join(pt_name.split('_')[:-1]) | |
logging.info(f'Regenerate tags for {name!r}, on {workdir!r}.') | |
save_recommended_tags(name, workdir=workdir) | |
logging.info('Success!') | |
if __name__ == '__main__': | |
cli() | |