davanstrien HF Staff commited on
Commit
755bfd4
·
verified ·
1 Parent(s): 8cba5fe

Sync from GitHub via hub-sync

Browse files
Files changed (3) hide show
  1. README.md +4 -4
  2. generate-responses.py +11 -2
  3. vlm-classify.py +11 -3
README.md CHANGED
@@ -53,8 +53,8 @@ uv run vlm-classify.py \
53
 
54
  ```bash
55
  hf jobs uv run \
56
- --flavor a10g \
57
- --image vllm/vllm-openai \
58
  -s HF_TOKEN \
59
  https://huggingface.co/datasets/uv-scripts/vllm/raw/main/vlm-classify.py \
60
  username/input-dataset \
@@ -102,7 +102,7 @@ uv run classify-dataset.py \
102
  ```bash
103
  hf jobs uv run \
104
  --flavor l4x1 \
105
- --image vllm/vllm-openai \
106
  https://huggingface.co/datasets/uv-scripts/vllm/resolve/main/classify-dataset.py \
107
  davanstrien/ModernBERT-base-is-new-arxiv-dataset \
108
  username/input-dataset \
@@ -160,7 +160,7 @@ uv run generate-responses.py \
160
  ```bash
161
  hf jobs uv run \
162
  --flavor l4x4 \
163
- --image vllm/vllm-openai \
164
  -e UV_PRERELEASE=if-necessary \
165
  -s HF_TOKEN \
166
  https://huggingface.co/datasets/uv-scripts/vllm/raw/main/generate-responses.py \
 
53
 
54
  ```bash
55
  hf jobs uv run \
56
+ --flavor l40sx1 \
57
+ --image vllm/vllm-openai:v0.32.0 \
58
  -s HF_TOKEN \
59
  https://huggingface.co/datasets/uv-scripts/vllm/raw/main/vlm-classify.py \
60
  username/input-dataset \
 
102
  ```bash
103
  hf jobs uv run \
104
  --flavor l4x1 \
105
+ --image vllm/vllm-openai:v0.32.0 \
106
  https://huggingface.co/datasets/uv-scripts/vllm/resolve/main/classify-dataset.py \
107
  davanstrien/ModernBERT-base-is-new-arxiv-dataset \
108
  username/input-dataset \
 
160
  ```bash
161
  hf jobs uv run \
162
  --flavor l4x4 \
163
+ --image vllm/vllm-openai:v0.32.0 \
164
  -e UV_PRERELEASE=if-necessary \
165
  -s HF_TOKEN \
166
  https://huggingface.co/datasets/uv-scripts/vllm/raw/main/generate-responses.py \
generate-responses.py CHANGED
@@ -10,6 +10,13 @@
10
  # "vllm>=0.11.0",
11
  # ]
12
  #
 
 
 
 
 
 
 
13
  # ///
14
  """
15
  Generate responses for prompts in a dataset using vLLM for efficient GPU inference.
@@ -35,7 +42,8 @@ Example usage:
35
  --max-tokens 2048
36
 
37
  # HF Jobs execution (see script output for full command)
38
- hf jobs uv run --flavor a100x4 ...
 
39
  """
40
 
41
  import argparse
@@ -573,12 +581,13 @@ This script requires arguments. For usage information:
573
  Example HF Jobs command with multi-GPU:
574
  # If you're logged in with huggingface-cli, token will be auto-detected
575
  hf jobs uv run \\
576
- --flavor l4x4 \\
577
  https://huggingface.co/datasets/uv-scripts/vllm/raw/main/generate-responses.py \\
578
  username/input-dataset \\
579
  username/output-dataset \\
580
  --messages-column messages \\
581
  --model-id Qwen/Qwen3-30B-A3B-Instruct-2507 \\
 
582
  --temperature 0.7 \\
583
  --max-tokens 16384
584
  """)
 
10
  # "vllm>=0.11.0",
11
  # ]
12
  #
13
+ # [tool.hf-jobs]
14
+ # image = "vllm/vllm-openai:v0.32.0"
15
+ # python = "/usr/bin/python3"
16
+ # env = { PYTHONPATH = "/usr/local/lib/python3.12/dist-packages" }
17
+ # flavor = "a100-large"
18
+ # secrets = ["HF_TOKEN"]
19
+ # timeout = "2h"
20
  # ///
21
  """
