Spaces:
Build error
Build error
Update app.py
Browse files26 unmodified lines272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081093 unmodified lines11311411511611711811912012112212312426 unmodified linesexcept Exception as e:return f"Error: {str(e)}"# Custom CSS for light modelight_css = """.gradio-container {background-color: #f9f9f9;font-family: 'Arial', sans-serif;padding: 20px;}#chatbox {background-color: white;border-radius: 10px;padding: 15px;box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);height: 400px;overflow-y: auto;}#input-container {display: flex;align-items: center;border: 1px solid #ccc;border-radius: 20px;padding: 5px;background-color: white;}#message-input {flex-grow: 1;border: none;padding: 10px;font-size: 14px;outline: none;margin-right: 5px; /* Add some space between input and button */}#send-button {border: none;background: none;cursor: pointer;padding: 2px; /* Reduced padding for smaller button */font-size: 12px;width: 30px; /* Adjusted width for smaller button */height: 30px; /* Adjusted height for smaller button */color: #007BFF;transition: opacity 0.3s;}#send-button:hover {opacity: 0.7;}#settings-container {margin-top: 20px;}"""# Dark mode CSSdark_css = """.gradio-container {background-color: #1e1e1e; /* Dark background */color: white; /* Light text color */}#chatbox {background-color: #2e2e2e; /* Dark chatbox */color: white; /* Light text color */}#input-container {background-color: #2e2e2e; /* Dark input container */border: 1px solid #444; /* Dark border */}#message-input {background-color: #3e3e3e; /* Dark input field */color: white; /* Light text color */}#send-button {color: #007BFF; /* Button text color */}"""# Function to toggle dark modedef toggle_dark_mode(is_dark):return dark_css if is_dark else light_css# Create Gradio interfacedef create_interface():with gr.Blocks() as demo:3 unmodified lineschatbox = gr.Textbox(label="", interactive=False, elem_id="chatbox", lines=12)# Input field with button insidewith gr.Row(elem_id="input-container"):message = gr.Textbox(placeholder="Type a message...", elem_id="message-input", lines=1, show_label=False)send_btn = gr.Button("➤", elem_id="send-button")# Settings sectionwith gr.Accordion("⚙️ Settings", open=False, elem_id="settings-container"):model = gr.Dropdown(choices=["Lake 1 Base"], label="Model", value="Lake 1 Base")preset = gr.Dropdown(choices=["Fast", "Normal", "Quality", "Unreal Performance"], label="Preset", value="Fast")dark_mode = gr.Checkbox(label="Enable Dark Mode", value=False)26 unmodified lines2728293031323 unmodified lines36373839404142434445464726 unmodified linesexcept Exception as e:return f"Error: {str(e)}"# Create Gradio interfacedef create_interface():with gr.Blocks() as demo:3 unmodified lineschatbox = gr.Textbox(label="", interactive=False, elem_id="chatbox", lines=12)# Input field with button insidewith gr.Row():message = gr.Textbox(placeholder="Type a message...", lines=1, show_label=False)send_btn = gr.Button("➤", elem_id="send-button", scale=0.5) # Use scale to make the button smaller# Settings sectionwith gr.Accordion("⚙️ Settings", open=False):model = gr.Dropdown(choices=["Lake 1 Base"], label="Model", value="Lake 1 Base")preset = gr.Dropdown(choices=["Fast", "Normal", "Quality", "Unreal Performance"], label="Preset", value="Fast")dark_mode = gr.Checkbox(label="Enable Dark Mode", value=False)
app.py+4-81