Run this model with HF Jobs

Run RDHub/pytorch_python_310 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs to fine-tune https://huggingface.co/RDHub/pytorch_python_310. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/RDHub/pytorch_python_310 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
pytorch_python_310 / upload_to_hf.py
SoyVitou's picture
Upload folder using huggingface_hub
68a60e6 verified
Raw History Blame Contribute Delete
1.7 kB
#!/usr/bin/env python3
"""
Upload PyTorch wheel collection to HuggingFace
Usage: HF_TOKEN=your_token python upload_to_hf.py
"""
import os
from huggingface_hub import HfApi
def upload_to_huggingface():
# Get token from environment variable
token = os.getenv("HF_TOKEN")
if not token:
print("❌ Error: HF_TOKEN environment variable not set")
print("Usage: HF_TOKEN=your_token python upload_to_hf.py")
return False
# Set up API with token
api = HfApi(token=token)
# Repository details
repo_id = "RDHub/pytorch_python_310"
folder_path = "/media/acleda/DATA/code/ai-engineer/khmer-nlp/pytorch_python_310"
print(f"Uploading folder: {folder_path}")
print(f"To repository: {repo_id}")
print("This may take a while due to large file sizes...")
try:
# Upload the entire folder
api.upload_folder(
folder_path=folder_path,
repo_id=repo_id,
repo_type="model",
)
print("✅ Upload completed successfully!")
print(f"Repository available at: https://huggingface.co/{repo_id}")
except Exception as e:
print(f"❌ Upload failed: {e}")
return False
return True
if __name__ == "__main__":
success = upload_to_huggingface()
if success:
print("\n🎉 PyTorch wheel collection is now available on HuggingFace!")
print("Users can now install with:")
print("git clone https://huggingface.co/RDHub/pytorch_python_310")
print("cd pytorch_python_310 && pip install lib_wheel/*.whl")
else:
print("\n❌ Upload failed. Please check the error messages above.")