Darshan-BugendaiTech commited on
Commit
4e10583
β€’
1 Parent(s): c83801c

Update app.py

Browse files

Trying to add CSS

Files changed (1) hide show
  1. app.py +83 -2
app.py CHANGED
@@ -3,7 +3,6 @@ import gradio as gr
3
  from llama_index import download_loader, ServiceContext, VectorStoreIndex
4
  from llama_index.embeddings import HuggingFaceEmbedding
5
  from llama_index import Prompt
6
- from gradio.utils.css import load_stylesheet
7
  import torch
8
  device = torch.device("cpu")
9
 
@@ -71,8 +70,90 @@ def clear_everything():
71
  """# Adding themes in UI Interface
72
  custom_theme = gr.themes.Monochrome()"""
73
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
74
  # UI Design and Logic
75
- with gr.Blocks(theme=load_stylesheet("my-monochrome-theme.css"),title="Marketing Email Generator") as demo:
76
  gr.HTML("<h1 style='text-align: center;'>Marketing Email Generator</h1>")
77
  gr.Markdown("Drop you Excel file here πŸ‘‡ and ask your query about it!")
78
  with gr.Row():
 
3
  from llama_index import download_loader, ServiceContext, VectorStoreIndex
4
  from llama_index.embeddings import HuggingFaceEmbedding
5
  from llama_index import Prompt
 
6
  import torch
7
  device = torch.device("cpu")
8
 
 
70
  """# Adding themes in UI Interface
71
  custom_theme = gr.themes.Monochrome()"""
72
 
73
+ # CSS
74
+ colors = ["#64A087", "green", "black"]
75
+
76
+ CSS = """
77
+ #question input {
78
+ font-size: 16px;
79
+ }
80
+ #app-title {
81
+ width: 100%;
82
+ margin: auto;
83
+ }
84
+ #url-textbox {
85
+ padding: 0 !important;
86
+ }
87
+ #short-upload-box .w-full {
88
+ min-height: 10rem !important;
89
+ }
90
+
91
+ #select-a-file {
92
+ display: block;
93
+ width: 100%;
94
+ }
95
+ #file-clear {
96
+ padding-top: 2px !important;
97
+ padding-bottom: 2px !important;
98
+ padding-left: 8px !important;
99
+ padding-right: 8px !important;
100
+ margin-top: 10px;
101
+ }
102
+ .gradio-container .gr-button-primary {
103
+ background: linear-gradient(180deg, #CDF9BE 0%, #AFF497 100%);
104
+ border: 1px solid #B0DCCC;
105
+ border-radius: 8px;
106
+ color: #1B8700;
107
+ }
108
+ .gradio-container.dark button#submit-button {
109
+ background: linear-gradient(180deg, #CDF9BE 0%, #AFF497 100%);
110
+ border: 1px solid #B0DCCC;
111
+ border-radius: 8px;
112
+ color: #1B8700
113
+ }
114
+ table.gr-samples-table tr td {
115
+ border: none;
116
+ outline: none;
117
+ }
118
+ table.gr-samples-table tr td:first-of-type {
119
+ width: 0%;
120
+ }
121
+ div#short-upload-box div.absolute {
122
+ display: none !important;
123
+ }
124
+ gradio-app > div > div > div > div.w-full > div, .gradio-app > div > div > div > div.w-full > div {
125
+ gap: 0px 2%;
126
+ }
127
+ gradio-app div div div div.w-full, .gradio-app div div div div.w-full {
128
+ gap: 0px;
129
+ }
130
+ gradio-app h2, .gradio-app h2 {
131
+ padding-top: 10px;
132
+ }
133
+ #answer {
134
+ overflow-y: scroll;
135
+ color: white;
136
+ background: #666;
137
+ border-color: #666;
138
+ font-size: 20px;
139
+ font-weight: bold;
140
+ }
141
+ #answer span {
142
+ color: white;
143
+ }
144
+ #answer textarea {
145
+ color:white;
146
+ background: #777;
147
+ border-color: #777;
148
+ font-size: 18px;
149
+ }
150
+ #url-error input {
151
+ color: red;
152
+ }
153
+ """
154
+
155
  # UI Design and Logic
156
+ with gr.Blocks(css=CSS),title="Marketing Email Generator") as demo:
157
  gr.HTML("<h1 style='text-align: center;'>Marketing Email Generator</h1>")
158
  gr.Markdown("Drop you Excel file here πŸ‘‡ and ask your query about it!")
159
  with gr.Row():