CLIPModel / app.py
ibrim's picture
Update app.py
3b6db54 verified
raw
history blame
1.02 kB
import gradio as gr
import gc
import cv2
import torch
import torch.nn.functional as F
from tqdm import tqdm
from transformers import DistilBertTokenizer
import matplotlib.pyplot as plt
from implement import *
# import config as CFG
# from main import build_loaders
# from CLIP import CLIPModel
import os
import zipfile
# Define the filename
zip_filename = 'Images.zip'
import os
import zipfile
with gr.Blocks(css="style.css") as demo:
# Define the filename
zip_filename = 'Images.zip'
# Check if the file exists
if os.path.isfile(zip_filename):
# Open the zip file
with zipfile.ZipFile(zip_filename, 'r') as zip_ref:
# Extract all contents of the zip file to the current directory
zip_ref.extractall()
print(f"'{zip_filename}' has been successfully unzipped.")
else:
print(f"'{zip_filename}' not found in the current directory.")
# Create Gradio interface
demo.launch(share=True)