Dileep7729 commited on
Commit
492b8d1
·
verified ·
1 Parent(s): a2f92a8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -0
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")