fix lib
Browse files- check_log.py +29 -0
- config.yaml +10 -0
- requirements.txt +2 -7
- train_hugg.py +33 -0
check_log.py
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# from huggingface_hub import HfApi
|
| 2 |
+
|
| 3 |
+
# def main():
|
| 4 |
+
# api = HfApi()
|
| 5 |
+
# namespace = "uav-vts"
|
| 6 |
+
# job_id = "68c7eab1b8ca6fa7e35cf89b"
|
| 7 |
+
|
| 8 |
+
# print(f"🔍 Fetching logs for job {namespace}/{job_id} ...\n")
|
| 9 |
+
# for log in api.fetch_job_logs(namespace=namespace, job_id=job_id):
|
| 10 |
+
# print(log)
|
| 11 |
+
|
| 12 |
+
# if __name__ == "__main__":
|
| 13 |
+
# main()
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
from huggingface_hub import HfApi
|
| 17 |
+
|
| 18 |
+
def main():
|
| 19 |
+
api = HfApi()
|
| 20 |
+
namespace = "uav-vts"
|
| 21 |
+
job_id = "68c7eab1b8ca6fa7e35cf89b"
|
| 22 |
+
|
| 23 |
+
job_info = api.inspect_job(job_id=job_id, namespace=namespace)
|
| 24 |
+
print("Job status:", job_info.status.stage)
|
| 25 |
+
print("Message:", job_info.status.message)
|
| 26 |
+
print("Full JobInfo:", job_info)
|
| 27 |
+
|
| 28 |
+
if __name__ == "__main__":
|
| 29 |
+
main()
|
config.yaml
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: training-sem
|
| 2 |
+
image: pytorch/pytorch:2.6.0-cuda12.4-cudnn9-devel
|
| 3 |
+
tasks:
|
| 4 |
+
- id: train
|
| 5 |
+
commands:
|
| 6 |
+
- pip install -r requirements.txt
|
| 7 |
+
- python runner/train.py
|
| 8 |
+
resources:
|
| 9 |
+
gpu: A100
|
| 10 |
+
repository: uav-vts/training_sem
|
requirements.txt
CHANGED
|
@@ -52,21 +52,16 @@ openmim==0.3.9
|
|
| 52 |
openxlab==0.1.2
|
| 53 |
ordered-set==4.1.0
|
| 54 |
oss2==2.17.0
|
| 55 |
-
packaging==
|
| 56 |
pandas==2.0.2
|
| 57 |
Pillow==10.0.0
|
| 58 |
platformdirs==4.4.0
|
| 59 |
polygon==1.1.0
|
| 60 |
Polygon3==3.0.9.1
|
| 61 |
pycocotools==2.0.10
|
| 62 |
-
pycryptodome==3.23.0
|
| 63 |
-
Pygments==2.19.2
|
| 64 |
-
PyGObject==3.42.1
|
| 65 |
-
PyJWT==2.3.0
|
| 66 |
pyparsing==3.2.3
|
| 67 |
-
python-apt==2.4.0+ubuntu4
|
| 68 |
python-dateutil==2.9.0.post0
|
| 69 |
-
pytz==
|
| 70 |
PyYAML==6.0.2
|
| 71 |
requests==2.28.2
|
| 72 |
rich==13.4.2
|
|
|
|
| 52 |
openxlab==0.1.2
|
| 53 |
ordered-set==4.1.0
|
| 54 |
oss2==2.17.0
|
| 55 |
+
packaging==25.0
|
| 56 |
pandas==2.0.2
|
| 57 |
Pillow==10.0.0
|
| 58 |
platformdirs==4.4.0
|
| 59 |
polygon==1.1.0
|
| 60 |
Polygon3==3.0.9.1
|
| 61 |
pycocotools==2.0.10
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
pyparsing==3.2.3
|
|
|
|
| 63 |
python-dateutil==2.9.0.post0
|
| 64 |
+
pytz==2025.2
|
| 65 |
PyYAML==6.0.2
|
| 66 |
requests==2.28.2
|
| 67 |
rich==13.4.2
|
train_hugg.py
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# from huggingface_hub import HfApi
|
| 2 |
+
|
| 3 |
+
# api = HfApi()
|
| 4 |
+
|
| 5 |
+
# job = api.create_job(
|
| 6 |
+
# repo_id="uav-vts/training_sem",
|
| 7 |
+
# docker_image="pytorch/pytorch:2.6.0-cuda12.4-cudnn9-devel",
|
| 8 |
+
# command="python runner/train.py",
|
| 9 |
+
# hardware="a100",
|
| 10 |
+
# # token="<TOKEN>"
|
| 11 |
+
# )
|
| 12 |
+
|
| 13 |
+
# print("Job created:", job.job_id)
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
from huggingface_hub import run_job
|
| 17 |
+
|
| 18 |
+
image = "pytorch/pytorch:2.6.0-cuda12.4-cudnn9-devel"
|
| 19 |
+
command = [
|
| 20 |
+
"python",
|
| 21 |
+
"-c",
|
| 22 |
+
"import torch; print(f'This code ran with the following GPU: {torch.cuda.get_device_name()}')"
|
| 23 |
+
]
|
| 24 |
+
|
| 25 |
+
job = run_job(
|
| 26 |
+
image=image,
|
| 27 |
+
command=command,
|
| 28 |
+
flavor="a100-large", # hoặc "a100-large" nếu cần GPU mạnh hơn
|
| 29 |
+
namespace="uav-vts", # để job thuộc account của bạn
|
| 30 |
+
)
|
| 31 |
+
|
| 32 |
+
print("Job submitted!")
|
| 33 |
+
print("Track it here:", job.url)
|