Giter VIP home page Giter VIP logo

hf-hub's Introduction

This crates aims to emulate and be compatible with the huggingface_hub python package.

compatible means the Api should reuse the same files skipping downloads if they are already present and whenever this crate downloads or modifies this cache it should be consistent with huggingface_hub

At this time only a limited subset of the functionality is present, the goal is to add new features over time. We are currently treating this as an internel/external tool, meaning we will are currently modifying everything at will for out internal needs. This will eventually stabilize as it matures to accomodate most of our needs.

If you're interested in using this, you're welcome to do it but be warned about potential changing grounds.

If you want to contribute, you are more than welcome.

However allowing new features or creating new features might be denied by lack of maintainability time. We're focusing on what we currently internally need. Hopefully that subset is already interesting to more users.

How to use

Add the dependency

cargo add hf-hub  # --features tokio

tokio feature will enable an async (and potentially faster) API.

Use the crate:

use hf_hub::api::sync::Api;

let api = Api::new().unwrap();

let repo = api.model("bert-base-uncased".to_string());
let _filename = repo.get("config.json").unwrap();

// filename  is now the local location within hf cache of the config.json file

hf-hub's People

Contributors

narsil avatar mcpatate avatar marcusdunn avatar evgenyigumnov avatar olivierdehaene avatar gitniko avatar wh7f avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.