Spaces:
Build error
Build error
SHAMIL SHAHBAZ AWAN commited on
Update app.py
Browse files37 unmodified lines3839404142434418 unmodified lines63646566676869702 unmodified lines7374757677787980818283848586878889909192939495969798991001011021031042 unmodified lines1071081091101111121131141151161178 unmodified lines12612712812913013113213313413513613713813937 unmodified linesyield response# Gradio Interface with UI Enhancements and Effectswith gr.Blocks(theme="soft") as demo:gr.HTML("""18 unmodified lineslabel="System message",lines=2,max_lines=3,interactive=True,elem_id="system_message_box",),gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"2 unmodified linesminimum=0.1,maximum=4.0,value=0.7,step=0.1,label="Temperature",),gr.Slider(minimum=0.1,maximum=1.0,value=0.95,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 animationsdemo.css = """2 unmodified lines100% { 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 linestransform: 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);37 unmodified lines3839404142434418 unmodified lines63646566676869702 unmodified lines737475767778798081828384858687882 unmodified lines9192939495968 unmodified lines10510610710810911037 unmodified linesyield response# Gradio Interfacewith gr.Blocks(theme="soft") as demo:gr.HTML("""18 unmodified lineslabel="System message",lines=2,max_lines=3,visible=False, # Hide the system message from the displayinteractive=False, # Ensure the user cannot interact with it),gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"2 unmodified linesminimum=0.1,maximum=4.0,value=0.7,step=0.1, label="Temperature",),gr.Slider(minimum=0.1,maximum=1.0,value=0.95,step=0.05, label="Top-p (nucleus sampling)",),],)# Styling the background and adding animationsdemo.css = """2 unmodified lines100% { opacity: 1; }}body {background: linear-gradient(120deg, #f9fafb, #dfe8f0);font-family: Arial, sans-serif;8 unmodified linestransform: scale(1.02);border-color: #6fc3df;}.gr-slider {background-color: #e9f7fc;box-shadow: inset 0px 2px 4px rgba(0, 0, 0, 0.1);
app.py+5-34