mirror of
https://github.com/thinking-machines-lab/tinker.git
synced 2026-04-19 12:58:01 +00:00
Fix issue with push-hf command
The push-hf command was not working and returning an error related to "checkpoint_complete".
This commit is contained in:
parent
f987653862
commit
432f985dff
1 changed files with 6 additions and 3 deletions
|
|
@ -519,10 +519,13 @@ def _export_checkpoint_to_hub(
|
||||||
f"Found {existing_tinker_path}, expected {tinker_path}.",
|
f"Found {existing_tinker_path}, expected {tinker_path}.",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Remove checkpoint_complete file before upload if no allow_patterns specified
|
||||||
|
# Workaround: huggingface_hub (which uses typer internally) conflicts with
|
||||||
|
# our Click-based CLI when "checkpoint_complete" is in ignore_patterns
|
||||||
if allow_patterns is None:
|
if allow_patterns is None:
|
||||||
ignore_patterns = list(ignore_patterns) if ignore_patterns else []
|
checkpoint_complete_file = extract_dir / "checkpoint_complete"
|
||||||
if "checkpoint_complete" not in ignore_patterns:
|
if checkpoint_complete_file.exists():
|
||||||
ignore_patterns.append("checkpoint_complete")
|
checkpoint_complete_file.unlink()
|
||||||
|
|
||||||
api.upload_folder(
|
api.upload_folder(
|
||||||
folder_path=os.fspath(extract_dir),
|
folder_path=os.fspath(extract_dir),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue