pszemraj commited on
Commit
925dd67
1 Parent(s): 3ea8fe3

load PDF example alt

Browse files

Signed-off-by: peter szemraj <peterszemraj@gmail.com>

Files changed (1) hide show
  1. utils.py +4 -1
utils.py CHANGED
@@ -6,7 +6,7 @@ import re
6
  from pathlib import Path
7
 
8
  from natsort import natsorted
9
-
10
 
11
  def truncate_word_count(text, max_words=512):
12
  """
@@ -39,6 +39,9 @@ def load_examples(src, filetypes=[".txt", ".pdf"]):
39
  """
40
  src = Path(src)
41
  src.mkdir(exist_ok=True)
 
 
 
42
  examples = [f for f in src.iterdir() if f.suffix in filetypes]
43
  examples = natsorted(examples)
44
  # load the examples into a list
 
6
  from pathlib import Path
7
 
8
  from natsort import natsorted
9
+ import subprocess
10
 
11
  def truncate_word_count(text, max_words=512):
12
  """
 
39
  """
40
  src = Path(src)
41
  src.mkdir(exist_ok=True)
42
+
43
+ pdf_url = "https://www.dropbox.com/s/y92xy7o5qb88yij/all_you_need_is_attention.pdf?dl=1"
44
+ subprocess.run(["wget", pdf_url, "-O", src / "all_you_need_is_attention.pdf"])
45
  examples = [f for f in src.iterdir() if f.suffix in filetypes]
46
  examples = natsorted(examples)
47
  # load the examples into a list