Spaces:
Runtime error
Runtime error
Download app.py from anondev-1337/stream: direct link, hf CLI and curl.
- Browser
- Download file 804 Bytes
-
https://huggingface.co/spaces/anondev-1337/stream/resolve/main/app.py
- Command line
-
hf download hf://spaces/anondev-1337/stream/app.py
-
curl -L -o app.py https://huggingface.co/spaces/anondev-1337/stream/resolve/main/app.py
804 Bytes
| import os | |
| print('[pre] Installing Packages') | |
| os.system("npm i") | |
| print('[pre] Packages installed') | |
| import threading | |
| import time | |
| import gradio as gr | |
| #lol | |
| def runbot(): | |
| os.system("node ./index.js") | |
| if __name__ == "__main__": | |
| # Start the generation loop in a separate thread | |
| generation_thread = threading.Thread(target=runbot, daemon=True) | |
| generation_thread.start() | |
| def dummy_function(): | |
| return "Bot is running in background" | |
| ifaces = gr.Interface(fn=dummy_function, | |
| inputs=None, | |
| outputs="text", | |
| title="Stream Bot", | |
| description="The bot is running in the background.") | |
| ifaces.launch(server_name="0.0.0.0", server_port=1337) # Added server name and port | |