diff --git a/HuggingfaceHub/HFDownloader.DownloadFile.cs b/HuggingfaceHub/HFDownloader.DownloadFile.cs index 0aa4be2..c9038eb 100644 --- a/HuggingfaceHub/HFDownloader.DownloadFile.cs +++ b/HuggingfaceHub/HFDownloader.DownloadFile.cs @@ -87,7 +87,7 @@ public static async Task DownloadFileAsync(string repoId, string filenam // shortcut everything. if(HFGlobalConfig.CommitHashRegex.IsMatch(revision)){ pointerPath = GetPointerPath(storageFolder, revision, relativeFilename); -#if NET6_0_OR_GREATER +#if NET7_0_OR_GREATER if(Path.Exists(pointerPath)){ #else if(File.Exists(pointerPath)){ @@ -615,7 +615,11 @@ private static void CreateSymlink(string src, string dst, bool newBlob = false){ try{ File.Delete(dst); } - catch (Exception) { } + catch (Exception) + { + Logger?.LogWarning(dst + " already exists and cannot be overwritten. Skipped the file copy."); + return; + } var absSrc = Path.GetFullPath(src); var absDst = Path.GetFullPath(dst); diff --git a/HuggingfaceHub/HFDownloader.DownloadSnapshot.cs b/HuggingfaceHub/HFDownloader.DownloadSnapshot.cs index 2b66d1f..3d606cf 100644 --- a/HuggingfaceHub/HFDownloader.DownloadSnapshot.cs +++ b/HuggingfaceHub/HFDownloader.DownloadSnapshot.cs @@ -1,6 +1,5 @@ using System.Diagnostics; using Huggingface.Common; -using HuggingfaceHub; using Microsoft.Extensions.Logging; namespace Huggingface diff --git a/HuggingfaceHub/HuggingfaceHub.csproj b/HuggingfaceHub/HuggingfaceHub.csproj index 4990d14..b6e28ab 100644 --- a/HuggingfaceHub/HuggingfaceHub.csproj +++ b/HuggingfaceHub/HuggingfaceHub.csproj @@ -3,11 +3,31 @@ enable enable - net7.0;netstandard2.0 + net6;net7;net8;netstandard2.0 12 true + + AnyCPU;x64;Arm64 + Apache-2.0 + 0.1.1 + Rinne + true + https://github.com/AsakusaRinne/HuggingfaceHub + git + Huggingface, Model, Download + https://avatars.githubusercontent.com/u/25720743?s=200&v=4 + + HuggingfaceHub is a library to download models and files from Huggingface in .NET. + + packages + README.md + True + + + + diff --git a/HuggingfaceHub/IGroupedProgress.cs b/HuggingfaceHub/IGroupedProgress.cs index b76f2e4..7f4ac11 100644 --- a/HuggingfaceHub/IGroupedProgress.cs +++ b/HuggingfaceHub/IGroupedProgress.cs @@ -4,7 +4,7 @@ using System.Text; using System.Threading.Tasks; -namespace HuggingfaceHub +namespace Huggingface { /// /// Progress callback when downloading multiple files