Shriharsh commited on
Commit
d53a91d
·
verified ·
1 Parent(s): 1e2442d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +51 -36
app.py CHANGED
@@ -6,71 +6,90 @@ client = InferenceClient(
6
  )
7
 
8
  CSS = """
9
- body {
10
- background-color: black;
11
- color: #FFFFFF; /* Default text color for the entire app */
12
  }
13
 
14
  .gradio-container {
15
- background-color: black;
16
- color: #FFFFFF; /* Ensure the entire container is black with white text */
17
  }
18
 
19
  h1 {
20
- color: #00FF00; /* Green header text */
21
  text-align: center;
 
 
22
  }
23
 
24
- .gr-block, .gr-block > div, .gr-chatbox, .gr-box {
25
- background-color: black !important; /* Ensure the background of all block elements is black */
26
- color: #FFFFFF !important; /* White text for block elements */
 
 
 
 
 
 
 
27
  }
28
 
29
  .gr-chat-message {
30
- background-color: #1A1A1A; /* Dark background for chat messages */
31
- color: #00FFFF !important; /* Cyan text for bot responses */
32
- border-radius: 10px;
33
  padding: 10px;
 
34
  }
35
 
36
  .gr-chat-message.user {
37
- color: #00FF00 !important; /* Green text for user messages */
38
  }
39
 
40
  .gr-button {
41
- background-color: #333333; /* Dark button background */
42
- color: #FFFFFF; /* White button text */
43
- border: 1px solid #FFFFFF; /* Button border */
44
  }
45
 
46
  .gr-button:hover {
47
- background-color: #555555; /* Darker button on hover */
48
  }
49
 
50
- input[type="text"], textarea, .gr-input, .gr-textbox {
51
- background-color: #111111 !important; /* Ensure input fields are dark */
52
- color: #00FF00 !important; /* Green input text */
53
- border: 1px solid #FFFFFF;
54
  }
55
 
56
- .gr-slider {
57
- background-color: #222222; /* Dark slider background */
 
 
58
  }
59
 
60
- .gr-slider .range-slider {
61
- background-color: #00FF00 !important; /* Green slider track */
62
  }
63
 
64
- .gr-slider .range-slider__thumb {
65
- background-color: #00FFFF !important; /* Cyan slider thumb */
66
  }
67
 
68
- .gr-examples {
69
- color: #00FF00; /* Green text for examples */
70
  }
71
- """
72
 
 
 
 
 
73
 
 
 
 
 
74
 
75
  def format_prompt(message, history):
76
  prompt = "<s>"
@@ -107,7 +126,6 @@ def generate(
107
  yield output
108
  return output
109
 
110
-
111
  additional_inputs=[
112
  gr.Slider(
113
  label="Temperature",
@@ -147,8 +165,6 @@ additional_inputs=[
147
  )
148
  ]
149
 
150
- # Create a Chatbot object with the desired height
151
-
152
  chatbot = gr.Chatbot(height=450, label="Chatbot", container=True)
153
 
154
  with gr.Blocks(css=CSS) as demo:
@@ -159,7 +175,6 @@ with gr.Blocks(css=CSS) as demo:
159
  additional_inputs=additional_inputs,
160
  examples=[["Give me the code for Binary Search in C++"],
161
  ["Explain the chapter of The Grand Inquistor from The Brothers Karamazov."],
162
- ["Explain Newton's second law."]],
163
  )
164
- demo.queue().launch(debug=True)
165
-
 
6
  )
7
 
8
  CSS = """
9
+ body, .gradio-container {
10
+ background-color: #0F1117;
11
+ color: #FFFFFF;
12
  }
13
 
14
  .gradio-container {
15
+ max-width: 100% !important;
16
+ padding: 0 !important;
17
  }
18
 
19
  h1 {
20
+ color: #00FF00;
21
  text-align: center;
22
+ font-size: 2.5em;
23
+ margin-bottom: 20px;
24
  }
25
 
26
+ .gr-block, .gr-box {
27
+ border-color: #2F3336 !important;
28
+ }
29
+
30
+ .gr-chatbot {
31
+ height: 450px;
32
+ overflow-y: auto;
33
+ border: 1px solid #2F3336;
34
+ border-radius: 8px;
35
+ background-color: #0F1117;
36
  }
37
 
38
  .gr-chat-message {
39
+ background-color: #1A1B26;
40
+ border: 1px solid #2F3336;
41
+ border-radius: 8px;
42
  padding: 10px;
43
+ margin-bottom: 10px;
44
  }
45
 
46
  .gr-chat-message.user {
47
+ background-color: #2F3336;
48
  }
49
 
50
  .gr-button {
51
+ background-color: #2F3336 !important;
52
+ color: #FFFFFF !important;
53
+ border: 1px solid #4F5356 !important;
54
  }
55
 
56
  .gr-button:hover {
57
+ background-color: #3F4346 !important;
58
  }
59
 
60
+ input[type="text"], textarea {
61
+ background-color: #1A1B26 !important;
62
+ color: #FFFFFF !important;
63
+ border: 1px solid #2F3336 !important;
64
  }
65
 
66
+ .gr-form {
67
+ background-color: #0F1117 !important;
68
+ border: 1px solid #2F3336;
69
+ border-radius: 8px;
70
  }
71
 
72
+ .gr-accordion {
73
+ border: 1px solid #2F3336 !important;
74
  }
75
 
76
+ .gr-accordion-header {
77
+ background-color: #1A1B26 !important;
78
  }
79
 
80
+ .gr-accordion-body {
81
+ background-color: #0F1117 !important;
82
  }
 
83
 
84
+ .gr-examples {
85
+ border-top: 1px solid #2F3336 !important;
86
+ padding-top: 10px !important;
87
+ }
88
 
89
+ .gr-examples-text {
90
+ color: #AAAAAA !important;
91
+ }
92
+ """
93
 
94
  def format_prompt(message, history):
95
  prompt = "<s>"
 
126
  yield output
127
  return output
128
 
 
129
  additional_inputs=[
130
  gr.Slider(
131
  label="Temperature",
 
165
  )
166
  ]
167
 
 
 
168
  chatbot = gr.Chatbot(height=450, label="Chatbot", container=True)
169
 
170
  with gr.Blocks(css=CSS) as demo:
 
175
  additional_inputs=additional_inputs,
176
  examples=[["Give me the code for Binary Search in C++"],
177
  ["Explain the chapter of The Grand Inquistor from The Brothers Karamazov."],
178
+ ["Explain Newton's second law of motion."]],
179
  )
180
+ demo.queue().launch(debug=True)