-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add upload * fix: argument passing * fix: PUT to s3 requires Content-Length header * docs: add contributing docs * refacto: use `FromPyObject` trait for conversion * docs: add quality dependency to hugginface_hub cli * refacto: remove lfs / huggingface_hub specific code * fix: clippy warnings * fix: PR comments * feat: defer completion call to caller * feat: remove reqwest `json` feature * feat: change API to `Vec` instead of custom obj
- Loading branch information
Showing
4 changed files
with
237 additions
and
14 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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,42 @@ | ||
# HF Transfer | ||
|
||
Speed up file transfers with the Hub. | ||
|
||
Supports download and upload. | ||
|
||
## Contributing | ||
|
||
```sh | ||
python3 -m venv ~/.venv/hf_transfer | ||
source ~/.venv/hf_transfer/bin/activate | ||
pip install maturin | ||
maturin develop | ||
``` | ||
|
||
### `huggingface_hub` | ||
|
||
If you are working on changes with `huggingface_hub` | ||
|
||
```sh | ||
git clone git@github.com:huggingface/huggingface_hub.git | ||
# git clone https://github.com/huggingface/huggingface_hub.git | ||
|
||
cd huggingface_hub | ||
python3 -m pip install -e ".[quality]" | ||
``` | ||
|
||
You can use the following test script: | ||
|
||
```py | ||
import os | ||
|
||
# os.environ["HF_ENDPOINT"] = "http://localhost:5564" | ||
os.environ["HF_HUB_ENABLE_HF_TRANSFER"] = "1" | ||
|
||
from huggingface_hub import HfApi, logging | ||
|
||
logging.set_verbosity_debug() | ||
hf = HfApi() | ||
hf.upload_file(path_or_fileobj="/path/to/my/repo/some_file", path_in_repo="some_file", repo_id="my/repo", repo_type="model") | ||
``` | ||
|
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