wenhu commited on
Commit
fcd973b
·
verified ·
1 Parent(s): f4db150

Update model/model_manager.py

Browse files
Files changed (1) hide show
  1. model/model_manager.py +15 -15
model/model_manager.py CHANGED
@@ -44,19 +44,19 @@ class ModelManager:
44
 
45
  @spaces.GPU(duration=120)
46
  def generate_image_ig(self, prompt, model_name):
47
- if self.NSFW_filter(prompt) == 'safe':
48
- pipe = self.load_model_pipe(model_name)
49
- result = pipe(prompt=prompt)
50
- else:
51
- result = ''
52
  return result
53
 
54
  def generate_image_ig_api(self, prompt, model_name):
55
- if self.NSFW_filter(prompt) == 'safe':
56
- pipe = self.load_model_pipe(model_name)
57
- result = pipe(prompt=prompt)
58
- else:
59
- result = ''
60
  return result
61
 
62
  def generate_image_ig_museum(self, model_name):
@@ -119,11 +119,11 @@ class ModelManager:
119
 
120
  @spaces.GPU(duration=200)
121
  def generate_image_ie(self, textbox_source, textbox_target, textbox_instruct, source_image, model_name):
122
- if self.NSFW_filter(" ".join([textbox_source, textbox_target, textbox_instruct])) == 'safe':
123
- pipe = self.load_model_pipe(model_name)
124
- result = pipe(src_image = source_image, src_prompt = textbox_source, target_prompt = textbox_target, instruct_prompt = textbox_instruct)
125
- else:
126
- result = ''
127
  return result
128
 
129
  def generate_image_ie_museum(self, model_name):
 
44
 
45
  @spaces.GPU(duration=120)
46
  def generate_image_ig(self, prompt, model_name):
47
+ #if self.NSFW_filter(prompt) == 'safe':
48
+ pipe = self.load_model_pipe(model_name)
49
+ result = pipe(prompt=prompt)
50
+ # else:
51
+ # result = ''
52
  return result
53
 
54
  def generate_image_ig_api(self, prompt, model_name):
55
+ # if self.NSFW_filter(prompt) == 'safe':
56
+ pipe = self.load_model_pipe(model_name)
57
+ result = pipe(prompt=prompt)
58
+ # else:
59
+ # result = ''
60
  return result
61
 
62
  def generate_image_ig_museum(self, model_name):
 
119
 
120
  @spaces.GPU(duration=200)
121
  def generate_image_ie(self, textbox_source, textbox_target, textbox_instruct, source_image, model_name):
122
+ # if self.NSFW_filter(" ".join([textbox_source, textbox_target, textbox_instruct])) == 'safe':
123
+ pipe = self.load_model_pipe(model_name)
124
+ result = pipe(src_image = source_image, src_prompt = textbox_source, target_prompt = textbox_target, instruct_prompt = textbox_instruct)
125
+ # else:
126
+ # result = ''
127
  return result
128
 
129
  def generate_image_ie_museum(self, model_name):