PuristanLabs1 commited on
Commit
ef3fda9
Β·
verified Β·
1 Parent(s): 9e330f6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -6
app.py CHANGED
@@ -68,12 +68,14 @@ def fetch_and_display_content(url):
68
  cleaned_text, # βœ… Extracted content
69
  metadata, # βœ… Article metadata
70
  detected_lang, # βœ… Detected language
71
- gr.update(visible=True), # βœ… Make Summary button visible
72
- gr.update(visible=True), # βœ… Make Audio button visible
73
- gr.update(visible=True), # βœ… Make Extracted text box visible
74
- gr.update(visible=True), # βœ… Make Metadata output visible
75
  "", # βœ… Reset Summary output when a new URL is fetched
76
- "" # βœ… Reset Entity output when a new URL is fetched
 
 
77
  )
78
 
79
  ### 2️⃣ Cleaning Function
@@ -292,7 +294,12 @@ with gr.Blocks() as demo:
292
  fetch_and_display_content,
293
  inputs=[url_input],
294
 
295
- outputs=[extracted_text, metadata_output, detected_lang, process_summary_button, process_audio_button, summary_output, ner_output]
 
 
 
 
 
296
  )
297
 
298
  process_summary_button.click(hierarchical_summarization, inputs=[extracted_text], outputs=[summary_output])
 
68
  cleaned_text, # βœ… Extracted content
69
  metadata, # βœ… Article metadata
70
  detected_lang, # βœ… Detected language
71
+ gr.update(visible=True), # βœ… Show Summary button
72
+ gr.update(visible=True), # βœ… Show Audio button
73
+ gr.update(visible=True), # βœ… Show Extracted text box
74
+ gr.update(visible=True), # βœ… Show Metadata box
75
  "", # βœ… Reset Summary output when a new URL is fetched
76
+ "", # βœ… Reset Entity output when a new URL is fetched
77
+ gr.update(value=cleaned_text, visible=True), # βœ… Ensure Extracted Text is shown
78
+ gr.update(value=metadata, visible=True) # βœ… Ensure Metadata is shown
79
  )
80
 
81
  ### 2️⃣ Cleaning Function
 
294
  fetch_and_display_content,
295
  inputs=[url_input],
296
 
297
+ outputs=[
298
+ extracted_text, metadata_output, detected_lang,
299
+ process_summary_button, process_audio_button,
300
+ summary_output, ner_output,
301
+ extracted_text, metadata_output # βœ… Ensures visibility update
302
+ ]
303
  )
304
 
305
  process_summary_button.click(hierarchical_summarization, inputs=[extracted_text], outputs=[summary_output])