Spaces:
Build error
Build error
SHAMIL SHAHBAZ AWAN commited on
Update app.py
Browse files37 unmodified lines383940414142434418 unmodified lines636465666766676869702 unmodified lines73747576777677787980818384828384858889909192939495969798991001018687882 unmodified lines9192931101111121131149495968 unmodified lines10510610712913013113213313413513610810911037 unmodified lines yield response
# Gradio Interface with UI Enhancements and Effects# Gradio Interfacewith gr.Blocks(theme="soft") as demo: gr.HTML( """18 unmodified lines label="System message", lines=2, max_lines=3, interactive=True, elem_id="system_message_box", visible=False, # Hide the system message from the display interactive=False, # Ensure the user cannot interact with it ), gr.Slider( minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"2 unmodified lines minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature", step=0.1, label="Temperature", ), gr.Slider( minimum=0.1, maximum=1.0, value=0.95, step=0.05, label="Top-p (nucleus sampling)", step=0.05, label="Top-p (nucleus sampling)", ), ], ) with gr.Column(scale=1): gr.HTML( """ <div style="background: #eaf4f4; padding: 15px; border-radius: 10px; box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1); animation: slideIn 1.5s;"> <h3 style="color: #2c7873;">Tips for Better Interaction:</h3> <ul style="font-size: 14px; color: #4a4a4a;"> <li>Provide clear and concise messages for optimal responses.</li> <li>Adjust the <strong>Temperature</strong> for more creative or focused answers.</li> <li>Use <strong>Top-p</strong> for better control over randomness in responses.</li> </ul> </div> """ )
# Styling the background and adding animations demo.css = """2 unmodified lines 100% { opacity: 1; } } @keyframes slideIn { 0% { transform: translateX(-50px); opacity: 0; } 100% { transform: translateX(0); opacity: 1; } } body { background: linear-gradient(120deg, #f9fafb, #dfe8f0); font-family: Arial, sans-serif;8 unmodified lines transform: scale(1.02); border-color: #6fc3df; } #system_message_box { border: 2px dashed #4a90e2; background-color: #f0f9ff; transition: background-color 0.3s ease; } #system_message_box:hover { background-color: #eaf6ff; } .gr-slider { background-color: #e9f7fc; box-shadow: inset 0px 2px 4px rgba(0, 0, 0, 0.1);app.py+5-34