Spaces:
Sleeping
Sleeping
MohammedNasser
commited on
Commit
•
0756995
1
Parent(s):
b958c67
Update app.py
Browse files
app.py
CHANGED
@@ -254,17 +254,17 @@ with gr.Blocks(css=custom_css) as demo:
|
|
254 |
if is_valid:
|
255 |
# Enable the upload button if the file is valid
|
256 |
value=''
|
257 |
-
return gr.
|
258 |
else:
|
259 |
value=f'<span style="color:{color}">{message}</span>'
|
260 |
-
return gr.
|
261 |
|
262 |
def process_pdf_and_enable_components(pdf):
|
263 |
# Process PDF and activate the other components
|
264 |
output_label.value='<span style="color:blue">جاري معالجة الملف...</span>'
|
265 |
message, is_valid = upload_pdf(pdf)
|
266 |
value=f'<span style="color:green">{message}</span>'
|
267 |
-
return gr.
|
268 |
|
269 |
|
270 |
# When the user uploads a file, validate it and then allow PDF upload
|
|
|
254 |
if is_valid:
|
255 |
# Enable the upload button if the file is valid
|
256 |
value=''
|
257 |
+
return gr.update(value=value), gr.update(interactive=True), gr.update(interactive=False), gr.update(label=""), gr.update(label="")
|
258 |
else:
|
259 |
value=f'<span style="color:{color}">{message}</span>'
|
260 |
+
return gr.update(value=value), gr.update(interactive=False), gr.update(interactive=False), gr.update(label=""), gr.update(label="")
|
261 |
|
262 |
def process_pdf_and_enable_components(pdf):
|
263 |
# Process PDF and activate the other components
|
264 |
output_label.value='<span style="color:blue">جاري معالجة الملف...</span>'
|
265 |
message, is_valid = upload_pdf(pdf)
|
266 |
value=f'<span style="color:green">{message}</span>'
|
267 |
+
return gr.update(value=value), gr.update(interactive=True), gr.update(interactive=False)
|
268 |
|
269 |
|
270 |
# When the user uploads a file, validate it and then allow PDF upload
|