| import typing | |
| try: | |
| from typing import Self | |
| except ImportError: | |
| from typing_extensions import Self | |
| typing.Self = Self | |
| import enum | |
| if not hasattr(enum, "StrEnum"): | |
| class StrEnum(str, enum.Enum): | |
| def __str__(self): | |
| return str(self.value) | |
| enum.StrEnum = StrEnum | |
| import sys | |
| from litert_torch.generative.export_hf.export_main import main | |
| if __name__ == "__main__": | |
| # If main expects an argument like in absl.app.run(main), it usually passes argv. | |
| # But since it failed with missing 1 positional argument '_', let's try passing sys.argv. | |
| try: | |
| main(sys.argv) | |
| except Exception as e: | |
| print(f"Failed with sys.argv: {e}") | |
| # Try fire-like or direct call if argv didn't work | |
| # (Though usually it's absl) | |