Spaces:
Running
Running
Download app.py from andreped/AeroPath: direct link, hf CLI and curl.
- Browser
- Download file 1.02 kB
-
https://huggingface.co/spaces/andreped/AeroPath/resolve/ff7eaadaa94e9defe722cba0bc35708a28de0fd3/app.py
- Command line
-
hf download hf://spaces/andreped/AeroPath@ff7eaadaa94e9defe722cba0bc35708a28de0fd3/app.py
-
curl -L -o app.py https://huggingface.co/spaces/andreped/AeroPath/resolve/ff7eaadaa94e9defe722cba0bc35708a28de0fd3/app.py
1.02 kB
| import os | |
| from argparse import ArgumentParser | |
| from AeroPath.gui import WebUI | |
| def main(): | |
| parser = ArgumentParser() | |
| parser.add_argument( | |
| "--cwd", | |
| type=str, | |
| default="/home/user/app/", | |
| help="Set current working directory (path to app.py).", | |
| ) | |
| parser.add_argument( | |
| "--share", | |
| type=int, | |
| default=1, | |
| help="Whether to enable the app to be accessible online" | |
| "-> setups a public link which requires internet access.", | |
| ) | |
| args = parser.parse_args() | |
| print("Current working directory:", args.cwd) | |
| if not os.path.exists(args.cwd): | |
| raise ValueError("Chosen 'cwd' is not a valid path!") | |
| if args.share not in [0, 1]: | |
| raise ValueError( | |
| "The 'share' argument can only be set to 0 or 1, but was:", | |
| args.share, | |
| ) | |
| # initialize and run app | |
| print("Launching demo...") | |
| app = WebUI(cwd=args.cwd, share=args.share) | |
| app.run() | |
| if __name__ == "__main__": | |
| main() | |