h_novel / main.py
qgyd2021's picture
[update]process filename
06124c0
raw
history blame
840 Bytes
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import argparse
from datasets import load_dataset
from project_settings import project_path
def get_args():
parser = argparse.ArgumentParser()
parser.add_argument("--dataset_path", default="h_novel.py", type=str)
parser.add_argument("--dataset_name", default="yazhou_20m", type=str)
parser.add_argument(
"--dataset_cache_dir",
default=(project_path / "hub_datasets").as_posix(),
type=str
)
args = parser.parse_args()
return args
def main():
args = get_args()
dataset = load_dataset(
path=args.dataset_path,
name=args.dataset_name,
cache_dir=args.dataset_cache_dir,
)
for sample in dataset["train"]:
print(sample)
print("-" * 150)
return
if __name__ == '__main__':
main()