diff --git a/android/whisperkit/detekt-baseline.xml b/android/whisperkit/detekt-baseline.xml
index 4c4b90c..9ef856f 100644
--- a/android/whisperkit/detekt-baseline.xml
+++ b/android/whisperkit/detekt-baseline.xml
@@ -3,6 +3,7 @@
LargeClass:ArgmaxModelDownloaderImplTest.kt$ArgmaxModelDownloaderImplTest
+ LongMethod:KtorHuggingFaceApiImpl.kt$KtorHuggingFaceApiImpl$private suspend fun FlowCollector<Progress>.downloadFilesWithRetry( from: Repo, revision: String, files: List<String>, baseDir: File, )
ThrowsCount:WhisperKit.kt$WhisperKit.Builder$@Throws(WhisperKitException::class) fun build(): WhisperKit
TooGenericExceptionCaught:KtorHuggingFaceApiImpl.kt$KtorHuggingFaceApiImpl$e: Exception
TooGenericExceptionCaught:WhisperKitImpl.kt$WhisperKitImpl$e: Exception
diff --git a/android/whisperkit/src/main/java/com/argmaxinc/whisperkit/huggingface/HuggingFaceApi.kt b/android/whisperkit/src/main/java/com/argmaxinc/whisperkit/huggingface/HuggingFaceApi.kt
index f7703bd..514bafe 100644
--- a/android/whisperkit/src/main/java/com/argmaxinc/whisperkit/huggingface/HuggingFaceApi.kt
+++ b/android/whisperkit/src/main/java/com/argmaxinc/whisperkit/huggingface/HuggingFaceApi.kt
@@ -41,11 +41,13 @@ interface HuggingFaceApi {
* Retrieves a list of file names from a HuggingFace repository that match the specified glob patterns.
*
* @param from The repository to search in
+ * @param revision The revision/branch/commit to use. Defaults to "main"
* @param globFilters List of glob patterns to filter files. If empty, all files are returned
* @return List of file names that match the filters
*/
suspend fun getFileNames(
from: Repo,
+ revision: String = "main",
globFilters: List = listOf(),
): List
@@ -53,21 +55,24 @@ interface HuggingFaceApi {
* Retrieves detailed information about a model from a HuggingFace repository.
*
* @param from The repository containing the model, needs to be type [RepoType.MODELS]
+ * @param revision The revision/branch/commit to use. Defaults to "main"
* @return [ModelInfo] object containing model details
* @throws IllegalArgumentException if the repository type is not [RepoType.MODELS]
*/
- suspend fun getModelInfo(from: Repo): ModelInfo
+ suspend fun getModelInfo(from: Repo, revision: String = "main"): ModelInfo
/**
* Retrieves metadata for a specific file from a HuggingFace repository.
* This is useful for checking file sizes before downloading.
*
* @param from The repository containing the file
+ * @param revision The revision/branch/commit to use. Defaults to "main"
* @param filename The name of the file to get metadata for
* @return FileMetadata object containing file information
*/
suspend fun getFileMetadata(
from: Repo,
+ revision: String = "main",
filename: String,
): FileMetadata
@@ -76,11 +81,13 @@ interface HuggingFaceApi {
* This is useful for checking file sizes before downloading multiple files.
*
* @param from The repository containing the files
+ * @param revision The revision/branch/commit to use. Defaults to "main"
* @param globFilters List of glob patterns to filter files. If empty, all files are returned
* @return List of FileMetadata objects for files that match the filters
*/
suspend fun getFileMetadata(
from: Repo,
+ revision: String = "main",
globFilters: List = listOf(),
): List
@@ -90,6 +97,7 @@ interface HuggingFaceApi {
* Progress is reported through a Flow of [Progress] objects.
*
* @param from The repository to download from
+ * @param revision The revision/branch/commit to use. Defaults to "main"
* @param globFilters List of glob patterns to filter which files to download
* @param baseDir The local directory where files will be downloaded
* @return Flow of [Progress] objects indicating download progress
@@ -97,6 +105,7 @@ interface HuggingFaceApi {
*/
fun snapshot(
from: Repo,
+ revision: String = "main",
globFilters: List,
baseDir: File,
): Flow