wenhu commited on
Commit
b8b944d
1 Parent(s): f2f137f

Update model/model_manager.py

Browse files
Files changed (1) hide show
  1. model/model_manager.py +14 -14
model/model_manager.py CHANGED
@@ -61,23 +61,23 @@ class ModelManager:
61
 
62
  @spaces.GPU(duration=120)
63
  def generate_image_ig(self, prompt, model_name):
64
- if 'unsafe' not in self.NSFW_filter(prompt):
65
- print('The prompt is safe')
66
- pipe = self.load_model_pipe(model_name)
67
- result = pipe(prompt=prompt)
68
- else:
69
- print(f'The prompt "{prompt}" is not safe')
70
- result = ''
71
  return result
72
 
73
  def generate_image_ig_api(self, prompt, model_name):
74
- if 'unsafe' not in self.NSFW_filter(prompt):
75
- print('The prompt is safe')
76
- pipe = self.load_model_pipe(model_name)
77
- result = pipe(prompt=prompt)
78
- else:
79
- print(f'The prompt "{prompt}" is not safe')
80
- result = ''
81
  return result
82
 
83
  def generate_image_ig_museum(self, model_name):
 
61
 
62
  @spaces.GPU(duration=120)
63
  def generate_image_ig(self, prompt, model_name):
64
+ # if 'unsafe' not in self.NSFW_filter(prompt):
65
+ print('The prompt is safe')
66
+ pipe = self.load_model_pipe(model_name)
67
+ result = pipe(prompt=prompt)
68
+ # else:
69
+ # print(f'The prompt "{prompt}" is not safe')
70
+ # result = ''
71
  return result
72
 
73
  def generate_image_ig_api(self, prompt, model_name):
74
+ # if 'unsafe' not in self.NSFW_filter(prompt):
75
+ print('The prompt is safe')
76
+ pipe = self.load_model_pipe(model_name)
77
+ result = pipe(prompt=prompt)
78
+ # else:
79
+ # print(f'The prompt "{prompt}" is not safe')
80
+ # result = ''
81
  return result
82
 
83
  def generate_image_ig_museum(self, model_name):