HuggingfaceHub 0.1.2
See the version list below for details.
dotnet add package HuggingfaceHub --version 0.1.2
NuGet\Install-Package HuggingfaceHub -Version 0.1.2
<PackageReference Include="HuggingfaceHub" Version="0.1.2" />
paket add HuggingfaceHub --version 0.1.2
#r "nuget: HuggingfaceHub, 0.1.2"
// Install HuggingfaceHub as a Cake Addin #addin nuget:?package=HuggingfaceHub&version=0.1.2 // Install HuggingfaceHub as a Cake Tool #tool nuget:?package=HuggingfaceHub&version=0.1.2
A library to download models & files from HuggingFace with C#.
This library is under development. Some features have been completed but hey haven't been well tested. If you have any problem when running it from source, please open an issue to tell us.
Key features
- Download single file.
- Get information of file and repo.
- Download snapshot (repo).
- Resume download.
- Parallel download multiple files (only in .NET 6 or higher).
- Upload files.
- Support repo types other than model.
Usage
Download single file
using Huggingface;
var path = await HFDownloader.DownloadFileAsync("<RepoId>", "<Filename>");
Download repo
using Huggingface;
var res = await HFDownloader.DownloadSnapshotAsync("<RepoId>");
Get repo information
Currently, only model-type repo is supported.
using Huggingface;
var info = await HFDownloader.GetModelInfoAsync("<RepoId>");
Download the repo with progress handler
using Huggingface;
var res = await HFDownloader.DownloadSnapshotAsync("<RepoId>", progress: new MyConsoleProgress());
class MyConsoleProgress: IGroupedProgress
{
public void Report(string filename, int progress)
{
// Do your work here.
// `progress` is in range [0, 100].
}
}
Customize the endpoint
using Huggingface;
HFGlobalConfig.EndPoint = "<Endpoint Url>";
Please check the definition of HFGlobalConfig
to see all the configuration you could set.
Acknowledgement
This library is mainly adopts from huggingface_hub, which is the official implementation written in Python.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.1)
- Newtonsoft.Json (>= 13.0.3)
-
net6.0
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.1)
- Newtonsoft.Json (>= 13.0.3)
-
net7.0
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.1)
- Newtonsoft.Json (>= 13.0.3)
-
net8.0
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.1)
- Newtonsoft.Json (>= 13.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on HuggingfaceHub:
Repository | Stars |
---|---|
SciSharp/LLamaSharp
A C#/.NET library to run LLM (🦙LLaMA/LLaVA) on your local device efficiently.
|