#!/usr/bin/env python3 """ Hugging Face upload script for Isaac Sim model """ import os import json import subprocess from pathlib import Path def create_model_card(): """Create a comprehensive model card for Hugging Face""" model_card = """--- language: - en - code license: mit model_creator: Isaac Sim Development Team model_name: Isaac Sim Qwen2.5 Coder 7B model_type: qwen2 pipeline_tag: text-generation prompt_template: | <|im_start|>system You are an expert in Isaac Sim 5.0, Isaac Lab 2.1, and Omniverse Kit 107.3 robotics development. You help users with: - Isaac Sim simulation setup and configuration - Isaac Lab Jupyter notebook workflows - Omniverse Kit extension development - Robot and sensor integration - USD (Universal Scene Description) workflows - Python robotics programming - Synthetic data generation for training Always provide accurate, up-to-date information and code examples. <|im_end|> <|im_start|>user {prompt} <|im_end|> <|im_start|>assistant {response} <|im_end|> quantized_by: bitsandbytes tags: - isaac-sim - robotics - omniverse - code-generation - synthetic-data - qwen2 --- # Isaac Sim Qwen2.5 Coder 7B A specialized version of Qwen2.5-Coder-7B-Instruct fine-tuned for Isaac Sim 5.0, Isaac Lab 2.1, and Omniverse Kit 107.3 development. ## Model Description This model is specifically trained to assist with: - Isaac Sim robotics simulation development - Isaac Lab Jupyter notebook workflows - Omniverse Kit extension development - Robot and sensor integration - USD (Universal Scene Description) workflows - Python robotics programming - Synthetic data generation for training ## Training Data The model was fine-tuned on a comprehensive dataset of: - Isaac Sim 5.0 documentation and examples - Isaac Lab 2.1 tutorials and workflows - Omniverse Kit 107.3 extension development - Robotics simulation scenarios - USD workflow examples - Python robotics code samples ## Usage The model supports the Qwen2 chat template format and can be used for: - Code generation and completion - Technical documentation - Robotics simulation guidance - Extension development assistance - Troubleshooting and debugging ## Quantization This repository provides multiple quantization levels: - **Full Precision (f16):** Highest quality, requires ~14GB VRAM - **8-bit Quantized (q8_0):** Good balance, requires ~7GB VRAM - **4-bit Quantized (q4_0):** Memory efficient, requires ~4GB VRAM ## Hardware Requirements - **Minimum:** 4GB VRAM (4-bit quantized) - **Recommended:** 8GB VRAM (8-bit quantized) - **Optimal:** 16GB+ VRAM (full precision) ## License This model is based on Qwen2.5-Coder-7B-Instruct and follows the same license terms. """ return model_card def create_repo_structure(): """Create the repository structure for Hugging Face""" # Create directories hf_dir = "huggingface_repo" if os.path.exists(hf_dir): shutil.rmtree(hf_dir) os.makedirs(hf_dir) os.makedirs(os.path.join(hf_dir, "gguf")) # Copy GGUF files gguf_files = [ "isaac_sim_qwen2.5_coder.gguf", "isaac_sim_qwen2.5_coder_q8_0.gguf", "isaac_sim_qwen2.5_coder_q4_0.gguf" ] for file in gguf_files: src = os.path.join(".", file) dst = os.path.join(hf_dir, "gguf", file) if os.path.exists(src): shutil.copy2(src, dst) print(f"✅ Copied vocab.json") # Create model card model_card = create_model_card() with open(os.path.join(hf_dir, "README.md"), "w") as f: f.write(model_card) # Create .gitattributes gitattributes = """*.gguf filter=lfs diff=lfs merge=lfs -text *.safetensors filter=lfs diff=lfs merge=lfs -text *.bin filter=lfs diff=lfs merge=lfs -text *.json text *.md text *.py text """ with open(os.path.join(hf_dir, ".gitattributes"), "w") as f: f.write(gitattributes) # Create requirements.txt requirements = """llama-cpp-python>=0.2.0 transformers>=4.52.0 torch>=2.0.0 """ with open(os.path.join(hf_dir, "requirements.txt"), "w") as f: f.write(requirements) print(f"✅ Hugging Face repository structure created successfully") return True def main(): """Main function""" print("🚀 Creating Hugging Face repository structure...") create_repo_structure() print(f" 📁 Repository created successfully!") print(" 📋 Next steps:") print("1. Review the repository structure") print("2. Initialize git repository") print("3. Push to Hugging Face") print(" 💡 Commands:") print("cd huggingface_repo") print("git init") print("git add .") print("git commit -m 'Initial commit: Isaac Sim Qwen2.5 Coder model'") print("git remote add origin https://huggingface.co/YOUR_USERNAME/isaac-sim-qwen2.5-coder") print("git push -u origin main") if __name__ == "__main__": main()