/ Jade / Support / HubApi+default.swift
HubApi+default.swift
 1  //
 2  //  HubApi+default.swift
 3  //  MLXChatExample
 4  //
 5  //  Created by İbrahim Çetin on 21.04.2025.
 6  //
 7  
 8  import Foundation
 9  @preconcurrency import Hub
10  
11  /// Extension providing a default HubApi instance for downloading model files
12  extension HubApi {
13      /// Default HubApi instance configured to download models to the user's Downloads directory
14      /// under a 'huggingface' subdirectory.
15      #if os(macOS)
16          static let `default` = HubApi(
17              downloadBase: URL.downloadsDirectory.appending(path: "huggingface")
18          )
19      #else
20          static let `default` = HubApi(
21              downloadBase: URL.cachesDirectory.appending(path: "huggingface")
22          )
23      #endif
24  }