-
Notifications
You must be signed in to change notification settings - Fork 574
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for git-based dataset repos (#14)
* Export more constants * unrelated change= do not gobble certain kinds of requests.ConnectionError * datasets: file_download cc @lhoestq * Exposing this as a constant * Implement hf_api for datasets + Split constants into their own file * integration test + CLI
- Loading branch information
Showing
9 changed files
with
181 additions
and
44 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
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
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,32 @@ | ||
import os | ||
|
||
|
||
# Constants for file downloads | ||
|
||
PYTORCH_WEIGHTS_NAME = "pytorch_model.bin" | ||
TF2_WEIGHTS_NAME = "tf_model.h5" | ||
TF_WEIGHTS_NAME = "model.ckpt" | ||
FLAX_WEIGHTS_NAME = "flax_model.msgpack" | ||
CONFIG_NAME = "config.json" | ||
|
||
HUGGINGFACE_CO_URL_HOME = "https://huggingface.co/" | ||
|
||
HUGGINGFACE_CO_URL_TEMPLATE = ( | ||
"https://huggingface.co/{repo_id}/resolve/{revision}/{filename}" | ||
) | ||
|
||
REPO_TYPE_DATASET = "dataset" | ||
REPO_TYPES = [None, REPO_TYPE_DATASET] | ||
|
||
REPO_TYPE_DATASET_URL_PREFIX = "datasets/" | ||
|
||
|
||
# default cache | ||
hf_cache_home = os.path.expanduser( | ||
os.getenv( | ||
"HF_HOME", os.path.join(os.getenv("XDG_CACHE_HOME", "~/.cache"), "huggingface") | ||
) | ||
) | ||
default_cache_path = os.path.join(hf_cache_home, "hub") | ||
|
||
HUGGINGFACE_HUB_CACHE = os.getenv("HUGGINGFACE_HUB_CACHE", default_cache_path) |
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
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
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