Spaces:
Running
Running
Update hf_merge.py
Browse files- hf_merge.py +6 -5
hf_merge.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
import os
|
2 |
import shutil
|
3 |
import argparse
|
4 |
import requests
|
@@ -62,9 +62,10 @@ class ModelMerger:
|
|
62 |
save_tensor_map(self.tensor_map, output_dir)
|
63 |
|
64 |
def upload_model(self, output_dir, repo_name, commit_message):
|
65 |
-
repo = Repository(
|
66 |
-
repo.
|
67 |
-
repo.
|
|
|
68 |
print(f"Model uploaded to {repo_name}")
|
69 |
|
70 |
def get_max_vocab_size(repo_list):
|
@@ -128,4 +129,4 @@ def main():
|
|
128 |
model_merger.upload_model(output_dir, args.repo, args.commit_message)
|
129 |
|
130 |
if __name__ == "__main__":
|
131 |
-
main()
|
|
|
1 |
+
\import os
|
2 |
import shutil
|
3 |
import argparse
|
4 |
import requests
|
|
|
62 |
save_tensor_map(self.tensor_map, output_dir)
|
63 |
|
64 |
def upload_model(self, output_dir, repo_name, commit_message):
|
65 |
+
repo = Repository(local_dir=output_dir, clone_from=repo_name, use_auth_token=self.token)
|
66 |
+
repo.git_add(auto_lfs_track=True)
|
67 |
+
repo.git_commit(commit_message)
|
68 |
+
repo.git_push()
|
69 |
print(f"Model uploaded to {repo_name}")
|
70 |
|
71 |
def get_max_vocab_size(repo_list):
|
|
|
129 |
model_merger.upload_model(output_dir, args.repo, args.commit_message)
|
130 |
|
131 |
if __name__ == "__main__":
|
132 |
+
main()
|