Spaces:
Paused
Paused
Download app.py from prad9036temp/prad: direct link, hf CLI and curl.
- Browser
- Download file 699 Bytes
-
https://huggingface.co/spaces/prad9036temp/prad/resolve/main/app.py
- Command line
-
hf download hf://spaces/prad9036temp/prad/app.py
-
curl -L -o app.py https://huggingface.co/spaces/prad9036temp/prad/resolve/main/app.py
699 Bytes
| import os | |
| import subprocess | |
| import gradio as gr | |
| def start_gotty(): | |
| if not os.path.exists("gotty"): | |
| subprocess.run( | |
| "curl -L https://github.com/yudai/gotty/releases/download/v1.0.1/gotty_linux_amd64.tar.gz | tar -xz", | |
| shell=True, | |
| check=True | |
| ) | |
| os.chmod("gotty", 0o755) | |
| os.environ["TERM"] = "xterm-256color" | |
| subprocess.Popen([ | |
| "./gotty", | |
| "-w", | |
| "-p", "8080", | |
| "-c", "pradeepydv:prdp1234", | |
| "bash" | |
| ]) | |
| start_gotty() | |
| def ui(): | |
| return "GoTTY running. Open the terminal at /" | |
| demo = gr.Interface(fn=ui, inputs=[], outputs="text") | |
| demo.launch(server_name="0.0.0.0", server_port=7860) | |