Structureswift-transformers 0.1.17Hub
SiblingsResponse
HubApi.swift:73struct SiblingsResponse
struct SiblingsResponse
import Hub
struct HubApi
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 getFilenames(from repoId: String, matching glob: 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
typealias Repo = Hub.Repo
typealias RepoType = Hub.RepoType
protocol Decodable
A type that can decode itself from an external representation.
protocol Encodable
A type that can encode itself to an external representation.
init(from decoder: any Decoder) throws