parlai.core.script
The general ParlAI Script interface.
An abstract class to help standardize the call to ParlAI scripts, enabling them to be
completed easily.
Also contains helper classes for loading scripts, etc.
-
parlai.core.script.setup_script_registry()[source]
Loads the scripts so that @register_script is hit for all.
-
class parlai.core.script.ParlaiScript(opt: Opt)[source]
Bases: object
A ParlAI script is a standardized form of access.
-
abstract classmethod setup_args() → ParlaiParser[source]
Create the parser with args.
-
__init__(opt: Opt)[source]
-
abstract run()[source]
The main method.
Must be implemented by the script writer.
-
classmethod main(*args, **kwargs)[source]
Run the program, possibly with some given args.
You may provide command line args in the form of strings, or
options. For example:
>>> MyScript.main(['--task', 'convai2'])
>>> MyScript.main(task='convai2')
You may not combine both args and kwargs.
-
parlai.core.script.superscript_main(args=None)[source]
Superscript is a loader for all the other scripts.