def extract_huggingface_archive(path: str) -> str:
        '''
            This function takes the path as input. The path is a string that can be one of the following:
            1. A downloaded archive file. This function will extract the model from the archive return the directory path.
            2. A repo_id in huggingface. This function will return the input string directly.

            path: the downloaded model archive path or a repo_id in huggingface
        Returns:
            The directory path to the model or the repo_id in huggingface
        '''
        if os.path.isfile(path):
            # if it's a file, check if it's a compressed file
            base, ext = os.path.splitext(path)
            if ext in ['.bin', '.pt']:
                raise InvalidModelPropertiesError(
                    f"Marqo does not support loading Hugging Face SBERT models from the provided single `{ext}` file. "
                    "Please try to wrap the model in a Hugging Face archive file and try again. ")

            try:
                # create a new directory with the same name as the file
                new_dir = base
                os.makedirs(new_dir, exist_ok=True)

                # extract the compressed file
                # If the target directory already exists, it will be overwritten by default without warning.
                if ext == '.zip':
                    with zipfile.ZipFile(path, 'r') as zip_ref:
                        zip_ref.extractall(new_dir)
                else:
                    with tarfile.open(path, 'r') as tar_ref:
                        tar_ref.extractall(new_dir)
                # return the path to the new directory
                return new_dir
            except (tarfile.ReadError, zipfile.BadZipfile):
                try:
                    os.remove(path)
                except Exception as remove_e:
                    raise RuntimeError(
                        f"Marqo encountered an error while attempting to delete a corrupted file `{path}`. "
                        f"Please report this issue on Marqo's Github Repo and replace the problematic Marqo instance with "
                        f"a new one. \n "
                        f"Error message: `{str(remove_e)}`"
                    )
                raise InvalidModelPropertiesError(
                    f'Marqo encountered an error while extracting the compressed model archive from `{path}`.\n '
                    f'This is probably because the file is corrupted or the extension `{ext}` is not supported. '
                    f'Marqo has removed the corrupted file from the disk.'
                    f'Please ensure that the file is a valid compressed file and try again.')

            # will this error really happen?
            except PermissionError:
                raise InvalidModelPropertiesError(
                    f'Marqo encountered an error while extracting the compressed model archive from `{path}`. '
                    f'This is probably because the Marqo does not have the permission to write to the directory. '
                    f'Please check the access permission of Marqo and try again.')

            except Exception as e:
                raise RuntimeError(
                    f'Marqo encountered an error while extracting the compressed model archive from `{path}`. '
                    f'The original error message is `{str(e)}`')

        else:
            # return the directory path or repo_id directory
            return path

            This function takes the path as input. The path is a string that can be one of the following:
            1. A downloaded archive file. This function will extract the model from the archive return the directory path.
            2. A repo_id in huggingface. This function will return the input string directly.

            path: the downloaded model archive path or a repo_id in huggingface
        Returns:
            The directory path to the model or the repo_id in huggingface
        
src/marqo/inference/native_inference/embedding_models/hugging_face_model.py