          cudavers = chk.strip().replace("libcudart.so.", "")
          self.cuda_version = cudavers[:cudavers.find(" ")]
          self.cuda_path = chk[chk.find("=>") + 3:chk.find("targets") - 1]
  
      def _cuda_check_windows(self):
          """ Check Windows CUDA Version and path from Environment Variables"""
          if not self._cuda_keys:  # Cuda environment variable not found
              return
          self.cuda_version = self._cuda_keys[0].lower().replace("cuda_path_v", "").replace("_", ".")
          self.cuda_path = os.environ[self._cuda_keys[0][0]]
 
</s> remove     def __init__(self):
        self.cuda_path = None
        self.cuda_version = None
        self.cudnn_version = None
 </s> add     def __init__(self) -> None:
        self.cuda_path: Optional[str] = None
        self.cuda_version: Optional[str] = None
        self.cudnn_version: Optional[str] = None </s> remove             self.cuda_version = version.groupdict().get("cuda", None)
 </s> add             if version is not None:
                self.cuda_version = version.groupdict().get("cuda", None) </s> remove         self._os = platform.system().lower()
        self._cuda_keys = [key for key in os.environ if key.lower().startswith("cuda_path_v")]
        self._cudnn_header_files = ["cudnn_version.h", "cudnn.h"]
 </s> add         self._os: str = platform.system().lower()
        self._cuda_keys: List[str] = [key
                                      for key in os.environ
                                      if key.lower().startswith("cuda_path_v")]
        self._cudnn_header_files: List[str] = ["cudnn_version.h", "cudnn.h"] </s> remove         if (not self.updater and
                self.os_version[0].lower() == "darwin" and
                platform.machine() == "arm64" and not self.is_conda):
            self.output.error("Setting up Faceswap for Apple Silicon outside of a Conda "
                              "environment is unsupported")
            sys.exit(1)
 </s> add         if self.os_version[0].lower() == "darwin" and platform.machine() == "arm64":
            self.enable_apple_silicon = True

            if not self.updater and not self.is_conda:
                self.output.error("Setting up Faceswap for Apple Silicon outside of a Conda "
                                  "environment is unsupported")
                sys.exit(1) </s> remove     def _cuda_check_linux(self):
 </s> add     def _cuda_check_linux(self) -> None:
    def _cuda_check_windows(self) -> None:
          cudavers = chk.strip().replace("libcudart.so.", "")
          self.cuda_version = cudavers[:cudavers.find(" ")]
          self.cuda_path = chk[chk.find("=>") + 3:chk.find("targets") - 1]
  
    def _cuda_check_windows(self) -> None:
          """ Check Windows CUDA Version and path from Environment Variables"""
          if not self._cuda_keys:  # Cuda environment variable not found
              return
          self.cuda_version = self._cuda_keys[0].lower().replace("cuda_path_v", "").replace("_", ".")
          self.cuda_path = os.environ[self._cuda_keys[0][0]]
keep keep keep keep replace keep keep keep keep keep
 pin protobuf

Setup: automatically detect for apple-silicon 
setup.py