faizah2512 commited on
Commit
2c2c893
·
verified ·
1 Parent(s): 78e9541

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +38 -3
app.py CHANGED
@@ -3,7 +3,6 @@ from huggingface_hub import InferenceClient
3
 
4
  client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
5
 
6
-
7
  def respond(
8
  message,
9
  history: list[tuple[str, str]],
@@ -32,10 +31,46 @@ def respond(
32
  top_p=top_p,
33
  ):
34
  token = message.choices[0].delta.content
35
-
36
  response += token
37
  yield response
38
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
 
40
  demo = gr.ChatInterface(
41
  respond,
@@ -51,8 +86,8 @@ demo = gr.ChatInterface(
51
  label="Top-p (nucleus sampling)",
52
  ),
53
  ],
 
54
  )
55
 
56
-
57
  if __name__ == "__main__":
58
  demo.launch()
 
3
 
4
  client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
5
 
 
6
  def respond(
7
  message,
8
  history: list[tuple[str, str]],
 
31
  top_p=top_p,
32
  ):
33
  token = message.choices[0].delta.content
 
34
  response += token
35
  yield response
36
 
37
+ custom_css = """
38
+ body {
39
+ background-color: #121212;
40
+ color: #ffffff;
41
+ }
42
+
43
+ .gradio-container {
44
+ background-color: #121212 !important;
45
+ }
46
+
47
+ .gradio-textbox, .gradio-slider {
48
+ border: 1px solid #ffffff !important;
49
+ background-color: #1e1e1e !important;
50
+ color: #ffffff !important;
51
+ box-shadow: 0 0 10px #00ff00 !important; /* Glowing effect */
52
+ }
53
+
54
+ .gradio-slider input[type=range] {
55
+ background-color: #00ff00 !important; /* Change slider color */
56
+ }
57
+
58
+ .gradio-button {
59
+ background-color: #00ff00 !important;
60
+ color: #121212 !important;
61
+ border: none !important;
62
+ box-shadow: 0 0 10px #00ff00 !important; /* Glowing effect */
63
+ }
64
+
65
+ .gradio-chat {
66
+ background-color: #1e1e1e !important;
67
+ color: #ffffff !important;
68
+ }
69
+
70
+ .gradio-label {
71
+ color: #ffffff !important;
72
+ }
73
+ """
74
 
75
  demo = gr.ChatInterface(
76
  respond,
 
86
  label="Top-p (nucleus sampling)",
87
  ),
88
  ],
89
+ css=custom_css
90
  )
91
 
 
92
  if __name__ == "__main__":
93
  demo.launch()