Commit
·
ee342e6
1
Parent(s):
a942e46
Switch to pure UV approach without Docker image
Browse files- Use simple 'pip install unsloth' instead of git install
- Remove Docker image from HF Jobs examples
- Cleaner, more reproducible UV script
- UV handles all dependencies from script header
- iconclass-vlm-sft.py +3 -4
- submit_training_job.py +2 -5
iconclass-vlm-sft.py
CHANGED
|
@@ -1,9 +1,9 @@
|
|
| 1 |
# /// script
|
| 2 |
# requires-python = ">=3.11"
|
| 3 |
# dependencies = [
|
|
|
|
| 4 |
# "datasets",
|
| 5 |
# "transformers==4.57.0",
|
| 6 |
-
# "unsloth[colab-new] @ git+https://github.com/unslothai/unsloth.git",
|
| 7 |
# "trl==0.22.2",
|
| 8 |
# "huggingface-hub[hf_transfer]",
|
| 9 |
# "pillow",
|
|
@@ -455,10 +455,9 @@ if __name__ == "__main__":
|
|
| 455 |
print(" --output-model your-username/iconclass-vlm-test \\")
|
| 456 |
print(" --max-steps 100")
|
| 457 |
print("\n4. Running on HF Jobs:")
|
| 458 |
-
print("
|
| 459 |
print(" --flavor a100-large \\")
|
| 460 |
-
print("
|
| 461 |
-
print(" -e HF_TOKEN=$HF_TOKEN \\")
|
| 462 |
print(
|
| 463 |
" https://huggingface.co/datasets/uv-scripts/training/raw/main/iconclass-vlm-sft.py \\"
|
| 464 |
)
|
|
|
|
| 1 |
# /// script
|
| 2 |
# requires-python = ">=3.11"
|
| 3 |
# dependencies = [
|
| 4 |
+
# "unsloth",
|
| 5 |
# "datasets",
|
| 6 |
# "transformers==4.57.0",
|
|
|
|
| 7 |
# "trl==0.22.2",
|
| 8 |
# "huggingface-hub[hf_transfer]",
|
| 9 |
# "pillow",
|
|
|
|
| 455 |
print(" --output-model your-username/iconclass-vlm-test \\")
|
| 456 |
print(" --max-steps 100")
|
| 457 |
print("\n4. Running on HF Jobs:")
|
| 458 |
+
print(" hf jobs uv run \\")
|
| 459 |
print(" --flavor a100-large \\")
|
| 460 |
+
print(" -s HF_TOKEN=$HF_TOKEN \\")
|
|
|
|
| 461 |
print(
|
| 462 |
" https://huggingface.co/datasets/uv-scripts/training/raw/main/iconclass-vlm-sft.py \\"
|
| 463 |
)
|
submit_training_job.py
CHANGED
|
@@ -37,7 +37,6 @@ LORA_DROPOUT = 0.1
|
|
| 37 |
# Training infrastructure
|
| 38 |
GPU_FLAVOR = "a100-large" # Options: a100-large, a100, a10g-large
|
| 39 |
TIMEOUT = "12h" # Adjust based on dataset size
|
| 40 |
-
DOCKER_IMAGE = "unsloth/unsloth:latest" # Pre-configured Unsloth environment
|
| 41 |
|
| 42 |
# Script location
|
| 43 |
SCRIPT_URL = "https://huggingface.co/datasets/uv-scripts/training/raw/main/iconclass-vlm-sft.py"
|
|
@@ -125,17 +124,15 @@ def submit_training_job():
|
|
| 125 |
print(f" Dropout: {LORA_DROPOUT}")
|
| 126 |
print(f"\n💻 Infrastructure:")
|
| 127 |
print(f" GPU: {GPU_FLAVOR}")
|
| 128 |
-
print(f" Docker Image: {DOCKER_IMAGE}")
|
| 129 |
print(f" Timeout: {TIMEOUT}")
|
| 130 |
print(f"\n🚀 Submitting job...")
|
| 131 |
|
| 132 |
-
# Submit the job using run_uv_job
|
| 133 |
job = api.run_uv_job(
|
| 134 |
script=SCRIPT_URL, # Can also be a local path
|
| 135 |
script_args=script_args,
|
| 136 |
-
dependencies=[], #
|
| 137 |
flavor=GPU_FLAVOR,
|
| 138 |
-
image=DOCKER_IMAGE, # Use Unsloth's pre-configured Docker image
|
| 139 |
timeout=TIMEOUT,
|
| 140 |
env={
|
| 141 |
"HF_HUB_ENABLE_HF_TRANSFER": "1", # Fast downloads
|
|
|
|
| 37 |
# Training infrastructure
|
| 38 |
GPU_FLAVOR = "a100-large" # Options: a100-large, a100, a10g-large
|
| 39 |
TIMEOUT = "12h" # Adjust based on dataset size
|
|
|
|
| 40 |
|
| 41 |
# Script location
|
| 42 |
SCRIPT_URL = "https://huggingface.co/datasets/uv-scripts/training/raw/main/iconclass-vlm-sft.py"
|
|
|
|
| 124 |
print(f" Dropout: {LORA_DROPOUT}")
|
| 125 |
print(f"\n💻 Infrastructure:")
|
| 126 |
print(f" GPU: {GPU_FLAVOR}")
|
|
|
|
| 127 |
print(f" Timeout: {TIMEOUT}")
|
| 128 |
print(f"\n🚀 Submitting job...")
|
| 129 |
|
| 130 |
+
# Submit the job using run_uv_job
|
| 131 |
job = api.run_uv_job(
|
| 132 |
script=SCRIPT_URL, # Can also be a local path
|
| 133 |
script_args=script_args,
|
| 134 |
+
dependencies=[], # UV handles all dependencies from script header
|
| 135 |
flavor=GPU_FLAVOR,
|
|
|
|
| 136 |
timeout=TIMEOUT,
|
| 137 |
env={
|
| 138 |
"HF_HUB_ENABLE_HF_TRANSFER": "1", # Fast downloads
|