import random import gradio as gr from huggingface_hub import InferenceClient def random_response(message, history): return random.choice(["Yes", "No"]) with gr.Blocks(theme=gr.themes.Soft(primary_hue="teal", secondary_hue="slate", neutral_hue="neutral")) as demo: # Using Soft theme with adjusted hues for a refined look gr.HTML(""" """) with gr.Row(): gr.Textbox( label="API key", scale=4, ) gr.Button( value="Apply", scale=1, ) gr.ChatInterface(random_response, multimodal=True, chatbot=gr.Chatbot( label="output", ), type="messages", textbox=gr.MultimodalTextbox( label="input", ), editable=True, title="Chat interface test", save_history=True, ) gr.Textbox(label="System instructions",) gr.Slider(label="temperature", minimum=0, maximum=2, value=0.95) gr.Slider(label="topP", minimum=0, maximum=1, value=0.5) gr.Slider(label="topK", value=100) if __name__ == "__main__": demo.launch()