ryaalbr commited on
Commit
c0e07e6
·
verified ·
1 Parent(s): 24015e0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -1,6 +1,6 @@
1
  import gradio as gr
2
  from datasets import load_dataset, DownloadConfig
3
-
4
  import random
5
  import numpy as np
6
  from transformers import CLIPProcessor, CLIPModel
@@ -80,8 +80,10 @@ emb_filename = hf_hub_download(
80
  filename="unsplash-25k-photos-embeddings-indexes.pkl",
81
  repo_type="space"
82
  )
83
- with open(emb_filename, 'rb') as emb:
84
- id2url, img_names, img_emb = pickle.load(emb)
 
 
85
 
86
 
87
  height = 256 # height for resizing images
 
1
  import gradio as gr
2
  from datasets import load_dataset, DownloadConfig
3
+ import warnings
4
  import random
5
  import numpy as np
6
  from transformers import CLIPProcessor, CLIPModel
 
80
  filename="unsplash-25k-photos-embeddings-indexes.pkl",
81
  repo_type="space"
82
  )
83
+ with warnings.catch_warnings():
84
+ warnings.filterwarnings("ignore", category=DeprecationWarning)
85
+ with open(emb_filename, 'rb') as emb:
86
+ id2url, img_names, img_emb = pickle.load(emb)
87
 
88
 
89
  height = 256 # height for resizing images