roshanVarghese commited on
Commit
33799cd
·
verified ·
1 Parent(s): 3252f05

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -23,7 +23,7 @@ def generate_image(story):
23
 
24
  def evaluate_similarity(story, img_path="generated_image.png"):
25
  image = clip_preprocess(Image.open(img_path)).unsqueeze(0).to(device)
26
- text = clip.tokenize([story], truncate).to(device)
27
  with torch.no_grad():
28
  image_features = clip_model.encode_image(image)
29
  text_features = clip_model.encode_text(text)
 
23
 
24
  def evaluate_similarity(story, img_path="generated_image.png"):
25
  image = clip_preprocess(Image.open(img_path)).unsqueeze(0).to(device)
26
+ text = clip.tokenize([story], truncate=True).to(device)
27
  with torch.no_grad():
28
  image_features = clip_model.encode_image(image)
29
  text_features = clip_model.encode_text(text)