Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -8,6 +8,14 @@ from PIL import Image
|
|
8 |
from transformers import CLIPModel, CLIPProcessor
|
9 |
import gradio as gr
|
10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
# Step 1: Unzip the dataset
|
12 |
if not os.path.exists("data"):
|
13 |
os.makedirs("data")
|
|
|
8 |
from transformers import CLIPModel, CLIPProcessor
|
9 |
import gradio as gr
|
10 |
|
11 |
+
# Ensure PyTorch is installed
|
12 |
+
try:
|
13 |
+
import torch
|
14 |
+
except ModuleNotFoundError:
|
15 |
+
print("PyTorch is not installed. Installing now...")
|
16 |
+
os.system("pip install torch torchvision torchaudio")
|
17 |
+
import torch
|
18 |
+
|
19 |
# Step 1: Unzip the dataset
|
20 |
if not os.path.exists("data"):
|
21 |
os.makedirs("data")
|