Update app.py
Browse files
app.py
CHANGED
|
@@ -11,7 +11,22 @@ from implement import *
|
|
| 11 |
# from main import build_loaders
|
| 12 |
# from CLIP import CLIPModel
|
| 13 |
import os
|
|
|
|
| 14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
with gr.Blocks(css="style.css") as demo:
|
| 16 |
def get_image_embeddings(valid_df, model_path):
|
| 17 |
tokenizer = DistilBertTokenizer.from_pretrained(CFG.text_tokenizer)
|
|
|
|
| 11 |
# from main import build_loaders
|
| 12 |
# from CLIP import CLIPModel
|
| 13 |
import os
|
| 14 |
+
import zipfile
|
| 15 |
|
| 16 |
+
# Define the filename
|
| 17 |
+
zip_filename = 'Images.zip'
|
| 18 |
+
|
| 19 |
+
# Check if the zip file exists in the current directory
|
| 20 |
+
if os.path.isfile(zip_filename):
|
| 21 |
+
print(f"'{zip_filename}' found. Unzipping...")
|
| 22 |
+
|
| 23 |
+
# Unzip the file
|
| 24 |
+
with zipfile.ZipFile(zip_filename, 'r') as zip_ref:
|
| 25 |
+
zip_ref.extractall()
|
| 26 |
+
print(f"'{zip_filename}' has been successfully unzipped.")
|
| 27 |
+
else:
|
| 28 |
+
print(f"'{zip_filename}' not found in the current directory.")
|
| 29 |
+
|
| 30 |
with gr.Blocks(css="style.css") as demo:
|
| 31 |
def get_image_embeddings(valid_df, model_path):
|
| 32 |
tokenizer = DistilBertTokenizer.from_pretrained(CFG.text_tokenizer)
|