mirror of
https://github.com/ml-explore/mlx-examples.git
synced 2025-08-29 12:26:07 +08:00
use upload_large_file instead of deprecated multi comit
This commit is contained in:
parent
82e31968a2
commit
18f380b177
@ -655,7 +655,7 @@ def upload_to_hub(path: str, upload_repo: str, hf_path: str):
|
|||||||
|
|
||||||
model, tokenizer = load("{upload_repo}")
|
model, tokenizer = load("{upload_repo}")
|
||||||
|
|
||||||
prompt="hello"
|
prompt = "hello"
|
||||||
|
|
||||||
if tokenizer.chat_template is not None:
|
if tokenizer.chat_template is not None:
|
||||||
messages = [{{"role": "user", "content": prompt}}]
|
messages = [{{"role": "user", "content": prompt}}]
|
||||||
@ -673,12 +673,10 @@ def upload_to_hub(path: str, upload_repo: str, hf_path: str):
|
|||||||
|
|
||||||
api = HfApi()
|
api = HfApi()
|
||||||
api.create_repo(repo_id=upload_repo, exist_ok=True)
|
api.create_repo(repo_id=upload_repo, exist_ok=True)
|
||||||
api.upload_folder(
|
api.upload_large_folder(
|
||||||
folder_path=path,
|
folder_path=path,
|
||||||
repo_id=upload_repo,
|
repo_id=upload_repo,
|
||||||
repo_type="model",
|
repo_type="model",
|
||||||
multi_commits=True,
|
|
||||||
multi_commits_verbose=True,
|
|
||||||
)
|
)
|
||||||
print(f"Upload successful, go to https://huggingface.co/{upload_repo} for details.")
|
print(f"Upload successful, go to https://huggingface.co/{upload_repo} for details.")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user