Update inference_manager.py
Browse files- inference_manager.py +2 -5
inference_manager.py
CHANGED
@@ -321,7 +321,6 @@ class ModelManager:
|
|
321 |
self.ext_models = {}
|
322 |
self.model_directory = model_directory
|
323 |
self.load_models()
|
324 |
-
self.auth_helper = AuthHelper()
|
325 |
|
326 |
#not enabled at the moment
|
327 |
def load_instant_x(self):
|
@@ -415,8 +414,7 @@ class ModelManager:
|
|
415 |
print(f"Failed to release model {model_id}: {e}")
|
416 |
|
417 |
@spaces.GPU(duration=40)
|
418 |
-
def generate_with_faceid(self, model_id,
|
419 |
-
self.auth_helper.check_auth(request, token)
|
420 |
model = self.models.get(model_id)
|
421 |
if not model:
|
422 |
raise Exception(f"invalid model_id {model_id}")
|
@@ -485,7 +483,7 @@ class ModelManager:
|
|
485 |
return [i[0] for i in images]
|
486 |
|
487 |
@spaces.GPU(duration=40)
|
488 |
-
def generate(self, model_id,
|
489 |
def callback_dynamic_cfg(pipe, step_index, timestep, callback_kwargs):
|
490 |
cfg_disabling_at = cfg.get('cfg_disabling_rate', 0.75)
|
491 |
if step_index == int(pipe.num_timesteps * cfg_disabling_at):
|
@@ -495,7 +493,6 @@ class ModelManager:
|
|
495 |
pipe._guidance_scale = 0.0
|
496 |
|
497 |
return callback_kwargs
|
498 |
-
self.auth_helper.check_auth(request, token)
|
499 |
model = self.models.get(model_id)
|
500 |
if not model:
|
501 |
raise Exception(f"invalid model_id {model_id}")
|
|
|
321 |
self.ext_models = {}
|
322 |
self.model_directory = model_directory
|
323 |
self.load_models()
|
|
|
324 |
|
325 |
#not enabled at the moment
|
326 |
def load_instant_x(self):
|
|
|
414 |
print(f"Failed to release model {model_id}: {e}")
|
415 |
|
416 |
@spaces.GPU(duration=40)
|
417 |
+
def generate_with_faceid(self, model_id, inference_params, progress=gr.Progress(track_tqdm=True)):
|
|
|
418 |
model = self.models.get(model_id)
|
419 |
if not model:
|
420 |
raise Exception(f"invalid model_id {model_id}")
|
|
|
483 |
return [i[0] for i in images]
|
484 |
|
485 |
@spaces.GPU(duration=40)
|
486 |
+
def generate(self, model_id, inference_params, progress=gr.Progress(track_tqdm=True)):
|
487 |
def callback_dynamic_cfg(pipe, step_index, timestep, callback_kwargs):
|
488 |
cfg_disabling_at = cfg.get('cfg_disabling_rate', 0.75)
|
489 |
if step_index == int(pipe.num_timesteps * cfg_disabling_at):
|
|
|
493 |
pipe._guidance_scale = 0.0
|
494 |
|
495 |
return callback_kwargs
|
|
|
496 |
model = self.models.get(model_id)
|
497 |
if not model:
|
498 |
raise Exception(f"invalid model_id {model_id}")
|