diff --git a/pkg/cmd/kitimport/hfimport.go b/pkg/cmd/kitimport/hfimport.go index 0d4124f5..aea7b52c 100644 --- a/pkg/cmd/kitimport/hfimport.go +++ b/pkg/cmd/kitimport/hfimport.go @@ -107,7 +107,7 @@ func importUsingHF(ctx context.Context, opts *importOptions) error { if err != nil { return err } - if err := hf.DownloadFiles(ctx, opts.repo, tmpDir, toDownload, opts.token, opts.concurrency); err != nil { + if err := hf.DownloadFiles(ctx, repo, tmpDir, toDownload, opts.token, opts.concurrency); err != nil { return fmt.Errorf("error downloading repository: %w", err) } diff --git a/pkg/lib/hf/download.go b/pkg/lib/hf/download.go index 6f9ef132..2142f240 100644 --- a/pkg/lib/hf/download.go +++ b/pkg/lib/hf/download.go @@ -88,6 +88,7 @@ func downloadFile( progress *output.DownloadProgressBar, plog *output.ProgressLogger) error { + plog.Debugf("Downloading from %s", srcURL) req, err := http.NewRequestWithContext(ctx, http.MethodGet, srcURL, nil) if err != nil { return fmt.Errorf("failed to resolve URL: %w", err) @@ -106,7 +107,7 @@ func downloadFile( }() if resp.StatusCode != http.StatusOK { - return fmt.Errorf("received status code %d when downloading file %s to %s", resp.StatusCode, srcURL, destPath) + return fmt.Errorf("received status code %d when downloading file %s from %s", resp.StatusCode, filename, srcURL) } contentRC := progress.TrackDownload(resp.Body, filename, resp.ContentLength)