hugging-face-jobs
Skill này làm gì
Công cụ này cho phép bạn chạy các tác vụ lập trình (script Python) trên máy tính đám mây mạnh mẽ mà không cần cài đặt gì trên máy của bạn. Nó có thể dùng các tài nguyên như GPU để làm việc nhanh hơn.
Khi nào nên dùng
- ✓Khi bạn cần chạy một script Python đòi hỏi nhiều sức mạnh tính toán.
- ✓Khi muốn xử lý khối lượng dữ liệu lớn mà không làm quá tải máy của bạn.
- ✓Khi muốn chạy các tác vụ lặp lại hoặc theo lịch trên đám mây.
Liên kết skill
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/hugging-face-jobs/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Chạy script Python của tôi để huấn luyện mô hình học máy này bằng GPU.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Bạn gửi code Python của mình, và công cụ thực thi nó trên các máy chủ từ xa. Công cụ lo toàn bộ phần thiết lập và có thể dùng phần cứng chuyên dụng như GPU để tăng tốc.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Running Workloads on Hugging Face Jobs
Detailed Guide
Read the detailed guide before executing this skill. It retains the complete procedure and reference material. Treat its safety, prerequisites, and validation requirements as mandatory. For focused work, load the relevant sections; for end-to-end work, read the guide completely.
When to Use This Skill
Use this skill when users want to:
- Run Python workloads on cloud infrastructure
- Execute jobs without local GPU/TPU setup
- Process data at scale
- Run batch inference or experiments
- Schedule recurring tasks
- Use GPUs/TPUs for any workload
- Persist results to the Hugging Face Hub
Prerequisites Checklist
Before starting any job, verify:
✅ Account & Authentication
- Hugging Face Account with Pro, Team, or Enterprise plan (Jobs require paid plan)
- Authenticated login: Check with
hf_whoami() - HF_TOKEN for Hub Access ⚠️ CRITICAL - Required for any Hub operations (push models/datasets, download private repos, etc.)
- Token must have appropriate permissions (read for downloads, write for uploads)
✅ Token Usage (See Token Usage section for details)
When tokens are required:
- Pushing models/datasets to Hub
- Accessing private repositories
- Using Hub APIs in scripts
- Any authenticated Hub operations
How to provide tokens:
# hf_jobs MCP tool — $HF_TOKEN is auto-replaced with real token:
{"secrets": {"HF_TOKEN": "$HF_TOKEN"}}
# HfApi().run_uv_job() — MUST pass actual token:
from huggingface_hub import get_token
secrets={"HF_TOKEN": get_token()}
⚠️ CRITICAL: The $HF_TOKEN placeholder is ONLY auto-replaced by the hf_jobs MCP tool. When using HfApi().run_uv_job(), you MUST pass the real token via get_token(). Passing the literal string "$HF_TOKEN" results in a 9-character invalid token and 401 errors.
Token Usage Guide
Understanding Tokens
What are HF Tokens?
- Authentication credentials for Hugging Face Hub
- Required for authenticated operations (push, private repos, API access)
- Stored securely on your machine after
hf auth login
Token Types:
- Read Token - Can download models/datasets, read private repos
- Write Token - Can push models/datasets, create repos, modify content
- Organization Token - Can act on behalf of an organization
When Tokens Are Required
Always Required:
- Pushing models/datasets to Hub
- Accessing private repositories
- Creating new repositories
- Modifying existing repositories
- Using Hub APIs programmatically
Not Required:
- Downloading public models/datasets
- Running jobs that don't interact with Hub
- Reading public repository information
How to Provide Tokens to Jobs
Method 1: Automatic Token (Recommended)
hf_jobs("uv", {
"script": "your_script.py",
"secrets": {"HF_TOKEN": "$HF_TOKEN"} # ✅ Automatic replacement
})
How it works:
$HF_TOKENis a placeholder that gets replaced with your actual token- Uses the token from your logged-in session (
hf auth login) - Most secure and convenient method
- Token is encrypted server-side when passed as a secret
Benefits:
- No token exposure in code
- Uses your current login session
- Automatically updated if you re-login
- Works seamlessly with MCP tools
Method 2: Explicit Token (Not Recommended)
hf_jobs("uv", {
"script": "your_script.py",
"secrets": {"HF_TOKEN": "hf_abc123..."} # ⚠️ Hardcoded token
})
When to use:
- Only if automatic token doesn't work
- Testing with a specific token
- Organization tokens (use with caution)
Security concerns:
- Token visible in code/logs
- Must manually update if token rotates
- Risk of token exposure
Method 3: Environment Variable (Less Secure)
hf_jobs("uv", {
"script": "your_script.py",
"env": {"HF_TOKEN": "hf_abc123..."} # ⚠️ Less secure than secrets
})
Difference from secrets:
envvariables are visible in job logssecretsare encrypted server-side- Always prefer
secretsfor tokens
Using Tokens in Scripts
In your Python script, tokens are available as environment variables:
# /// script
# dependencies = ["huggingface-hub"]
# ///
import os
from huggingface_hub import HfApi
# Token is automatically available if passed via secrets
token = os.environ.get("HF_TOKEN")
…
Câu hỏi thường gặp
Tôi có phải trả tiền để dùng không?
Có, công cụ này yêu cầu gói Hugging Face trả phí (Pro, Team hoặc Enterprise) để hoạt động.
“Token” là gì và tại sao tôi cần chúng?
Token giống như mật khẩu bí mật chứng minh bạn là ai với Hugging Face. Chúng cần để truy cập dữ liệu của bạn hoặc gửi kết quả trở lại nền tảng.
Script biết dùng token nào?
Cách an toàn nhất là dùng code đặc biệt tự động lấy token từ tài khoản đã đăng nhập của bạn. Tránh viết trực tiếp token vào code.
Chi tiết
Mô tả gốc của tác giả
Run workloads on Hugging Face Jobs with managed CPUs, GPUs, TPUs, secrets, and Hub persistence.
Độ phổ biến
- Sao GitHub
- 48k
- Vị trí xếp hạng
- #4838
- Giấy phép
- MIT
- Cập nhật
- 15/10/2026
Bình luận
- …
Thêm skill từ kho mã này
00-andruia-consultant
48kGiúp agent của bạn bắt đầu hoặc cải thiện các dự án AI. Phân tích mã, gợi ý công cụ và lập kế hoạch hành động bằng tiếng Tây Ban Nha.
007
48kCho phép agent của bạn thực hiện kiểm toán bảo mật và mô hình hóa mối đe dọa. Hữu ích để bảo vệ dự án khỏi các cuộc tấn công và lỗ hổng.
10-andruia-skill-smith
48kGiúp agent của bạn tạo hoặc cải thiện các công cụ AI. Xác định cách công cụ hoạt động, viết tài liệu và kiểm tra cấu trúc.
20-andruia-niche-intelligence
48kGiúp agent của bạn tạo bản tóm tắt về một ngành cụ thể. Hữu ích để hiểu bối cảnh, quy tắc, cách người dùng tương tác và rủi ro của dự án.
Skill tương tự
add-model-provider
394kGiúp agent của bạn kết nối nhà cung cấp mô hình AI mới với OpenClaw bằng lệnh an toàn, giữ API key khỏi văn bản thuần và chạy thử.
acp-router
394kGiúp agent của bạn gửi một tác vụ đến trợ lý lập trình như Claude Code hoặc Cursor qua OpenClaw, để công việc chạy ngay trong công cụ đó.
browser-automation
394kHướng dẫn agent của bạn điều khiển trang web từng bước, gồm đăng nhập, tab và cách khôi phục khi trang ngừng phản hồi.