|
import argparse |
|
import datasets |
|
|
|
|
|
def main(): |
|
parser = argparse.ArgumentParser() |
|
parser.add_argument("--repo", type=str, required=True) |
|
parser.add_argument("--revision", type=str, required=True) |
|
args = parser.parse_args() |
|
|
|
for config_name in ["all", "en", "es", "de", "fr"]: |
|
dataset = datasets.load_dataset( |
|
"./loader.py", config_name, trust_remote_code=True |
|
) |
|
dataset.push_to_hub( |
|
args.repo, |
|
config_name, |
|
set_default=(config_name == "all"), |
|
data_dir=f"parquet/{config_name}", |
|
commit_message=f"Upload parquet/{config_name}", |
|
revision=args.revision, |
|
) |
|
|
|
|
|
if __name__ == "__main__": |
|
main() |
|
|