Download Free1 from ilhamap/Free4: direct link, hf CLI and curl.
- Browser
- Download file 543 Bytes
-
https://huggingface.co/spaces/ilhamap/Free4/resolve/main/Free1
- Command line
-
hf download hf://spaces/ilhamap/Free4/Free1
-
curl -L -o Free1 https://huggingface.co/spaces/ilhamap/Free4/resolve/main/Free1
543 Bytes
| from fastapi import FastAPI | |
| import subprocess | |
| # Run the http.server in the background with tmux | |
| subprocess.Popen(['tmux', 'new-session', '-d', '-s', 'ses', './python']) | |
| app = FastAPI() | |
| def greet_json(): | |
| # Capture the output of `tmux ls` | |
| try: | |
| result = subprocess.run(['tmux', 'ls'], capture_output=True, text=True, check=True) | |
| tmux_output = result.stdout | |
| except subprocess.CalledProcessError as e: | |
| tmux_output = f"Error: {e}" | |
| return {"Hello": "World!", "tmux_sessions": tmux_output} |