Spaces:
Runtime error
Runtime error
import re | |
from functools import partial | |
import click | |
from ditk import logging | |
from gchar.generic import import_generic | |
from gchar.utils import GLOBAL_CONTEXT_SETTINGS | |
from gchar.utils import print_version as _origin_print_version | |
from unidecode import unidecode | |
from .bangumibase import sync_bangumi_base | |
from .extract import extract_to_huggingface | |
import_generic() | |
print_version = partial(_origin_print_version, 'cyberharem.dataset.video') | |
def cli(): | |
pass # pragma: no cover | |
def huggingface(video_or_directory: str, bangumi_name: str, | |
repository: str, revision: str = 'main', min_size: int = 320, no_extract: bool = False): | |
logging.try_init_root(logging.INFO) | |
rname = re.sub(r'[\W_]+', '', unidecode(bangumi_name.lower())) | |
repository = repository or f"BangumiBase/{rname}" | |
extract_to_huggingface( | |
video_or_directory, bangumi_name, repository, revision, | |
no_extract=no_extract, min_size=min_size | |
) | |
def bgsync(repository: str): | |
logging.try_init_root(logging.INFO) | |
sync_bangumi_base(repository) | |
if __name__ == '__main__': | |
cli() | |