-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
101 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: weekly | ||
- package-ecosystem: "cargo" | ||
directory: "/" | ||
schedule: | ||
interval: weekly |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: ci | ||
|
||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
CARGO_TERM_COLOR: always | ||
CARGO_LOCA: "hfd-cli/Cargo.toml" | ||
CARGO_BIN: "hfd" | ||
|
||
permissions: | ||
contents: write | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- "main" | ||
paths: | ||
- "hfd-cli/Cargo.toml" | ||
- ".github/workflows/ci.yml" | ||
|
||
jobs: | ||
pre: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
cargo_loc: ${{ env.CARGO_LOCA }} | ||
cargo_bin: ${{ env.CARGO_BIN }} | ||
steps: | ||
- run: echo "Bypass GitHub Action Restriction" | ||
|
||
call: | ||
needs: | ||
- pre | ||
uses: AUTOM77/Rust-Actions/.github/workflows/ci.yml@main | ||
with: | ||
cargo_loc: ${{ needs.pre.outputs.cargo_loc }} | ||
cargo_bin: ${{ needs.pre.outputs.cargo_bin }} | ||
secrets: inherit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,7 @@ | ||
# Generated by Cargo | ||
# will have compiled files and executables | ||
.DS_Store | ||
.vscode/ | ||
debug/ | ||
target/ | ||
|
||
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries | ||
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html | ||
Cargo.lock | ||
|
||
# These are backup files generated by rustfmt | ||
**/*.rs.bk | ||
|
||
# MSVC Windows builds of rustc generate these, which store debugging information | ||
*.pdb | ||
*.pdb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[workspace] | ||
members = ["hfd-cli"] | ||
resolver = "2" | ||
|
||
[profile.release] | ||
lto = true | ||
strip = true | ||
panic = 'abort' | ||
opt-level = 3 | ||
codegen-units = 1 | ||
|
||
[profile.bench] | ||
lto = true | ||
codegen-units = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,14 @@ | ||
# hfd | ||
|
||
[](https://github.com/AUTOM77/hfd/actions) | ||
[](./LICENSE) | ||
[](https://github.com/AUTOM77/hfd/graphs/contributors) | ||
[](https://github.com/AUTOM77/hfd/commits) | ||
[](./hfd-cli/Cargo.toml#L4) | ||
[](https://github.com/AUTOM77/hfd/issues) | ||
[](.) | ||
[](https://github.com/AUTOM77/hfd/releases) | ||
[](https://github.com/AUTOM77/hfd/releases) | ||
|
||
|
||
🎈Rust-based interface for Huggingface 🤗 download |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[package] | ||
name = "hfd-cli" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
tokio = { version = "1.37.0", features = ["full"] } | ||
clap = { version= "4.5.4", features=["derive"] } | ||
hf-hub ={ version="0.3.2", features = ["tokio"]} | ||
|
||
[[bin]] | ||
name = "hfd" | ||
path = "src/cli.rs" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
use tokio; | ||
|
||
#[tokio::main] | ||
async fn main() { | ||
let api = hf_hub::api::tokio::Api::new().unwrap(); | ||
|
||
let _filename = api | ||
.model("meta-llama/Llama-2-7b-hf".to_string()) | ||
.get("model-00001-of-00002.safetensors") | ||
.await | ||
.unwrap(); | ||
} |