PuristanLabs1 commited on
Commit
5acf1e7
Β·
verified Β·
1 Parent(s): 8c30d30

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -14
app.py CHANGED
@@ -65,15 +65,15 @@ def fetch_and_display_content(url):
65
  #return cleaned_text, metadata, detected_lang, gr.update(visible=True), gr.update(visible=True), gr.update(visible=True), gr.update(visible=True)
66
 
67
  return (
68
- cleaned_text, # βœ… Extracted text
69
- metadata, # βœ… Metadata (must be a valid JSON object)
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), # βœ… Show Extracted text box
74
- gr.update(visible=True), # βœ… Show Metadata box
75
- json.dumps([]), # βœ… Reset Entity output with an empty JSON array instead of ""
76
- "" # βœ… Reset Summary output
77
  )
78
 
79
  ### 2️⃣ Cleaning Function
@@ -289,11 +289,11 @@ with gr.Blocks() as demo:
289
  inputs=[url_input],
290
 
291
  outputs=[
292
- extracted_text, metadata_output, detected_lang,
293
- process_summary_button, process_audio_button,
294
- summary_output, ner_output, # βœ… Existing Outputs
295
- gr.update(visible=True), # βœ… Ensures Extracted Text Box is shown
296
- gr.update(visible=True) # βœ… Ensures Metadata Box is shown
297
  ]
298
  )
299
 
 
65
  #return cleaned_text, metadata, detected_lang, gr.update(visible=True), gr.update(visible=True), gr.update(visible=True), gr.update(visible=True)
66
 
67
  return (
68
+ cleaned_text,
69
+ gr.update(value=metadata, visible=True),
70
+ detected_lang,
71
+ gr.update(visible=True),
72
+ gr.update(visible=True),
73
+ gr.update(visible=True),
74
+ gr.update(visible=True),
75
+ json.dumps([]),
76
+ ""
77
  )
78
 
79
  ### 2️⃣ Cleaning Function
 
289
  inputs=[url_input],
290
 
291
  outputs=[
292
+ extracted_text, metadata_output, detected_lang,
293
+ process_summary_button, process_audio_button,
294
+ summary_output, ner_output, # βœ… Existing Outputs
295
+ gr.update(visible=True), # βœ… Ensures Extracted Text Box is shown
296
+ gr.update(visible=True) # βœ… Ensures Metadata Box is shown
297
  ]
298
  )
299