def load_model(self):
        """
        Loads a pre-trained model checkpoints from a specified directory. It checks for
        the best model ('last_best_checkpoint') in the checkpoint directory. If a model is
        found, it loads the model state into the current model instance.

        If no checkpoint is found, it will try to download the model from huggingface.
        If the downloading fails, it prints a warning message.

        Steps:
        - Search for the best model checkpoint or the most recent one.
        - Load the model's state dictionary from the checkpoint file.

        Raises:
        - FileNotFoundError: If neither 'last_best_checkpoint' nor 'last_checkpoint' files are found.
        """
        # Define paths for the best model and the last checkpoint
        best_name = os.path.join(self.args.checkpoint_dir, 'last_best_checkpoint')
        # Check if the last best checkpoint exists
        if not os.path.isfile(best_name):
            if not self.download_model(self.name):
                # If downloading is unsuccessful
                print(f'Warning: Downloading model {self.name} is not successful. Please try again or manually download from https://huggingface.co/alibabasglab/{self.name}/tree/main !')
                return

        if isinstance(self.model, nn.ModuleList):
            with open(best_name, 'r') as f:
                model_name = f.readline().strip()
                checkpoint_path = os.path.join(self.args.checkpoint_dir, model_name)
                self._load_model(self.model[0], checkpoint_path, model_key='mossformer')
                model_name = f.readline().strip()
                checkpoint_path = os.path.join(self.args.checkpoint_dir, model_name)
                self._load_model(self.model[1], checkpoint_path, model_key='generator')
        else:
            # Read the model's checkpoint name from the file
            with open(best_name, 'r') as f:
                model_name = f.readline().strip()
            # Form the full path to the model's checkpoint
            checkpoint_path = os.path.join(self.args.checkpoint_dir, model_name)
            self._load_model(self.model, checkpoint_path, model_key='model')

        Loads a pre-trained model checkpoints from a specified directory. It checks for
        the best model ('last_best_checkpoint') in the checkpoint directory. If a model is
        found, it loads the model state into the current model instance.

        If no checkpoint is found, it will try to download the model from huggingface.
        If the downloading fails, it prints a warning message.

        Steps:
        - Search for the best model checkpoint or the most recent one.
        - Load the model's state dictionary from the checkpoint file.

        Raises:
        - FileNotFoundError: If neither 'last_best_checkpoint' nor 'last_checkpoint' files are found.
        
clearvoice/clearvoice/networks.py