hugging-face-client 0.2.0

rust implment of Hugging Face Hub API
Documentation
[![Crates.io](https://img.shields.io/crates/v/hugging-face-client)](https://crates.io/crates/hugging-face-client)
[![Docs.rs](https://img.shields.io/docsrs/hugging-face-client)](https://docs.rs/hugging-face-client)
[![License](https://img.shields.io/github/license/dlzht/hugging-face-client.svg)](https://img.shields.io/github/license/用户名/仓库名.svg)

```toml
hugging-face-client = "0.2"
```

### Create Client

```rust
use std::time::Duration;
use hugging_face_client::client::{Client, ClientOption};

#[tokio::main(flavor = "current_thread")]
async fn main() {
  let access_token = std::env::var("HUGGING_FACE_TOKEN").unwrap();
  let access_proxy = std::env::var("HUGGING_FACE_PROXY").unwrap();
  let option = ClientOption::new(access_token)
    .proxy(access_proxy)
    .timeout(Duration::from_secs(5));
  let client = Client::new(option).unwrap();
}
```

### Get Model
```rust
use hugging_face_client::api::GetModelReq;
use hugging_face_client::client::{Client, ClientOption};

#[tokio::main(flavor = "current_thread")]
async fn main() {
  let option = ClientOption::new("HUGGING_FACE_TOKEN");
  let client = Client::new(option).unwrap();

  // get model
  let get_model_req = GetModelReq::new("microsoft/bitnet-b1.58-2B-4T");
  let res = client.get_model(get_model_req).await?;
  println!("{:#?}", res);
  Ok(())
}
// Model { _id: "67fddfa9a7fe1f21ec1d3026", id: "microsoft/bitnet-b1.58-2B-4T", model_id: None ... }
```

**More usage examples, can be seen [hugging-face-client/examples](https://github.com/dlzht/hugging-face-client/tree/main/examples)**