Roopansh commited on
Commit
347f4d6
β€’
1 Parent(s): 1214fb7

safe model tensor updated

Browse files
Files changed (2) hide show
  1. app.py +4 -1
  2. requirements.txt +0 -4
app.py CHANGED
@@ -88,6 +88,8 @@ UNet_Encoder = UNet2DConditionModel_ref.from_pretrained(
88
  base_path,
89
  subfolder="unet_encoder",
90
  torch_dtype=torch.float16,
 
 
91
  )
92
 
93
  parsing_model = Parsing(0)
@@ -120,8 +122,9 @@ pipe = TryonPipeline.from_pretrained(
120
  torch_dtype=torch.float16,
121
  )
122
  pipe.unet_encoder = UNet_Encoder
 
123
 
124
- @spaces.GPU
125
  def start_tryon(dict,garm_img,garment_des,is_checked,is_checked_crop,denoise_steps,seed):
126
  device = "cuda"
127
 
 
88
  base_path,
89
  subfolder="unet_encoder",
90
  torch_dtype=torch.float16,
91
+ load_in_8bit=True,
92
+ max_memory=f'{int(torch.cuda.mem_get_info()[0]/1024**3)-2}GB'
93
  )
94
 
95
  parsing_model = Parsing(0)
 
122
  torch_dtype=torch.float16,
123
  )
124
  pipe.unet_encoder = UNet_Encoder
125
+ pipe.to("cuda")
126
 
127
+ @spaces.GPU(duration=120)
128
  def start_tryon(dict,garm_img,garment_des,is_checked,is_checked_crop,denoise_steps,seed):
129
  device = "cuda"
130
 
requirements.txt CHANGED
@@ -21,7 +21,3 @@ fvcore
21
  cloudpickle
22
  omegaconf
23
  pycocotools
24
- gradio
25
- peft
26
- spaces
27
- bitsandbytes
 
21
  cloudpickle
22
  omegaconf
23
  pycocotools