File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -78,14 +78,10 @@ public async Task<string> GetPathAsync(CancellationToken? ct = null)
7878 return await SelectedVariant . GetPathAsync ( ct ) . ConfigureAwait ( false ) ;
7979 }
8080
81- public async Task DownloadAsync ( Action < float > ? downloadProgress = null )
81+ public async Task DownloadAsync ( Action < float > ? downloadProgress = null ,
82+ CancellationToken ? ct = null )
8283 {
83- await SelectedVariant . DownloadAsync ( downloadProgress ) . ConfigureAwait ( false ) ;
84- }
85-
86- public async Task DownloadAsync ( Action < float > ? downloadProgress , CancellationToken ct )
87- {
88- await ModelExtensions . DownloadAsync ( SelectedVariant , downloadProgress , ct ) . ConfigureAwait ( false ) ;
84+ await SelectedVariant . DownloadAsync ( downloadProgress , ct ) . ConfigureAwait ( false ) ;
8985 }
9086
9187 public async Task LoadAsync ( CancellationToken ? ct = null )
Original file line number Diff line number Diff line change @@ -61,12 +61,8 @@ public async Task<string> GetPathAsync(CancellationToken? ct = null)
6161 . ConfigureAwait ( false ) ;
6262 }
6363
64- public async Task DownloadAsync ( Action < float > ? downloadProgress = null )
65- {
66- await DownloadAsync ( downloadProgress , CancellationToken . None ) . ConfigureAwait ( false ) ;
67- }
68-
69- public async Task DownloadAsync ( Action < float > ? downloadProgress , CancellationToken ct )
64+ public async Task DownloadAsync ( Action < float > ? downloadProgress = null ,
65+ CancellationToken ? ct = null )
7066 {
7167 await Utils . CallWithExceptionHandling ( ( ) => DownloadImplAsync ( downloadProgress , ct ) ,
7268 $ "Error downloading model { Id } ", _logger )
Original file line number Diff line number Diff line change @@ -27,7 +27,9 @@ public interface IModel
2727 /// <param name="downloadProgress">
2828 /// Optional progress callback for download progress.
2929 /// Percentage download (0 - 100.0) is reported.</param>
30- Task DownloadAsync ( Action < float > ? downloadProgress = null ) ;
30+ /// <param name="ct">Optional cancellation token.</param>
31+ Task DownloadAsync ( Action < float > ? downloadProgress = null ,
32+ CancellationToken ? ct = null ) ;
3133
3234 /// <summary>
3335 /// Gets the model path if cached.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments