SHAMIL SHAHBAZ AWAN commited on
Commit
89b1338
·
verified ·
1 Parent(s): 722b6b6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +33 -8
app.py CHANGED
@@ -38,14 +38,16 @@ def respond(
38
  yield response
39
 
40
 
41
- # Gradio Interface with UI Customization
42
  with gr.Blocks(theme="soft") as demo:
43
  gr.HTML(
44
  """
45
- <div style="background-color: #f0f4ff; padding: 10px; border-radius: 10px; text-align: center;">
46
- <h1 style="color: #4a90e2;">AI Chat Interface</h1>
47
- <p style="font-size: 16px; color: #4a4a4a;">
48
- Powered by Hugging Face's Zephyr-7B model. Customize your system message and parameters for a tailored chat experience.
 
 
49
  </p>
50
  </div>
51
  """
@@ -86,7 +88,8 @@ with gr.Blocks(theme="soft") as demo:
86
  with gr.Column(scale=1):
87
  gr.HTML(
88
  """
89
- <div style="background-color: #eaf4f4; padding: 15px; border-radius: 10px;">
 
90
  <h3 style="color: #2c7873;">Tips for Better Interaction:</h3>
91
  <ul style="font-size: 14px; color: #4a4a4a;">
92
  <li>Provide clear and concise messages for optimal responses.</li>
@@ -97,21 +100,43 @@ with gr.Blocks(theme="soft") as demo:
97
  """
98
  )
99
 
100
- # Styling the background
101
  demo.css = """
 
 
 
 
 
 
 
 
 
 
102
  body {
103
- background-color: #f9fafb;
 
104
  }
105
  .gr-textbox {
106
  border: 1px solid #e1e4e8;
107
  border-radius: 5px;
 
 
 
 
 
 
108
  }
109
  #system_message_box {
110
  border: 2px dashed #4a90e2;
111
  background-color: #f0f9ff;
 
 
 
 
112
  }
113
  .gr-slider {
114
  background-color: #e9f7fc;
 
115
  }
116
  """
117
 
 
38
  yield response
39
 
40
 
41
+ # Gradio Interface with UI Enhancements and Effects
42
  with gr.Blocks(theme="soft") as demo:
43
  gr.HTML(
44
  """
45
+ <div style="background: linear-gradient(135deg, #4a90e2, #6fc3df);
46
+ padding: 20px; border-radius: 10px; text-align: center;
47
+ box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2); animation: fadeIn 2s;">
48
+ <h1 style="color: white; font-size: 36px;">AI Chat Interface</h1>
49
+ <p style="font-size: 18px; color: white;">
50
+ Powered by Hugging Face's Zephyr-7B model. Customize parameters for a tailored chat experience.
51
  </p>
52
  </div>
53
  """
 
88
  with gr.Column(scale=1):
89
  gr.HTML(
90
  """
91
+ <div style="background: #eaf4f4; padding: 15px; border-radius: 10px;
92
+ box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1); animation: slideIn 1.5s;">
93
  <h3 style="color: #2c7873;">Tips for Better Interaction:</h3>
94
  <ul style="font-size: 14px; color: #4a4a4a;">
95
  <li>Provide clear and concise messages for optimal responses.</li>
 
100
  """
101
  )
102
 
103
+ # Styling the background and adding animations
104
  demo.css = """
105
+ @keyframes fadeIn {
106
+ 0% { opacity: 0; }
107
+ 100% { opacity: 1; }
108
+ }
109
+
110
+ @keyframes slideIn {
111
+ 0% { transform: translateX(-50px); opacity: 0; }
112
+ 100% { transform: translateX(0); opacity: 1; }
113
+ }
114
+
115
  body {
116
+ background: linear-gradient(120deg, #f9fafb, #dfe8f0);
117
+ font-family: Arial, sans-serif;
118
  }
119
  .gr-textbox {
120
  border: 1px solid #e1e4e8;
121
  border-radius: 5px;
122
+ box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.1);
123
+ transition: all 0.3s ease;
124
+ }
125
+ .gr-textbox:hover {
126
+ transform: scale(1.02);
127
+ border-color: #6fc3df;
128
  }
129
  #system_message_box {
130
  border: 2px dashed #4a90e2;
131
  background-color: #f0f9ff;
132
+ transition: background-color 0.3s ease;
133
+ }
134
+ #system_message_box:hover {
135
+ background-color: #eaf6ff;
136
  }
137
  .gr-slider {
138
  background-color: #e9f7fc;
139
+ box-shadow: inset 0px 2px 4px rgba(0, 0, 0, 0.1);
140
  }
141
  """
142