<filename>run.py
import argparse

from jiant.proj.simple import runscript as run
import jiant.scripts.download_data.runscript as downloader


def main(
    task_name,
    data_dir,
    exp_dir,
    model_name_or_path,
    compression_type,
    compression_config,
    learning_rate,
    seed,
):
    downloader.download_data([task_name], data_dir)

    # Set up the arguments for the Simple API
    args = run.RunConfiguration(
        run_name="simple",
        exp_dir=exp_dir,
        data_dir=data_dir,
        hf_pretrained_model_name_or_path=model_name_or_path,
        compression_type=compression_type,
        compression_config=compression_config,
        tasks=task_name,
        train_batch_size=32,
        num_train_epochs=100,
        learning_rate=learning_rate,
        seed=seed,
        do_save_best=True,
    )

    run.run_simple(args)


if __name__ == "__main__":
    parser = argparse.ArgumentParser()

    parser.add_argument("-t", "--task_name")
    parser.add_argument("-d", "--data_dir")
    parser.add_argument("-e", "--exp_dir")
    parser.add_argument("-m", "--model_name_or_path")
    parser.add_argument("-c", "--compression_type")
    parser.add_argument("-cc", "--compression_config")
    parser.add_argument("-lr", "--learning_rate", default=1e-5, type=float)
    parser.add_argument("-s", "--seed", default=42, type=int)

    args = parser.parse_args()

    main(
        args.task_name,
        args.data_dir,
        args.exp_dir,
        args.model_name_or_path,
        args.compression_type,
        args.compression_config,
        args.learning_rate,
        args.seed,
    )

<filename>run.py
import argparse

from jiant.proj.simple import runscript as run
import jiant.scripts.download_data.runscript as downloader


def main(
    task_name,
    data_dir,
    exp_dir,
    model_name_or_path,
    compression_type,
    compression_config,
    learning_rate,
    seed,
):
    downloader.download_data([task_name], data_dir)

    # Set up the arguments for the Simple API
    args = run.RunConfiguration(
        run_name="simple",
        exp_dir=exp_dir,
        data_dir=data_dir,
        hf_pretrained_model_name_or_path=model_name_or_path,
        compression_type=compression_type,
        compression_config=compression_config,
        tasks=task_name,
        train_batch_size=32,
        num_train_epochs=100,
        learning_rate=learning_rate,
        seed=seed,
        do_save_best=True,
    )

    run.run_simple(args)


if __name__ == "__main__":
    parser = argparse.ArgumentParser()

    parser.add_argument("-t", "--task_name")
    parser.add_argument("-d", "--data_dir")
    parser.add_argument("-e", "--exp_dir")
    parser.add_argument("-m", "--model_name_or_path")
    parser.add_argument("-c", "--compression_type")
    parser.add_argument("-cc", "--compression_config")
    parser.add_argument("-lr", "--learning_rate", default=1e-5, type=float)
    parser.add_argument("-s", "--seed", default=42, type=int)

    args = parser.parse_args()

    main(
        args.task_name,
        args.data_dir,
        args.exp_dir,
        args.model_name_or_path,
        args.compression_type,
        args.compression_config,
        args.learning_rate,
        args.seed,
    )

# Set up the arguments for the Simple API