4rtemi5 commited on
Commit
7b79fbf
1 Parent(s): e625a8b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -40,7 +40,7 @@ def download_images():
40
  response = requests.get(f"http://sbert.net/datasets/{photo_filename}", stream=True)
41
  total_size_in_bytes= int(response.headers.get('content-length', 0))
42
  block_size = 1024 #1 Kb
43
- progress_bar = tqdm(total=total_size_in_bytes, unit='iB', unit_scale=True)
44
  content = io.BytesIO()
45
  for data in response.iter_content(block_size):
46
  progress_bar.update(len(data))
@@ -48,6 +48,7 @@ def download_images():
48
  progress_bar.close()
49
  content.seek()
50
  z = zipfile.ZipFile(content)
 
51
  print("Extracting the dataset...")
52
  z.extractall(path=img_folder)
53
  print("Done.")
 
40
  response = requests.get(f"http://sbert.net/datasets/{photo_filename}", stream=True)
41
  total_size_in_bytes= int(response.headers.get('content-length', 0))
42
  block_size = 1024 #1 Kb
43
+ progress_bar = stqdm(total=total_size_in_bytes) # , unit='iB', unit_scale=True
44
  content = io.BytesIO()
45
  for data in response.iter_content(block_size):
46
  progress_bar.update(len(data))
 
48
  progress_bar.close()
49
  content.seek()
50
  z = zipfile.ZipFile(content)
51
+ content.close()
52
  print("Extracting the dataset...")
53
  z.extractall(path=img_folder)
54
  print("Done.")