Instance Methodswift-transformers 0.1.17Hub
getFilenames(from:matching:)
HubApi.swift:137func getFilenames(from repoId: String, matching glob: String) async throws -> [String]
func getFilenames(from repoId: String, matching glob: String) async throws -> [String]
s3Hub0A3ApiV12getFilenames4from8matchingSaySSGSS_SStYaKF
What are these?8TBBT
import Hub
struct HubApi
@frozen struct String
A Unicode string value that is a collection of characters.
init(downloadBase: URL? = nil, hfToken: String? = nil, endpoint: String = "https://huggingface.co", useBackgroundSession: Bool = false)
static let shared: HubApi
func configuration(fileURL: URL) throws -> Config
Assumes the file is already present at local url. fileURL
is a complete local file path for the given model
func configuration(from filename: String, in repo: Repo) throws -> Config
Assumes the file has already been downloaded. filename
is relative to the download base.
func getFileMetadata(from repo: Repo, matching glob: String) async throws -> [FileMetadata]
func getFileMetadata(from repo: Repo, matching globs: [String] = []) async throws -> [FileMetadata]
func getFileMetadata(from repoId: String, matching glob: String) async throws -> [FileMetadata]
func getFileMetadata(from repoId: String, matching globs: [String] = []) async throws -> [FileMetadata]
func getFileMetadata(url: URL) async throws -> FileMetadata
func getFilenames(from repo: Repo, matching globs: [String] = []) async throws -> [String]
func getFilenames(from repo: Repo, matching glob: String) async throws -> [String]
func getFilenames(from repoId: String, matching globs: [String] = []) async throws -> [String]
func httpGet(for url: URL) async throws -> (Data, HTTPURLResponse)
Throws error if the response code is not 20X
func httpHead(for url: URL) async throws -> (Data, HTTPURLResponse)
func localRepoLocation(_ repo: Repo) -> URL
@discardableResult func snapshot(from repo: Repo, matching glob: String, progressHandler: @escaping (Progress) -> Void = { _ in }) async throws -> URL
@discardableResult func snapshot(from repo: Repo, matching globs: [String] = [], progressHandler: @escaping (Progress) -> Void = { _ in }) async throws -> URL
@discardableResult func snapshot(from repoId: String, matching glob: String, progressHandler: @escaping (Progress) -> Void = { _ in }) async throws -> URL
@discardableResult func snapshot(from repoId: String, matching globs: [String] = [], progressHandler: @escaping (Progress) -> Void = { _ in }) async throws -> URL
func whoami() async throws -> Config
struct FileMetadata
A structure representing metadata for a remote file
struct HubFileDownloader
struct Sibling
Model data for parsed filenames
struct SiblingsResponse
typealias Repo = Hub.Repo
typealias RepoType = Hub.RepoType