# 🚀 HuggingFace पर Dwrko-M1.0 Upload करना **Complete Step-by-Step Guide** - हिंदी में समझाया गया! ## 📋 Pre-Requirements (पहले से चाहिए) 1. **HuggingFace Account** - [huggingface.co](https://huggingface.co) पर account बनाएं 2. **Trained Model** - आपका `dwrko-m1.0` model ready हो 3. **HuggingFace Token** - Access token generate करें --- ## 🔑 Step 1: HuggingFace Token बनाना ### 1.1 HuggingFace पर Login करें ``` https://huggingface.co/login ``` ### 1.2 Token Generate करें 1. Profile → Settings → Access Tokens पर जाएं 2. "New token" पर click करें 3. Token name: `Dwrko-M1.0-Upload` 4. Type: **Write** select करें 5. "Generate" पर click करें 6. Token को copy करके safe रखें ⚠️ --- ## 🛠️ Step 2: Dependencies Install करना ### Virtual Environment बनाएं (Recommended): ```bash # Virtual environment बनाएं python3 -m venv dwrko_env # Activate करें source dwrko_env/bin/activate # Linux/Mac # या dwrko_env\Scripts\activate # Windows # Dependencies install करें pip install huggingface_hub transformers peft torch ``` ### System-wide Install (Alternative): ```bash pip install --user huggingface_hub transformers peft torch ``` --- ## 🚀 Step 3: Model Upload करना ### Method 1: Automated Script (आसान तरीका) ```bash # Upload script run करें python upload_to_hf.py \ --model_path ./dwrko-m1.0 \ --username YOUR_USERNAME \ --repo_name Dwrko-M1.0 # Example: python upload_to_hf.py \ --model_path ./dwrko-m1.0 \ --username rajat123 \ --repo_name Dwrko-M1.0 ``` ### Method 2: Manual Commands ```bash # 1. Login करें huggingface-cli login # Token paste करें जब पूछे # 2. Repository create करें huggingface-cli repo create Dwrko-M1.0 --type model # 3. Model upload करें huggingface-cli upload Dwrko-M1.0/ ./dwrko-m1.0 --repo-type model ``` ### Method 3: Python Script से ```python from huggingface_hub import HfApi, login # Login करें login(token="YOUR_TOKEN_HERE") # Upload करें api = HfApi() api.upload_folder( folder_path="./dwrko-m1.0", repo_id="your-username/Dwrko-M1.0", repo_type="model" ) ``` --- ## 📁 Step 4: Model Files Check करना Upload करने से पहले ये files होनी चाहिए: ``` dwrko-m1.0/ ├── adapter_config.json ✅ LoRA configuration ├── adapter_model.safetensors ✅ Trained weights ├── tokenizer_config.json ✅ Tokenizer settings ├── special_tokens_map.json ✅ Special tokens ├── model_info.json ✅ Model information └── README.md ✅ Model card (auto-created) ``` ### Files Check करने के लिए: ```bash ls -la ./dwrko-m1.0/ ``` --- ## 🎯 Step 5: Upload Process ### Complete Upload Command: ```bash python upload_to_hf.py \ --model_path ./dwrko-m1.0 \ --username YOUR_USERNAME \ --repo_name Dwrko-M1.0 \ --token YOUR_TOKEN ``` ### Upload होने के बाद: ``` 🚀 Uploading Dwrko-M1.0 to HuggingFace Hub... ✅ Repository created/updated: https://huggingface.co/YOUR_USERNAME/Dwrko-M1.0 ✅ Model card created 🎉 Successfully uploaded Dwrko-M1.0 to HuggingFace! 🔗 Model URL: https://huggingface.co/YOUR_USERNAME/Dwrko-M1.0 ``` --- ## 🔧 Troubleshooting (समस्या समाधान) ### ❌ "externally-managed-environment" Error ```bash # Solution 1: Virtual environment use करें python3 -m venv dwrko_env source dwrko_env/bin/activate pip install huggingface_hub # Solution 2: User install pip install --user huggingface_hub # Solution 3: System packages (Ubuntu/Debian) sudo apt install python3-huggingface-hub ``` ### ❌ "Authentication Error" ```bash # Token re-generate करें # Profile → Settings → Access Tokens # Old token delete करके new बनाएं # Login फिर से करें huggingface-cli login ``` ### ❌ "Repository already exists" ```bash # Force update करें python upload_to_hf.py \ --model_path ./dwrko-m1.0 \ --username YOUR_USERNAME \ --repo_name Dwrko-M1.0-v2 # नया नाम दें ``` ### ❌ "Large file upload failed" ```bash # Git LFS enable करें git lfs install # बड़ी files के लिए: huggingface-cli lfs-enable-largefiles ./dwrko-m1.0 ``` --- ## 📊 Post-Upload Checklist Upload के बाद ये check करें: ### ✅ Model Page पर जाकर: 1. **Model Card** properly display हो रहा है 2. **Files** सभी upload हुई हैं 3. **Usage Examples** काम कर रहे हैं 4. **Tags** properly set हैं ### ✅ Test करें: ```python from transformers import pipeline # Your uploaded model test करें generator = pipeline( "text-generation", model="YOUR_USERNAME/Dwrko-M1.0", tokenizer="mistralai/Mistral-7B-v0.1" ) response = generator("### Instruction:\nWrite a hello world program\n\n### Response:\n") print(response[0]['generated_text']) ``` --- ## 🌟 Advanced Options ### Private Repository बनाना: ```bash python upload_to_hf.py \ --model_path ./dwrko-m1.0 \ --username YOUR_USERNAME \ --repo_name Dwrko-M1.0 \ --private ``` ### Custom Model Card: ```bash # अपना README.md बनाएं echo "# My Custom Dwrko-M1.0" > ./dwrko-m1.0/README.md # Upload करें python upload_to_hf.py --model_path ./dwrko-m1.0 --username YOUR_USERNAME ``` ### Multiple Versions: ```bash # Version tags के साथ python upload_to_hf.py \ --model_path ./dwrko-m1.0 \ --username YOUR_USERNAME \ --repo_name Dwrko-M1.0-v1.1 ``` --- ## 🎉 Success! अब आपका Model Live है! ### Model URL: ``` https://huggingface.co/YOUR_USERNAME/Dwrko-M1.0 ``` ### Share करें: - Social media पर post करें - Community में share करें - Documentation में link add करें - README में badge लगाएं ### Badge Example: ```markdown [![HuggingFace](https://img.shields.io/badge/🤗%20HuggingFace-Dwrko--M1.0-blue)](https://huggingface.co/YOUR_USERNAME/Dwrko-M1.0) ``` --- ## 💡 Pro Tips 1. **Model Name**: Descriptive और unique रखें 2. **Tags**: Relevant tags add करें (`coding`, `reasoning`, `mistral`) 3. **Documentation**: Complete usage examples दें 4. **Version Control**: Regular updates करते रहें 5. **Community**: Feedback के लिए discussions enable करें --- **🚀 Congratulations! आपका Dwrko-M1.0 अब HuggingFace पर live है!** 🎉