valhalla commited on
Commit
091b9da
1 Parent(s): 054827b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -1
app.py CHANGED
@@ -9,7 +9,20 @@ from PIL import Image
9
 
10
  import clip
11
  from dalle.models import Dalle
12
- from dalle.utils.utils import clip_score
 
 
 
 
 
 
 
 
 
 
 
 
 
13
 
14
 
15
  device = "cpu"
 
9
 
10
  import clip
11
  from dalle.models import Dalle
12
+ from dalle.utils.utils import clip_score, download
13
+
14
+ url = "https://arena.kakaocdn.net/brainrepo/models/minDALL-E/57b008f02ceaa02b779c8b7463143315/1.3B.tar.gz"
15
+ root = os.path.expanduser("~/.cache/minDALL-E")
16
+ filename = os.path.basename(url)
17
+ pathname = filename[:-len('.tar.gz')]
18
+
19
+ expected_md5 = url.split("/")[-2]
20
+ download_target = os.path.join(root, filename)
21
+ result_path = os.path.join(root, pathname)
22
+
23
+ if not os.path.exists(result_path):
24
+ result_path = download(url, root)
25
+
26
 
27
 
28
  device = "cpu"