This commit is contained in:
Tran Xen
2023-09-09 10:51:36 +02:00
parent bf8ef5e9ec
commit c94d2aab4d
6 changed files with 20 additions and 18 deletions
+9 -3
View File
@@ -72,10 +72,16 @@ def get_current_swap_model() -> str:
models = get_swap_models()
model = models[0] if len(models) else None
logger.info("Try to use model : %s", model)
if not os.path.isfile(model): # type: ignore
logger.error("The model %s cannot be found or loaded", model)
try:
if not os.path.isfile(model): # type: ignore
logger.error("The model %s cannot be found or loaded", model)
raise FileNotFoundError(
"No faceswap model found. Please add it to the faceswaplab directory."
)
except:
raise FileNotFoundError(
"No faceswap model found. Please add it to the faceswaplab directory."
"Was not able to check model, please ensure the model is in the proper directory"
)
assert model is not None
return model