manabb commited on
Commit
528dcf6
·
verified ·
1 Parent(s): b2d81f5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +25 -5
app.py CHANGED
@@ -158,16 +158,36 @@ def check_compliance(file): # FIXED: now streams
158
  yield from loop_function(df1) # FIXED: delegate yields
159
  else:
160
  yield "Unsupported file format"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
161
 
162
- # Gradio (FIXED input name)
163
- with gr.Blocks() as demo:
164
  with gr.Row():
165
  inp = gr.File( # consistent name
166
  label="Upload Admin File in word i.e. docx format",
167
- file_types=[".docx"]
 
168
  )
169
- run_btn = gr.Button("Check compliance")
170
- out = gr.Textbox(lines=15, label="Compliance Result")
171
 
172
  run_btn.click(check_compliance, inputs=inp, outputs=out) # FIXED: inputs=inp
173
 
 
158
  yield from loop_function(df1) # FIXED: delegate yields
159
  else:
160
  yield "Unsupported file format"
161
+ #================================================Gradio==================
162
+
163
+ css = """
164
+ #admin-file .label, #admin-file label { color: #FFFFFF !important; font-size: 12px !important; }
165
+ #admin-file { background-color: #000000 !important; }
166
+ #compliance-btn {
167
+ color: #FFFFFF !important;
168
+ background-color: red !important; /* Red background */
169
+ font-size: 12px !important;
170
+ }
171
+ #compliance-btn:hover {
172
+ background-color: #CC0000 !important; /* Darker red on hover */
173
+ color: #FFFFFF !important;
174
+ }
175
+ #compliance-out textarea, #compliance-out .label, #compliance-out label {
176
+ color: #FFFFFF !important;
177
+ background-color: #000000 !important;
178
+ font-size: 12px !important;
179
+ }
180
+ """
181
 
182
+ with gr.Blocks(css=css) as demo:
 
183
  with gr.Row():
184
  inp = gr.File( # consistent name
185
  label="Upload Admin File in word i.e. docx format",
186
+ file_types=[".docx"],
187
+ elem_id="admin-file"
188
  )
189
+ run_btn = gr.Button("Check compliance", elem_id="compliance-btn")
190
+ out = gr.Textbox(lines=15, label="Compliance Result",elem_id="compliance-out")
191
 
192
  run_btn.click(check_compliance, inputs=inp, outputs=out) # FIXED: inputs=inp
193