import random import gradio as gr import os with gr.Blocks() as demo: def random_response(message, history): return random.choice(["Yes", "No"]) with gr.Tab("chat"): gr.ChatInterface(random_response, title=os.environ.get("EXAMPLE"), description=os.environ.get("SECRET_EXAMPLE")) with gr.Tab("image"): gr.Image("images/sainsburys.jpeg") def run(): demo.launch(server_name="0.0.0.0", server_port=7860, inbrowser=True) if __name__ == "__main__": run()