Download scripts/litert_export_wrapper.py from bhriguverma/ankahi: direct link, hf CLI and curl.
- Browser
- Download file 781 Bytes
-
https://huggingface.co/bhriguverma/ankahi/resolve/main/scripts/litert_export_wrapper.py
- Command line
-
hf download hf://bhriguverma/ankahi/scripts/litert_export_wrapper.py
-
curl -L -o litert_export_wrapper.py https://huggingface.co/bhriguverma/ankahi/resolve/main/scripts/litert_export_wrapper.py
781 Bytes
| 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) | |