Update app.py
Browse files1234567891011121315 unmodified lines29303132333435363718 unmodified lines565758596061626364import gradio as grfrom transformers import pipeline# Initialize a dictionary with some models for selectionmodels = {"Google mt5-base": "google/mt5-base","GPT-2": "gpt2","BERT": "bert-base-uncased"}# Function to generate text based on the modeldef chatbot(user_input, history, max_length=50, temperature=1.0):# Load the selected model (using a hard-coded model for now)15 unmodified lines# Define the chat interfacewith gr.Row():# Settings button (Small square icon)settings_button = gr.Button("⚙️", elem_id="settings_button", scale=1)# Chatbot componentchatbot_component = gr.Chatbot(type="messages", label="Chat History", height=500)18 unmodified linesoutputs=chatbot_component,)# Toggle the settings menu when the settings button is clickedsettings_button.click(lambda: settings.toggle(), None, None)demo.launch()# Launch the interface12345615 unmodified lines22232425262718 unmodified lines464748495051import gradio as grfrom transformers import pipeline# Function to generate text based on the modeldef chatbot(user_input, history, max_length=50, temperature=1.0):# Load the selected model (using a hard-coded model for now)15 unmodified lines# Define the chat interfacewith gr.Row():# Chatbot componentchatbot_component = gr.Chatbot(type="messages", label="Chat History", height=500)18 unmodified linesoutputs=chatbot_component,)demo.launch()# Launch the interface
app.py-13