faizah2512 commited on
Commit
b44b4c0
·
verified ·
1 Parent(s): 92a2ce4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +34 -56
app.py CHANGED
@@ -35,62 +35,40 @@ def respond(
35
  response += token
36
  yield response
37
 
38
- css = """
39
- /* Customize the background color and text color */
40
- body {
41
- background-color: #f0f0f0;
42
- color: #333333;
43
- }
44
-
45
- /* Customize the chat window */
46
- .gradio-chatbox {
47
- border: 1px solid #dddddd;
48
- background-color: #ffffff;
49
- border-radius: 10px;
50
- }
51
-
52
- /* Customize the user input and response */
53
- .gradio-chat-message-user {
54
- background-color: #e1f5fe;
55
- color: #01579b;
56
- }
57
-
58
- .gradio-chat-message-assistant {
59
- background-color: #fff3e0;
60
- color: #ef6c00;
61
- }
62
-
63
- /* Customize the sliders and text boxes */
64
- .gradio-input {
65
- background-color: #ffffff;
66
- border: 1px solid #dddddd;
67
- border-radius: 5px;
68
- padding: 5px;
69
- color: #333333;
70
- }
71
-
72
- .gradio-slider {
73
- color: #01579b;
74
- }
75
- """
76
-
77
- with gr.Blocks(css=css) as demo:
78
- chat_interface = gr.ChatInterface(
79
- respond,
80
- additional_inputs=[
81
- gr.Textbox(value="You are a friendly Chatbot.", label="System message"),
82
- gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
83
- gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
84
- gr.Slider(
85
- minimum=0.1,
86
- maximum=1.0,
87
- value=0.95,
88
- step=0.05,
89
- label="Top-p (nucleus sampling)",
90
- ),
91
- ],
92
- theme="default",
93
- )
94
 
95
  if __name__ == "__main__":
96
  demo.launch()
 
 
35
  response += token
36
  yield response
37
 
38
+ demo = gr.ChatInterface(
39
+ respond,
40
+ additional_inputs=[
41
+ gr.Textbox(value="You are a friendly Chatbot.", label="System message"),
42
+ gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
43
+ gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
44
+ gr.Slider(
45
+ minimum=0.1,
46
+ maximum=1.0,
47
+ value=0.95,
48
+ step=0.05,
49
+ label="Top-p (nucleus sampling)",
50
+ ),
51
+ ],
52
+ theme="default", # Applying the default theme
53
+ css="""
54
+ .container {
55
+ background-color: black !important;
56
+ color: white !important;
57
+ }
58
+ .message {
59
+ color: white !important;
60
+ }
61
+ .input-box {
62
+ background-color: #333 !important;
63
+ color: white !important;
64
+ }
65
+ .btn {
66
+ background-color: #555 !important;
67
+ color: white !important;
68
+ }
69
+ """
70
+ )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
 
72
  if __name__ == "__main__":
73
  demo.launch()
74
+