saherPervaiz commited on
Commit
259faf6
·
verified ·
1 Parent(s): e4f79b8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -7
app.py CHANGED
@@ -17,12 +17,12 @@ def chat(user_input, chat_history):
17
  except Exception as e:
18
  return f"Error: {e}", chat_history
19
 
20
- # Create Gradio interface with vertical alignment and background color
21
  with gr.Blocks(css="""
22
  body {
23
  background-color: #121212;
24
  color: #f1f1f1;
25
- font-family: Arial, sans-serif;
26
  display: flex;
27
  justify-content: center;
28
  align-items: center;
@@ -31,16 +31,18 @@ with gr.Blocks(css="""
31
  }
32
  .gradio-container {
33
  width: 100%;
34
- max-width: 600px;
35
  background-color: #1e1e1e;
36
- padding: 20px;
37
- border-radius: 10px;
 
38
  }
39
  .gradio-container .textbox, .gradio-container .button {
40
  background-color: #333;
41
  color: #f1f1f1;
42
  border: 1px solid #444;
43
  border-radius: 8px;
 
44
  }
45
  .gradio-container .textbox:focus, .gradio-container .button:focus {
46
  border-color: #007bff;
@@ -61,9 +63,22 @@ with gr.Blocks(css="""
61
  background-color: #2a2a2a;
62
  color: #f1f1f1;
63
  margin-bottom: 20px;
 
 
 
 
 
 
 
 
 
 
 
 
 
64
  }
65
  """) as demo:
66
- gr.Markdown("## 🤖 Professional Groq Chatbot")
67
  gr.Markdown("Type your message below to chat with the AI!")
68
 
69
  # Define layout with vertical alignment
@@ -75,7 +90,7 @@ with gr.Blocks(css="""
75
  interactive=True,
76
  )
77
  submit_button = gr.Button("Send")
78
- clear_button = gr.Button("Clear Chat")
79
 
80
  chatbot_output = gr.Textbox(
81
  label="Chat History",
 
17
  except Exception as e:
18
  return f"Error: {e}", chat_history
19
 
20
+ # Create Gradio interface with professional design
21
  with gr.Blocks(css="""
22
  body {
23
  background-color: #121212;
24
  color: #f1f1f1;
25
+ font-family: 'Roboto', sans-serif;
26
  display: flex;
27
  justify-content: center;
28
  align-items: center;
 
31
  }
32
  .gradio-container {
33
  width: 100%;
34
+ max-width: 700px;
35
  background-color: #1e1e1e;
36
+ padding: 25px;
37
+ border-radius: 12px;
38
+ box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.5);
39
  }
40
  .gradio-container .textbox, .gradio-container .button {
41
  background-color: #333;
42
  color: #f1f1f1;
43
  border: 1px solid #444;
44
  border-radius: 8px;
45
+ font-size: 16px;
46
  }
47
  .gradio-container .textbox:focus, .gradio-container .button:focus {
48
  border-color: #007bff;
 
63
  background-color: #2a2a2a;
64
  color: #f1f1f1;
65
  margin-bottom: 20px;
66
+ font-size: 14px;
67
+ line-height: 1.5;
68
+ }
69
+ .button-container {
70
+ display: flex;
71
+ justify-content: space-between;
72
+ align-items: center;
73
+ }
74
+ .clear-button {
75
+ background-color: #ff5c5c;
76
+ }
77
+ .clear-button:hover {
78
+ background-color: #e60000;
79
  }
80
  """) as demo:
81
+ gr.Markdown("## 🤖 **Professional Groq Chatbot**")
82
  gr.Markdown("Type your message below to chat with the AI!")
83
 
84
  # Define layout with vertical alignment
 
90
  interactive=True,
91
  )
92
  submit_button = gr.Button("Send")
93
+ clear_button = gr.Button("Clear Chat", elem_classes=["clear-button"])
94
 
95
  chatbot_output = gr.Textbox(
96
  label="Chat History",