SaviAnna commited on
Commit
b4c5a11
·
1 Parent(s): 48b182c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -6
app.py CHANGED
@@ -1,5 +1,5 @@
1
- from PIL import Image
2
- import requests
3
 
4
  # from transformers import CLIPProcessor, CLIPModel
5
 
@@ -20,12 +20,15 @@ from huggingface_hub import hf_hub_url, cached_download
20
  # Specify the Google Drive link to the archive file
21
  archive_url = 'https://drive.google.com/uc?id=14QhofCbby053kWbVeWEBHCxOROQS-bjN'
22
  # Specify the destination directory within the Hugging Face space
 
 
23
  destination_dir = 'SaviAnna/PicturesText' # Replace with your desired destination directory
24
- os.makedirs(destination_dir,exist_ok=True)
25
  # Construct the destination path
26
  #destination_path = hf_hub_url(destination_dir)
27
  # Download the archive to the destination path
28
- cached_download(archive_url)
 
29
  # Extract the archive
30
- with zipfile.ZipFile(destination_path, 'r') as zip_ref:
31
- zip_ref.extractall(destination_dir)
 
1
+ # from PIL import Image
2
+ # import requests
3
 
4
  # from transformers import CLIPProcessor, CLIPModel
5
 
 
20
  # Specify the Google Drive link to the archive file
21
  archive_url = 'https://drive.google.com/uc?id=14QhofCbby053kWbVeWEBHCxOROQS-bjN'
22
  # Specify the destination directory within the Hugging Face space
23
+ # Download the archive
24
+ output_path = 'SaviAnna/PicturesText/archive.zip'
25
  destination_dir = 'SaviAnna/PicturesText' # Replace with your desired destination directory
26
+ #os.makedirs(destination_dir,exist_ok=True)
27
  # Construct the destination path
28
  #destination_path = hf_hub_url(destination_dir)
29
  # Download the archive to the destination path
30
+ cached_download(archive_url, output_path, quiet=False)
31
+ extracted_directory = 'SaviAnna/PicturesText/find_pic'
32
  # Extract the archive
33
+ with zipfile.ZipFile(output_path, 'r') as zip_ref:
34
+ zip_ref.extractall(extracted_directory)