Skip to content

Instantly share code, notes, and snippets.

@kevinmelodi
Created September 13, 2023 02:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kevinmelodi/7da5fe653c4d8f36a0d987e6ad67cf8d to your computer and use it in GitHub Desktop.
Save kevinmelodi/7da5fe653c4d8f36a0d987e6ad67cf8d to your computer and use it in GitHub Desktop.
import subprocess
import argparse
# Initialize argparse to parse command-line arguments
parser = argparse.ArgumentParser(description="Run a Prodigy custom-text-classification task.")
parser.add_argument("--dataset", required=True, help="The name of the dataset.")
parser.add_argument("--input_file", required=True, help="The path to the input file on the local prodigy machine.")
# Parse the arguments
args = parser.parse_args()
# Your command broken down into its individual components, with the timestamp
command = [
"prodigy",
"custom-text-classification", # task name/recipe/layout
args.dataset, # dataset name from command line args
args.input_file, # input file path from command line args
"-F",
"scripts/custom_task_template.py" # layout source
]
# Run the command
subprocess.run(command)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment