JMalott commited on
Commit
d6a404f
1 Parent(s): afcda0c

Update utils.py

Browse files
Files changed (1) hide show
  1. utils.py +7 -7
utils.py CHANGED
@@ -69,8 +69,7 @@ def footer():
69
  "Created by ",
70
  link("https://jonathanmalott.com", "Jonathan Malott"),
71
  br(),
72
- link("https://bridgingbarriers.utexas.edu/good-systems", "Good Systems"),
73
- " Grand Challenge",
74
  ", The University of Texas at Austin.",
75
  " Advised by Dr. Junfeng Jiao.",
76
  br(),
@@ -78,15 +77,16 @@ def footer():
78
  ]
79
  layout(*myargs)
80
 
81
- #footer()
82
 
 
83
  def generate(prompt,crazy,k):
 
84
 
85
  device = 'cpu'
86
- print("-2-")
87
- model = Dalle.from_pretrained('minDALL-E/1.3B') # This will automatically download the pretrained model.
88
- print("-3-")
89
- model.to(device=device)
90
  num_candidates = 1
91
 
92
  images = []
 
69
  "Created by ",
70
  link("https://jonathanmalott.com", "Jonathan Malott"),
71
  br(),
72
+ link("https://bridgingbarriers.utexas.edu/good-systems", "Good Systems Grand Challenge"),
 
73
  ", The University of Texas at Austin.",
74
  " Advised by Dr. Junfeng Jiao.",
75
  br(),
 
77
  ]
78
  layout(*myargs)
79
 
 
80
 
81
+ model = False
82
  def generate(prompt,crazy,k):
83
+ global model
84
 
85
  device = 'cpu'
86
+ if(model == False):
87
+ model = Dalle.from_pretrained('minDALL-E/1.3B') # This will automatically download the pretrained model.
88
+ model.to(device=device)
89
+
90
  num_candidates = 1
91
 
92
  images = []