% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/hub_snapshot.R
\name{hub_snapshot}
\alias{hub_snapshot}
\title{Snapshot the entire repository}
\usage{
hub_snapshot(
  repo_id,
  ...,
  revision = "main",
  repo_type = "model",
  local_files_only = FALSE,
  force_download = FALSE,
  allow_patterns = NULL,
  ignore_patterns = NULL
)
}
\arguments{
\item{repo_id}{The repository identifier, eg \code{"bert-base-uncased"} or \code{"deepset/sentence_bert"}.}

\item{...}{currenytly unused.}

\item{revision}{Revision (branch, tag or commitid) to download the file from.}

\item{repo_type}{The type of the repository. Currently only \code{"model"} is supported.}

\item{local_files_only}{Only use cached files?}

\item{force_download}{For re-downloading of files that are cached.}

\item{allow_patterns}{A character vector containing patters that are used to
filter allowed files to snapshot.}

\item{ignore_patterns}{A character vector contaitning patterns to reject files
from being downloaded.}
}
\value{
A string with the path to the snapshot directory containing all
downloaded files.
}
\description{
Downloads and stores all files from a Hugging Face Hub repository.
}
\examples{
try({
withr::with_envvar(c(HUGGINGFACE_HUB_CACHE = tempdir()), {
path <- hub_snapshot("gpt2", allow_patterns = "config.json")
list.files(path)
})
})
}
