stream / app.py
anondev-1337's picture
Update app.py
28dde00 verified
Raw History Blame Contribute Delete
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