auto switch mps device to cpu device

This commit is contained in:
Qing
2023-02-11 13:30:09 +08:00
parent f9b5dcbfd7
commit 8f8bcfe0f4
15 changed files with 52 additions and 19 deletions

View File

@@ -5,7 +5,7 @@ import numpy as np
import torch
from loguru import logger
from lama_cleaner.helper import download_model, norm_img, get_cache_path_by_url
from lama_cleaner.helper import download_model, norm_img, get_cache_path_by_url
from lama_cleaner.model.base import InpaintModel
from lama_cleaner.schema import Config
@@ -16,6 +16,7 @@ LAMA_MODEL_URL = os.environ.get(
class LaMa(InpaintModel):
name = "lama"
pad_mod = 8
def init_model(self, device, **kwargs):