wing-nus commited on
Commit
117cca8
1 Parent(s): 6a20cba

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -25,7 +25,7 @@ def download_pdf(url, dest_folder):
25
  for chunk in response.iter_content(chunk_size=1024):
26
  if chunk:
27
  file.write(chunk)
28
- #print(f"Downloaded {url} to {filename}")
29
  return filename
30
 
31
  # Example Usage
@@ -63,8 +63,8 @@ with gr.Blocks(css="#htext span {white-space: pre-line}") as demo:
63
  ctrlsum_file_examples = gr.Examples(examples=[["examples/H01-1042_body.txt", 50, "automatic evaluation technique"],["examples/H01-1042.pdf", 0, "automatic evaluation technique"]],
64
  inputs=[ctrlsum_file, ctrlsum_file_length, ctrlsum_file_keywords])
65
 
66
- if ctrlsum_url is not None and len(ctrlsum_url) > 4:
67
- ctrlsum_file = download_pdf(ctrlsum_url, './examples/')
68
 
69
  ctrlsum_file_btn.click(
70
  fn=ctrlsum_for_file,
 
25
  for chunk in response.iter_content(chunk_size=1024):
26
  if chunk:
27
  file.write(chunk)
28
+ print(f"Downloaded {url} to {filename}")
29
  return filename
30
 
31
  # Example Usage
 
63
  ctrlsum_file_examples = gr.Examples(examples=[["examples/H01-1042_body.txt", 50, "automatic evaluation technique"],["examples/H01-1042.pdf", 0, "automatic evaluation technique"]],
64
  inputs=[ctrlsum_file, ctrlsum_file_length, ctrlsum_file_keywords])
65
 
66
+ if len(ctrlsum_url.value) > 4:
67
+ ctrlsum_file = download_pdf(ctrlsum_url.value, './cache/')
68
 
69
  ctrlsum_file_btn.click(
70
  fn=ctrlsum_for_file,