web-ui / webui_with_vnc.py
binary1ne's picture
Create webui_with_vnc.py
8f0dd8d verified
Raw
History Blame
347 Bytes
import gradio as gr
import os
def greet(name):
return f"Hello {name}!"
demo = gr.Interface(fn=greet, inputs="text", outputs="text")
# Serve noVNC files inside /web-vnc
novnc_path = "/web-ui/static/novnc"
if os.path.exists(novnc_path):
demo.add_static_route("/web-vnc", novnc_path)
demo.launch(server_name="0.0.0.0", server_port=7860)