File size: 969 Bytes
de9ccd0
5ae462e
45a7ed7
2073fd8
5ae462e
 
2073fd8
5ae462e
2073fd8
 
45a7ed7
 
2073fd8
45a7ed7
ef6c8f5
fcb86fe
45a7ed7
fcb86fe
2c03082
2073fd8
 
45a7ed7
b4c5a11
2073fd8
45a7ed7
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import os
import zipfile
from huggingface_hub import cached_download

# Specify the Google Drive link to the archive file
archive_url = 'https://drive.google.com/uc?id=14QhofCbby053kWbVeWEBHCxOROQS-bjN'

# Specify the destination directory within the Hugging Face space
destination_dir = 'SaviAnna/PicturesText'  # Replace with your desired destination directory

# Create the destination directory if it doesn't exist
os.makedirs(destination_dir, exist_ok=True)

# Download the archive to the destination directory
#cached_download(archive_url, destination_dir)
#archive_file = hf_hub_download(url=archive_url, destination=destination_dir)
# Extract the archive
archive_file = os.path.join(destination_dir, 'archive.zip')
cached_download(archive_url)
extracted_directory = os.path.join(destination_dir, 'find_pic')

with zipfile.ZipFile(archive_file, 'r') as zip_ref:
    zip_ref.extractall(extracted_directory)

print(f"Archive extracted to: {extracted_directory}")