Update app.py
Browse files1234567891045615 unmodified lines22232432333425262718 unmodified lines464748596061495051import 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 interface with gr.Row(): # Settings button (Small square icon) settings_button = gr.Button("⚙️", elem_id="settings_button", scale=1)
# Chatbot component chatbot_component = gr.Chatbot(type="messages", label="Chat History", height=500)
18 unmodified lines outputs=chatbot_component, )
# Toggle the settings menu when the settings button is clicked settings_button.click(lambda: settings.toggle(), None, None)
demo.launch()
# Launch the interfaceapp.py-13