mirror of
https://github.com/thinking-machines-lab/tinker.git
synced 2026-04-19 12:58:01 +00:00
use revision for experiment runs and HF_TOKEN doc
This commit is contained in:
parent
054abb5d4e
commit
3e75e63d40
2 changed files with 13 additions and 7 deletions
|
|
@ -313,10 +313,13 @@ model card, and upload to the Hugging Face Hub.
|
|||
Args:
|
||||
- `tinker_path`: The tinker path to the checkpoint (e.g., "tinker://run-id/weights/0001")
|
||||
- `repo_id`: Hugging Face repo ID (e.g., "username/my-lora-adapter"). If None,
|
||||
a name is derived from the base model and checkpoint path.
|
||||
a name is derived from the base model and training run, and `revision` is
|
||||
derived from the checkpoint id.
|
||||
- `private`: Whether to create the repo as private (default True)
|
||||
- `token`: Hugging Face access token (optional)
|
||||
- `revision`: Target branch/revision to upload to (optional)
|
||||
- `token`: Hugging Face access token (optional). If None, uses the token
|
||||
from `hf auth login` or the `HF_TOKEN` env var if available.
|
||||
- `revision`: Target branch/revision to upload to (optional). If None and
|
||||
repo_id is None, defaults to a name derived from the checkpoint id.
|
||||
- `commit_message`: Commit message for the upload (optional)
|
||||
- `create_pr`: Whether to create a PR instead of pushing to the main branch
|
||||
- `exist_ok`: Whether repo creation should succeed if repo exists
|
||||
|
|
|
|||
|
|
@ -425,8 +425,10 @@ class RestClient(TelemetryProvider):
|
|||
- `repo_id`: Hugging Face repo ID (e.g., "username/my-lora-adapter"). If None,
|
||||
a name is derived from the base model and checkpoint path.
|
||||
- `private`: Whether to create the repo as private (default False)
|
||||
- `token`: Hugging Face access token (optional)
|
||||
- `revision`: Target branch/revision to upload to (optional)
|
||||
- `token`: Hugging Face access token (optional). If None, uses the token
|
||||
from `hf auth login` or the `HF_TOKEN` env var if available.
|
||||
- `revision`: Target branch/revision to upload to (optional). If None and
|
||||
repo_id is None, defaults to a name derived from the checkpoint id.
|
||||
- `commit_message`: Commit message for the upload (optional)
|
||||
- `create_pr`: Whether to create a PR instead of pushing to the main branch
|
||||
- `exist_ok`: Whether repo creation should succeed if repo exists
|
||||
|
|
@ -535,9 +537,10 @@ class RestClient(TelemetryProvider):
|
|||
|
||||
if repo_id is None:
|
||||
base_short = base_model.split("/")[-1] if base_model != "unknown" else "adapter"
|
||||
checkpoint_id = parsed_tinker_path.checkpoint_id.replace("/", "-")
|
||||
derived = f"tinker-{base_short}-{parsed_tinker_path.training_run_id}-{checkpoint_id}"
|
||||
derived = f"tinker-{base_short}-{parsed_tinker_path.training_run_id}"
|
||||
repo_id = _sanitize_repo_name(derived)
|
||||
if revision is None:
|
||||
revision = _sanitize_repo_name(parsed_tinker_path.checkpoint_id.replace("/", "-"))
|
||||
|
||||
# Add a lightweight model card if missing
|
||||
readme_path = extract_dir / "README.md"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue