mirror of
https://github.com/QData/TextAttack.git
synced 2021-10-13 00:05:06 +03:00
add list and augment functionality + tests
This commit is contained in:
@@ -1,18 +1,22 @@
|
||||
#!/usr/bin/env python
|
||||
import argparse
|
||||
import os
|
||||
import sys
|
||||
|
||||
from textattack.commands.attack import AttackCommand
|
||||
from textattack.commands.attack import AttackResumeCommand
|
||||
from textattack.commands.attack import AttackCommand, AttackResumeCommand
|
||||
from textattack.commands.augment import AugmentCommand
|
||||
from textattack.commands.benchmark_model import BenchmarkModelCommand
|
||||
from textattack.commands.benchmark_recipe import BenchmarkRecipeCommand
|
||||
from textattack.commands.list_things import ListThingsCommand
|
||||
from textattack.commands.train_model import TrainModelCommand
|
||||
|
||||
|
||||
def main():
|
||||
print('main()')
|
||||
parser = argparse.ArgumentParser("TextAttack CLI", usage="[python -m] texattack <command> [<args>]",
|
||||
formatter_class=argparse.ArgumentDefaultsHelpFormatter
|
||||
)
|
||||
parser = argparse.ArgumentParser(
|
||||
"TextAttack CLI",
|
||||
usage="[python -m] texattack <command> [<args>]",
|
||||
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
|
||||
)
|
||||
subparsers = parser.add_subparsers(help="textattack command helpers")
|
||||
|
||||
# Register commands
|
||||
@@ -21,11 +25,12 @@ def main():
|
||||
AugmentCommand.register_subcommand(subparsers)
|
||||
BenchmarkModelCommand.register_subcommand(subparsers)
|
||||
BenchmarkRecipeCommand.register_subcommand(subparsers)
|
||||
ListThingsCommand.register_subcommand(subparsers)
|
||||
TrainModelCommand.register_subcommand(subparsers)
|
||||
|
||||
# Let's go
|
||||
args = parser.parse_args()
|
||||
|
||||
|
||||
if not hasattr(args, "func"):
|
||||
parser.print_help()
|
||||
exit(1)
|
||||
|
||||
Reference in New Issue
Block a user