22
  Generate responses for prompts in a dataset using vLLM for efficient GPU inference.
 
42
  --max-tokens 2048
43
 
44
  # HF Jobs execution (see script output for full command)
45
+ # The header sets a100-large. The default model needs --max-model-len there.
46
+ hf jobs uv run generate-responses.py input output --max-model-len 32768
47
  """
48
 
49
  import argparse
 
581
  Example HF Jobs command with multi-GPU:
582
  # If you're logged in with huggingface-cli, token will be auto-detected
583
  hf jobs uv run \\
584
+ --flavor a100-large \\
585
  https://huggingface.co/datasets/uv-scripts/vllm/raw/main/generate-responses.py \\
586
  username/input-dataset \\
587
  username/output-dataset \\
588
  --messages-column messages \\
589
  --model-id Qwen/Qwen3-30B-A3B-Instruct-2507 \\
590
+ --max-model-len 32768 \\
591
  --temperature 0.7 \\
592
  --max-tokens 16384
593
  """)
vlm-classify.py CHANGED
@@ -10,6 +10,14 @@
10
  # "transformers",
11
  # "vllm>=0.11.0", # StructuredOutputsParams API (guided_decoding removed in 0.12.0)
12
  # ]
 
 
 
 
 
 
 
 
13
  # ///
14
 
15
  """
@@ -139,7 +147,7 @@ def main(
139
  if not torch.cuda.is_available():
140
  logger.error("CUDA is not available. This script requires a GPU.")
141
  logger.error("If running locally, ensure you have a CUDA-capable GPU.")
142
- logger.error("For cloud execution, use: hf jobs uv run --flavor a10g ...")
143
  sys.exit(1)
144
 
145
  # Parse classes
@@ -310,7 +318,7 @@ Examples:
310
 
311
  # HF Jobs execution
312
  hf jobs uv run \\
313
- --flavor a10g \\
314
  https://huggingface.co/datasets/uv-scripts/vllm/raw/main/vlm-classify.py \\
315
  username/input-dataset \\
316
  username/output-dataset \\
@@ -408,7 +416,7 @@ Examples:
408
  print("=" * 60)
409
  print("""
410
  hf jobs uv run \\
411
- --flavor a10g \\
412
  -e HF_TOKEN=$(python3 -c "from huggingface_hub import get_token; print(get_token())") \\
413
  https://huggingface.co/datasets/uv-scripts/vllm/raw/main/vlm-classify.py \\
414
  davanstrien/sloane-index-cards \\
 
10
  # "transformers",
11
  # "vllm>=0.11.0", # StructuredOutputsParams API (guided_decoding removed in 0.12.0)
12
  # ]
13
+ #
14
+ # [tool.hf-jobs]
15
+ # image = "vllm/vllm-openai:v0.32.0"
16
+ # python = "/usr/bin/python3"
17
+ # env = { PYTHONPATH = "/usr/local/lib/python3.12/dist-packages" }
18
+ # flavor = "l40sx1"
19
+ # secrets = ["HF_TOKEN"]
20
+ # timeout = "1h"
21
  # ///
22
 
23
  """
 
147
  if not torch.cuda.is_available():
148
  logger.error("CUDA is not available. This script requires a GPU.")
149
  logger.error("If running locally, ensure you have a CUDA-capable GPU.")
150
+ logger.error("For cloud execution, use: hf jobs uv run --flavor l40sx1 ...")
151
  sys.exit(1)
152
 
153
  # Parse classes
 
318
 
319
  # HF Jobs execution
320
  hf jobs uv run \\
321
+ --flavor l40sx1 \\
322
  https://huggingface.co/datasets/uv-scripts/vllm/raw/main/vlm-classify.py \\
323
  username/input-dataset \\
324
  username/output-dataset \\
 
416
  print("=" * 60)
417
  print("""
418
  hf jobs uv run \\
419
+ --flavor l40sx1 \\
420
  -e HF_TOKEN=$(python3 -c "from huggingface_hub import get_token; print(get_token())") \\
421
  https://huggingface.co/datasets/uv-scripts/vllm/raw/main/vlm-classify.py \\
422
  davanstrien/sloane-index-cards \\