ford442 commited on
Commit
3f0ac47
·
verified ·
1 Parent(s): 837c08c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -6,7 +6,8 @@
6
  # copies of the Software, and to permit persons to whom the Software is
7
  import spaces
8
  import os
9
-
 
10
  import random
11
  import uuid
12
  import gradio as gr
@@ -153,14 +154,14 @@ def load_and_prepare_model():
153
  pipe.watermark=None
154
  pipe.safety_checker=None
155
 
156
- # Freeze vae and unet
157
  pipe.vae.requires_grad_(False)
158
  pipe.unet.requires_grad_(False)
159
  pipe.text_encoder.requires_grad_(False)
160
  pipe.unet.eval()
161
  pipe.vae.eval()
162
  pipe.text_encoder.eval()
163
-
164
 
165
  pipe.unet = pipe.unet.to(memory_format=torch.contiguous_format)
166
 
@@ -172,7 +173,7 @@ def load_and_prepare_model():
172
  return pipe
173
 
174
  hidet.option.parallel_build(True)
175
- hidet.option.parallel_tune(2,2.0)
176
  #hidet.torch.dynamo_config.steal_weights(False)
177
  torch._dynamo.config.suppress_errors = True
178
  torch._dynamo.disallow_in_graph(diffusers.models.attention.BasicTransformerBlock)
 
6
  # copies of the Software, and to permit persons to whom the Software is
7
  import spaces
8
  import os
9
+ import subprocess
10
+ subprocess.run(['sh', './conda.sh'])
11
  import random
12
  import uuid
13
  import gradio as gr
 
154
  pipe.watermark=None
155
  pipe.safety_checker=None
156
 
157
+ ''' # Freeze vae and unet
158
  pipe.vae.requires_grad_(False)
159
  pipe.unet.requires_grad_(False)
160
  pipe.text_encoder.requires_grad_(False)
161
  pipe.unet.eval()
162
  pipe.vae.eval()
163
  pipe.text_encoder.eval()
164
+ '''
165
 
166
  pipe.unet = pipe.unet.to(memory_format=torch.contiguous_format)
167
 
 
173
  return pipe
174
 
175
  hidet.option.parallel_build(True)
176
+ hidet.option.parallel_tune(4,1.5)
177
  #hidet.torch.dynamo_config.steal_weights(False)
178
  torch._dynamo.config.suppress_errors = True
179
  torch._dynamo.disallow_in_graph(diffusers.models.attention.BasicTransformerBlock)