Parses network folders and responsible for passing --help flags to subcommands if --network is provided.
()
| 280 | |
| 281 | |
| 282 | def main() -> None: |
| 283 | """ |
| 284 | Parses network folders and responsible for passing --help flags to subcommands if --network is provided. |
| 285 | """ |
| 286 | # Verify python version support |
| 287 | verify_python_version() |
| 288 | |
| 289 | # Get all available network scripts |
| 290 | networks = register_network_folders(os.getcwd()) |
| 291 | |
| 292 | # Add network folder for entry point |
| 293 | description = "Runs TensorRT networks that are based-off of HuggingFace variants." |
| 294 | parser = get_default_parser(networks, description, add_default_help=False) |
| 295 | |
| 296 | # Get the general network wrapper help |
| 297 | known_args, _ = parser.parse_known_args() |
| 298 | |
| 299 | # Delegate parser to action specifics |
| 300 | action = get_action(known_args.action, networks, parser) |
| 301 | known_args, _ = parser.parse_known_args() |
| 302 | |
| 303 | # If bootstrap occurs, then the spawned process completes the rest of demo. |
| 304 | # We can exit safely. We spawn after parsing basic args to reduce loading churn on rudimentary help commands. |
| 305 | if bootstrap_ld_library_path(): |
| 306 | sys.exit(0) |
| 307 | |
| 308 | return action.execute(known_args) |
| 309 | |
| 310 | |
| 311 | if __name__ == "__main__": |
no test coverage detected