taesiri commited on
Commit
60c53f1
1 Parent(s): ab5f5bd

remove cuda

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -70,7 +70,7 @@ class GamePhysicsSearcher:
70
  self.simsearcher.fit(X_train, y_train)
71
 
72
  def text_to_vector(self, query):
73
- text_tokens = clip.tokenize(query).cuda()
74
  with torch.no_grad():
75
  text_features = self.CLIP_MODEL.encode_text(text_tokens).float()
76
  text_features /= text_features.norm(dim=-1, keepdim=True)
@@ -100,7 +100,7 @@ class GamePhysicsSearcher:
100
  ################ SEARCH CORE ################
101
  # CRAETE CLIP MODEL
102
  vit_model, vit_preprocess = clip.load("ViT-B/32")
103
- vit_model.cuda().eval()
104
 
105
  saved_searchers = {}
106
  def gradio_search(query, game_name, selected_model, aggregator, pool_size, k=6):
70
  self.simsearcher.fit(X_train, y_train)
71
 
72
  def text_to_vector(self, query):
73
+ text_tokens = clip.tokenize(query)
74
  with torch.no_grad():
75
  text_features = self.CLIP_MODEL.encode_text(text_tokens).float()
76
  text_features /= text_features.norm(dim=-1, keepdim=True)
100
  ################ SEARCH CORE ################
101
  # CRAETE CLIP MODEL
102
  vit_model, vit_preprocess = clip.load("ViT-B/32")
103
+ vit_model.eval()
104
 
105
  saved_searchers = {}
106
  def gradio_search(query, game_name, selected_model, aggregator, pool_size, k=6):