caohy666 commited on
Commit
e7e90f8
·
1 Parent(s): e4d1ed2

<fix> fix a model loading bug.

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -103,8 +103,6 @@ def process_image_and_text(condition_image, target_prompt, condition_image_promp
103
  global pipe, current_task, transformer
104
  if current_task != task:
105
  if current_task is None:
106
- current_task = task
107
-
108
  # insert LoRA
109
  lora_config = LoraConfig(
110
  r=16,
@@ -130,6 +128,8 @@ def process_image_and_text(condition_image, target_prompt, condition_image_promp
130
  if isinstance(m, peft.tuners.lora.layer.Linear):
131
  m.forward = restore_forward(m)
132
 
 
 
133
  # hack LoRA forward
134
  def create_hacked_forward(module):
135
  if not hasattr(module, 'original_forward'):
 
103
  global pipe, current_task, transformer
104
  if current_task != task:
105
  if current_task is None:
 
 
106
  # insert LoRA
107
  lora_config = LoraConfig(
108
  r=16,
 
128
  if isinstance(m, peft.tuners.lora.layer.Linear):
129
  m.forward = restore_forward(m)
130
 
131
+ current_task = task
132
+
133
  # hack LoRA forward
134
  def create_hacked_forward(module):
135
  if not hasattr(module, 'original_forward'):