kevinlu4588
commited on
Commit
·
c371153
1
Parent(s):
9985d49
Adding upload script
Browse files- .gitignore +1 -0
- Pipfile +1 -0
- Pipfile.lock +41 -9
- models/ESD-X/esd-picasso_from_picasso-xattn_1-epochs_200.pt +0 -3
- upload.py +55 -0
.gitignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
.env
|
Pipfile
CHANGED
|
@@ -11,6 +11,7 @@ numpy = "*"
|
|
| 11 |
transformers = "*"
|
| 12 |
torch = "*"
|
| 13 |
diffusers = "*"
|
|
|
|
| 14 |
|
| 15 |
[dev-packages]
|
| 16 |
|
|
|
|
| 11 |
transformers = "*"
|
| 12 |
torch = "*"
|
| 13 |
diffusers = "*"
|
| 14 |
+
peft = "*"
|
| 15 |
|
| 16 |
[dev-packages]
|
| 17 |
|
Pipfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
{
|
| 2 |
"_meta": {
|
| 3 |
"hash": {
|
| 4 |
-
"sha256": "
|
| 5 |
},
|
| 6 |
"pipfile-spec": 6,
|
| 7 |
"requires": {
|
|
@@ -17,6 +17,14 @@
|
|
| 17 |
]
|
| 18 |
},
|
| 19 |
"default": {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
"certifi": {
|
| 21 |
"hashes": [
|
| 22 |
"sha256:922820b53db7a7257ffbda3f597266d435245903d80737e34f8a45ff3e3230d8",
|
|
@@ -392,6 +400,15 @@
|
|
| 392 |
"markers": "python_version >= '3.9'",
|
| 393 |
"version": "==2.2.3"
|
| 394 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 395 |
"pillow": {
|
| 396 |
"hashes": [
|
| 397 |
"sha256:00177a63030d612148e659b55ba99527803288cea7c75fb05766ab7981a8c1b7",
|
|
@@ -474,6 +491,29 @@
|
|
| 474 |
"markers": "python_version >= '3.9'",
|
| 475 |
"version": "==11.0.0"
|
| 476 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 477 |
"python-dateutil": {
|
| 478 |
"hashes": [
|
| 479 |
"sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3",
|
|
@@ -773,14 +813,6 @@
|
|
| 773 |
"markers": "python_version >= '3.7'",
|
| 774 |
"version": "==0.4.5"
|
| 775 |
},
|
| 776 |
-
"setuptools": {
|
| 777 |
-
"hashes": [
|
| 778 |
-
"sha256:753bb6ebf1f465a1912e19ed1d41f403a79173a9acf66a42e7e6aec45c3c16ec",
|
| 779 |
-
"sha256:a7fcb66f68b4d9e8e66b42f9876150a3371558f98fa32222ffaa5bced76406f8"
|
| 780 |
-
],
|
| 781 |
-
"markers": "python_version >= '3.12'",
|
| 782 |
-
"version": "==75.2.0"
|
| 783 |
-
},
|
| 784 |
"six": {
|
| 785 |
"hashes": [
|
| 786 |
"sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926",
|
|
|
|
| 1 |
{
|
| 2 |
"_meta": {
|
| 3 |
"hash": {
|
| 4 |
+
"sha256": "c4efec9481152ce6f9599932fcd2ea1a68f264c46a099862473a4cbc56ae87ab"
|
| 5 |
},
|
| 6 |
"pipfile-spec": 6,
|
| 7 |
"requires": {
|
|
|
|
| 17 |
]
|
| 18 |
},
|
| 19 |
"default": {
|
| 20 |
+
"accelerate": {
|
| 21 |
+
"hashes": [
|
| 22 |
+
"sha256:c6aa0c7b8a797cb150471e90e3ca36ac41f5d4b40512cdd6f058b8bf25589467",
|
| 23 |
+
"sha256:e8f95fc2db14915dc0a9182edfcf3068e5ddb2fa310b583717ad44e5c442399c"
|
| 24 |
+
],
|
| 25 |
+
"markers": "python_full_version >= '3.8.0'",
|
| 26 |
+
"version": "==1.0.1"
|
| 27 |
+
},
|
| 28 |
"certifi": {
|
| 29 |
"hashes": [
|
| 30 |
"sha256:922820b53db7a7257ffbda3f597266d435245903d80737e34f8a45ff3e3230d8",
|
|
|
|
| 400 |
"markers": "python_version >= '3.9'",
|
| 401 |
"version": "==2.2.3"
|
| 402 |
},
|
| 403 |
+
"peft": {
|
| 404 |
+
"hashes": [
|
| 405 |
+
"sha256:0e0cbd40ebdf5fe4ea79f255880d02f96712d18899509369a2cc5768ad46d672",
|
| 406 |
+
"sha256:d4e0951ec78eac11c45a051801c569913436888c578d48e5ce86996b715bc6ef"
|
| 407 |
+
],
|
| 408 |
+
"index": "pypi",
|
| 409 |
+
"markers": "python_full_version >= '3.8.0'",
|
| 410 |
+
"version": "==0.13.2"
|
| 411 |
+
},
|
| 412 |
"pillow": {
|
| 413 |
"hashes": [
|
| 414 |
"sha256:00177a63030d612148e659b55ba99527803288cea7c75fb05766ab7981a8c1b7",
|
|
|
|
| 491 |
"markers": "python_version >= '3.9'",
|
| 492 |
"version": "==11.0.0"
|
| 493 |
},
|
| 494 |
+
"psutil": {
|
| 495 |
+
"hashes": [
|
| 496 |
+
"sha256:000d1d1ebd634b4efb383f4034437384e44a6d455260aaee2eca1e9c1b55f047",
|
| 497 |
+
"sha256:045f00a43c737f960d273a83973b2511430d61f283a44c96bf13a6e829ba8fdc",
|
| 498 |
+
"sha256:0895b8414afafc526712c498bd9de2b063deaac4021a3b3c34566283464aff8e",
|
| 499 |
+
"sha256:1209036fbd0421afde505a4879dee3b2fd7b1e14fee81c0069807adcbbcca747",
|
| 500 |
+
"sha256:1ad45a1f5d0b608253b11508f80940985d1d0c8f6111b5cb637533a0e6ddc13e",
|
| 501 |
+
"sha256:353815f59a7f64cdaca1c0307ee13558a0512f6db064e92fe833784f08539c7a",
|
| 502 |
+
"sha256:498c6979f9c6637ebc3a73b3f87f9eb1ec24e1ce53a7c5173b8508981614a90b",
|
| 503 |
+
"sha256:5cd2bcdc75b452ba2e10f0e8ecc0b57b827dd5d7aaffbc6821b2a9a242823a76",
|
| 504 |
+
"sha256:6d3fbbc8d23fcdcb500d2c9f94e07b1342df8ed71b948a2649b5cb060a7c94ca",
|
| 505 |
+
"sha256:6e2dcd475ce8b80522e51d923d10c7871e45f20918e027ab682f94f1c6351688",
|
| 506 |
+
"sha256:9118f27452b70bb1d9ab3198c1f626c2499384935aaf55388211ad982611407e",
|
| 507 |
+
"sha256:9dcbfce5d89f1d1f2546a2090f4fcf87c7f669d1d90aacb7d7582addece9fb38",
|
| 508 |
+
"sha256:a8506f6119cff7015678e2bce904a4da21025cc70ad283a53b099e7620061d85",
|
| 509 |
+
"sha256:a8fb3752b491d246034fa4d279ff076501588ce8cbcdbb62c32fd7a377d996be",
|
| 510 |
+
"sha256:c0e0c00aa18ca2d3b2b991643b799a15fc8f0563d2ebb6040f64ce8dc027b942",
|
| 511 |
+
"sha256:d905186d647b16755a800e7263d43df08b790d709d575105d419f8b6ef65423a",
|
| 512 |
+
"sha256:ff34df86226c0227c52f38b919213157588a678d049688eded74c76c8ba4a5d0"
|
| 513 |
+
],
|
| 514 |
+
"markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5'",
|
| 515 |
+
"version": "==6.1.0"
|
| 516 |
+
},
|
| 517 |
"python-dateutil": {
|
| 518 |
"hashes": [
|
| 519 |
"sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3",
|
|
|
|
| 813 |
"markers": "python_version >= '3.7'",
|
| 814 |
"version": "==0.4.5"
|
| 815 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 816 |
"six": {
|
| 817 |
"hashes": [
|
| 818 |
"sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926",
|
models/ESD-X/esd-picasso_from_picasso-xattn_1-epochs_200.pt
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:f52f71a02de7c24b6191ec4385a6a5b08a7b2177458a7998dfffed28a6b49f50
|
| 3 |
-
size 175883766
|
|
|
|
|
|
|
|
|
|
|
|
upload.py
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from huggingface_hub import HfApi, HfFolder, hf_hub_upload
|
| 2 |
+
import os
|
| 3 |
+
import subprocess
|
| 4 |
+
|
| 5 |
+
hf_access_token = os.getenv("HUGGINGFACE_API_KEY")
|
| 6 |
+
HfFolder.save_token(hf_access_token)
|
| 7 |
+
|
| 8 |
+
MODEL_PATH = '/raid/aag/scasper/models/'
|
| 9 |
+
|
| 10 |
+
def run_cleanup():
|
| 11 |
+
try:
|
| 12 |
+
subprocess.run(["python", "clean_folder.py"], check=True)
|
| 13 |
+
print("Cleanup completed successfully.")
|
| 14 |
+
except subprocess.CalledProcessError as e:
|
| 15 |
+
print(f"Error running cleanup script: {e}")
|
| 16 |
+
except FileNotFoundError:
|
| 17 |
+
print("clean_folder.py not found in the current directory.")
|
| 18 |
+
|
| 19 |
+
def is_repo_empty(repo_id):
|
| 20 |
+
api = HfApi()
|
| 21 |
+
try:
|
| 22 |
+
files = api.list_repo_files(repo_id)
|
| 23 |
+
return len(files) <= 2
|
| 24 |
+
except Exception as e:
|
| 25 |
+
print(f"An error occurred: {e}")
|
| 26 |
+
return True
|
| 27 |
+
|
| 28 |
+
def upload_pt_file(subdir, model_name, ckpt):
|
| 29 |
+
file_path = f"{MODEL_PATH}{subdir}/{model_name}{ckpt}.pt"
|
| 30 |
+
repo_id = f"LLM-GAT/{model_name}{ckpt}"
|
| 31 |
+
if is_repo_empty(repo_id):
|
| 32 |
+
hf_hub_upload(repo_id=repo_id, path_or_fileobj=file_path, token=hf_access_token)
|
| 33 |
+
print(f"Uploaded {file_path} to {repo_id}")
|
| 34 |
+
else:
|
| 35 |
+
print(f"Repository {repo_id} is not empty. Skipping upload.")
|
| 36 |
+
|
| 37 |
+
subdirs = ['gd']
|
| 38 |
+
model_names = ['llama3_gd_lora-256-128_beta-14_bs-32_lr-1e-04_checkpoint-']
|
| 39 |
+
ckpts = list(range(1, 9))
|
| 40 |
+
|
| 41 |
+
def main():
|
| 42 |
+
missing_models = []
|
| 43 |
+
for subdir, model in zip(subdirs, model_names):
|
| 44 |
+
for ckpt in ckpts:
|
| 45 |
+
file_path = f"{MODEL_PATH}{subdir}/{model}{ckpt}.pt"
|
| 46 |
+
if os.path.isfile(file_path):
|
| 47 |
+
print(f"Uploading {file_path}...")
|
| 48 |
+
upload_pt_file(subdir, model, ckpt)
|
| 49 |
+
else:
|
| 50 |
+
missing_models.append(file_path)
|
| 51 |
+
run_cleanup()
|
| 52 |
+
print('MISSING MODELS:', missing_models)
|
| 53 |
+
|
| 54 |
+
if __name__ == "__main__":
|
| 55 |
+
main()
|