C2MV commited on
Commit
62e450c
1 Parent(s): 13175db

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -16
app.py CHANGED
@@ -366,24 +366,21 @@ def create_gradio_interface():
366
  ],
367
  outputs=[
368
  gr.File(label="Download Papers (ZIP) or Single PDF"),
369
- gr.HTML(label="""
370
- <div style='padding-bottom: 5px; font-weight: bold;'>
371
- Enter Single DOI
372
- </div>
373
- <div style='border: 1px solid #ddd; padding: 5px; border-radius: 5px;'>
374
- <div style='padding-bottom: 5px; font-weight: bold;'>
375
- Downloaded DOIs
376
- </div>
377
  <div id="downloaded-dois"></div>
378
- </div>
379
  """),
380
- gr.HTML(label="""
 
 
 
381
  <div style='border: 1px solid #ddd; padding: 5px; border-radius: 5px;'>
382
- <div style='padding-bottom: 5px; font-weight: bold;'>
383
- Failed DOIs
384
- </div>
385
  <div id="failed-dois"></div>
386
- </div>
387
  """),
388
  gr.File(label="Downloaded Single PDF")
389
  ],
@@ -418,13 +415,13 @@ def create_gradio_interface():
418
  # Add Javascript to update HTML
419
  interface.load = """
420
  function(downloaded_dois, failed_dois){
421
- let downloaded_html = '<h3>Found DOIs</h3>';
422
  downloaded_dois.split('\\n').filter(Boolean).forEach(doi => {
423
  downloaded_html += '[' + doi + ']<br>';
424
  });
425
  document.querySelector("#downloaded-dois").innerHTML = downloaded_html;
426
 
427
- let failed_html = '<h3>Missed DOIs</h3>';
428
  failed_dois.split('\\n').filter(Boolean).forEach(doi => {
429
  failed_html += '[' + doi + ']<br>';
430
  });
 
366
  ],
367
  outputs=[
368
  gr.File(label="Download Papers (ZIP) or Single PDF"),
369
+ gr.HTML(label="""
370
+ <div style='padding-bottom: 5px; font-weight: bold;'>
371
+ Found DOIs
372
+ </div>
373
+ <div style='border: 1px solid #ddd; padding: 5px; border-radius: 5px;'>
 
 
 
374
  <div id="downloaded-dois"></div>
375
+ </div>
376
  """),
377
+ gr.HTML(label="""
378
+ <div style='padding-bottom: 5px; font-weight: bold;'>
379
+ Missed DOIs
380
+ </div>
381
  <div style='border: 1px solid #ddd; padding: 5px; border-radius: 5px;'>
 
 
 
382
  <div id="failed-dois"></div>
383
+ </div>
384
  """),
385
  gr.File(label="Downloaded Single PDF")
386
  ],
 
415
  # Add Javascript to update HTML
416
  interface.load = """
417
  function(downloaded_dois, failed_dois){
418
+ let downloaded_html = '';
419
  downloaded_dois.split('\\n').filter(Boolean).forEach(doi => {
420
  downloaded_html += '[' + doi + ']<br>';
421
  });
422
  document.querySelector("#downloaded-dois").innerHTML = downloaded_html;
423
 
424
+ let failed_html = '';
425
  failed_dois.split('\\n').filter(Boolean).forEach(doi => {
426
  failed_html += '[' + doi + ']<br>';
427
  });