RobotJelly commited on
Commit
90348c5
1 Parent(s): b564a70
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -12,6 +12,12 @@ import gradio as gr
12
  #model, preprocess = clip.load("ViT-B/32", jit=False)
13
  #display output photo
14
 
 
 
 
 
 
 
15
  # taking photo IDs
16
  photo_ids = pd.read_csv("./photo_ids.csv")
17
  photo_ids = list(photo_ids['photo_id'])
@@ -56,11 +62,6 @@ def find_matches(text_features, photo_features, photo_ids, results_count=4):
56
 
57
  def image_search(search_text, search_image, option):
58
 
59
- # check if CUDA available
60
- device = "cuda" if torch.cuda.is_available() else "cpu"
61
-
62
- # Load the openAI's CLIP model
63
- model, preprocess = clip.load("ViT-B/32", device=device, jit=False)
64
  #model = model.to(device)
65
 
66
  # Input Text Query
12
  #model, preprocess = clip.load("ViT-B/32", jit=False)
13
  #display output photo
14
 
15
+ # check if CUDA available
16
+ device = "cuda" if torch.cuda.is_available() else "cpu"
17
+
18
+ # Load the openAI's CLIP model
19
+ model, preprocess = clip.load("ViT-B/32", device=device, jit=False)
20
+
21
  # taking photo IDs
22
  photo_ids = pd.read_csv("./photo_ids.csv")
23
  photo_ids = list(photo_ids['photo_id'])
62
 
63
  def image_search(search_text, search_image, option):
64
 
 
 
 
 
 
65
  #model = model.to(device)
66
 
67
  # Input Text Query