Wuvin commited on
Commit
b77390c
1 Parent(s): 0977aa6
gradio_app/custom_models/mvimg_prediction.py CHANGED
@@ -14,7 +14,7 @@ checkpoint_path = "ckpt/img2mvimg/unet_state_dict.pth"
14
 
15
  def predict(img_list: List[Image.Image], guidance_scale=2., **kwargs):
16
  trainer, pipeline = load_pipeline(training_config, checkpoint_path)
17
- pipeline.enable_model_cpu_offload()
18
 
19
  if isinstance(img_list, Image.Image):
20
  img_list = [img_list]
 
14
 
15
  def predict(img_list: List[Image.Image], guidance_scale=2., **kwargs):
16
  trainer, pipeline = load_pipeline(training_config, checkpoint_path)
17
+ # pipeline.enable_model_cpu_offload()
18
 
19
  if isinstance(img_list, Image.Image):
20
  img_list = [img_list]
gradio_app/custom_models/normal_prediction.py CHANGED
@@ -10,7 +10,7 @@ checkpoint_path = "ckpt/image2normal/unet_state_dict.pth"
10
 
11
  def predict_normals(image: List[Image.Image], guidance_scale=2., do_rotate=True, num_inference_steps=30, **kwargs):
12
  trainer, pipeline = load_pipeline(training_config, checkpoint_path)
13
- pipeline.enable_model_cpu_offload()
14
 
15
  img_list = image if isinstance(image, list) else [image]
16
  img_list = [rgba_to_rgb(i) if i.mode == 'RGBA' else i for i in img_list]
 
10
 
11
  def predict_normals(image: List[Image.Image], guidance_scale=2., do_rotate=True, num_inference_steps=30, **kwargs):
12
  trainer, pipeline = load_pipeline(training_config, checkpoint_path)
13
+ # pipeline.enable_model_cpu_offload()
14
 
15
  img_list = image if isinstance(image, list) else [image]
16
  img_list = [rgba_to_rgb(i) if i.mode == 'RGBA' else i for i in img_list]
gradio_app/custom_models/utils.py CHANGED
@@ -71,5 +71,5 @@ def load_pipeline(config_path, ckpt_path, pipeline_filter=lambda x: True, weight
71
  pipeline = trainer.construct_pipeline(shared_modules, configurable_unet.unet)
72
  pipeline.set_progress_bar_config(disable=False)
73
  trainer_out = trainer
74
- pipeline = pipeline.to(device)
75
  return trainer_out, pipeline
 
71
  pipeline = trainer.construct_pipeline(shared_modules, configurable_unet.unet)
72
  pipeline.set_progress_bar_config(disable=False)
73
  trainer_out = trainer
74
+ pipeline = pipeline.to(device, dtype=weight_dtype)
75
  return trainer_out, pipeline