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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# π§ AI Dataset Studio - Complete Troubleshooting Guide
|
| 2 |
+
|
| 3 |
+
## π¨ **Immediate Fix for Current Error**
|
| 4 |
+
|
| 5 |
+
### **Error: "DatasetStudio is not defined"**
|
| 6 |
+
```
|
| 7 |
+
NameError: name 'DatasetStudio' is not defined
|
| 8 |
+
```
|
| 9 |
+
|
| 10 |
+
β
**SOLUTION:** Replace your current `app.py` with the **complete fixed version** I provided above.
|
| 11 |
+
|
| 12 |
+
**Quick Fix Steps:**
|
| 13 |
+
1. **Replace app.py** - Use the complete version from the artifacts above
|
| 14 |
+
2. **Add missing files** - Download all the files I've provided
|
| 15 |
+
3. **Restart your Space** - The error will be resolved
|
| 16 |
+
|
| 17 |
+
---
|
| 18 |
+
|
| 19 |
+
## π **Files You Need (Complete Checklist)**
|
| 20 |
+
|
| 21 |
+
| File | Status | Purpose |
|
| 22 |
+
|------|--------|---------|
|
| 23 |
+
| β
`app.py` | **Replace yours** | Main application (complete version) |
|
| 24 |
+
| β `app_minimal.py` | **Missing** | Fallback version (basic deps only) |
|
| 25 |
+
| β
`requirements.txt` | **Have it** | Dependencies |
|
| 26 |
+
| β
`README.md` | **Have it** | Documentation |
|
| 27 |
+
| β
`config.py` | **Have it** | Configuration |
|
| 28 |
+
| β `utils.py` | **Incomplete** | Utility functions |
|
| 29 |
+
| β `startup.py` | **Missing** | Smart launcher |
|
| 30 |
+
| β `TROUBLESHOOTING.md` | **Missing** | This guide |
|
| 31 |
+
|
| 32 |
+
---
|
| 33 |
+
|
| 34 |
+
## π **Quick Deployment Options**
|
| 35 |
+
|
| 36 |
+
### **Option 1: Immediate Fix (Recommended)**
|
| 37 |
+
```bash
|
| 38 |
+
# Use the complete app.py I provided above
|
| 39 |
+
# This fixes the DatasetStudio error immediately
|
| 40 |
+
```
|
| 41 |
+
|
| 42 |
+
### **Option 2: Minimal Version (Guaranteed to Work)**
|
| 43 |
+
```bash
|
| 44 |
+
# Use app_minimal.py as your main app.py
|
| 45 |
+
# This version works with basic dependencies only
|
| 46 |
+
```
|
| 47 |
+
|
| 48 |
+
### **Option 3: Smart Startup (Auto-Detect)**
|
| 49 |
+
```bash
|
| 50 |
+
# Use startup.py as your main app.py
|
| 51 |
+
# Automatically chooses the best version to run
|
| 52 |
+
```
|
| 53 |
+
|
| 54 |
+
---
|
| 55 |
+
|
| 56 |
+
## π **Common Issues & Solutions**
|
| 57 |
+
|
| 58 |
+
### **Issue 1: Missing Dependencies**
|
| 59 |
+
```
|
| 60 |
+
ModuleNotFoundError: No module named 'transformers'
|
| 61 |
+
ModuleNotFoundError: No module named 'bs4'
|
| 62 |
+
```
|
| 63 |
+
|
| 64 |
+
β
**SOLUTIONS:**
|
| 65 |
+
|
| 66 |
+
#### **A. Minimal Installation (Fastest)**
|
| 67 |
+
```bash
|
| 68 |
+
pip install gradio pandas requests beautifulsoup4
|
| 69 |
+
# Use app_minimal.py
|
| 70 |
+
```
|
| 71 |
+
|
| 72 |
+
#### **B. Full Installation**
|
| 73 |
+
```bash
|
| 74 |
+
pip install gradio pandas requests beautifulsoup4 transformers torch nltk datasets
|
| 75 |
+
# Use app.py (full version)
|
| 76 |
+
```
|
| 77 |
+
|
| 78 |
+
#### **C. Update requirements.txt**
|
| 79 |
+
```txt
|
| 80 |
+
gradio>=4.44.0
|
| 81 |
+
pandas>=2.0.0
|
| 82 |
+
requests>=2.31.0
|
| 83 |
+
beautifulsoup4>=4.12.0
|
| 84 |
+
```
|
| 85 |
+
|
| 86 |
+
---
|
| 87 |
+
|
| 88 |
+
### **Issue 2: Slow Loading**
|
| 89 |
+
```
|
| 90 |
+
Application taking too long to start
|
| 91 |
+
Models downloading...
|
| 92 |
+
```
|
| 93 |
+
|
| 94 |
+
β
**SOLUTIONS:**
|
| 95 |
+
- **Use CPU Basic hardware initially** (loads faster)
|
| 96 |
+
- **Try minimal version first** (no AI model downloads)
|
| 97 |
+
- **Upgrade to T4 Small** for faster AI model loading
|
| 98 |
+
|
| 99 |
+
---
|
| 100 |
+
|
| 101 |
+
### **Issue 3: Memory Issues**
|
| 102 |
+
```
|
| 103 |
+
CUDA out of memory
|
| 104 |
+
Application crashed
|
| 105 |
+
```
|
| 106 |
+
|
| 107 |
+
β
**SOLUTIONS:**
|
| 108 |
+
- **Start with CPU Basic** (free, lower memory)
|
| 109 |
+
- **Use minimal version** (smaller memory footprint)
|
| 110 |
+
- **Upgrade gradually** (CPU β T4 β A10G as needed)
|
| 111 |
+
|
| 112 |
+
---
|
| 113 |
+
|
| 114 |
+
### **Issue 4: Import Errors**
|
| 115 |
+
```
|
| 116 |
+
Failed to import DatasetStudio
|
| 117 |
+
Module not found errors
|
| 118 |
+
```
|
| 119 |
+
|
| 120 |
+
β
**SOLUTIONS:**
|
| 121 |
+
- **Replace app.py** with the complete version above
|
| 122 |
+
- **Add all missing files** from the artifacts
|
| 123 |
+
- **Clear browser cache** and refresh
|
| 124 |
+
|
| 125 |
+
---
|
| 126 |
+
|
| 127 |
+
## π₯ **Emergency Fixes**
|
| 128 |
+
|
| 129 |
+
### **Nuclear Option: Start Completely Fresh**
|
| 130 |
+
|
| 131 |
+
1. **Create new Space**
|
| 132 |
+
2. **Use minimal files only:**
|
| 133 |
+
```
|
| 134 |
+
- app_minimal.py (rename to app.py)
|
| 135 |
+
- requirements.txt (basic only)
|
| 136 |
+
- README.md
|
| 137 |
+
```
|
| 138 |
+
3. **Set hardware to CPU Basic**
|
| 139 |
+
4. **Test basic functionality first**
|
| 140 |
+
5. **Gradually add features**
|
| 141 |
+
|
| 142 |
+
### **Quick Test Commands**
|
| 143 |
+
```bash
|
| 144 |
+
# Test basic imports
|
| 145 |
+
python -c "import gradio, pandas, requests; print('β
Basic imports work')"
|
| 146 |
+
|
| 147 |
+
# Test BeautifulSoup
|
| 148 |
+
python -c "from bs4 import BeautifulSoup; print('β
BeautifulSoup works')"
|
| 149 |
+
|
| 150 |
+
# Test full app (if using complete version)
|
| 151 |
+
python -c "from app import DatasetStudio; print('β
DatasetStudio works')"
|
| 152 |
+
```
|
| 153 |
+
|
| 154 |
+
---
|
| 155 |
+
|
| 156 |
+
## π **Version Comparison**
|
| 157 |
+
|
| 158 |
+
| Feature | Minimal | Full | Smart |
|
| 159 |
+
|---------|---------|------|-------|
|
| 160 |
+
| **Dependencies** | 4 packages | 8+ packages | Auto-detect |
|
| 161 |
+
| **Startup Time** | 30 seconds | 2-5 minutes | Variable |
|
| 162 |
+
| **Web Scraping** | β
Basic | β
Advanced | β
Auto |
|
| 163 |
+
| **AI Features** | β None | β
All | β
If available |
|
| 164 |
+
| **Export Formats** | JSON, CSV | All formats | Auto |
|
| 165 |
+
| **Memory Usage** | ~100MB | ~2GB | Variable |
|
| 166 |
+
| **Reliability** | π’ High | π‘ Medium | π’ High |
|
| 167 |
+
|
| 168 |
+
---
|
| 169 |
+
|
| 170 |
+
## π― **Deployment Strategy**
|
| 171 |
+
|
| 172 |
+
### **Step 1: Start Simple**
|
| 173 |
+
```yaml
|
| 174 |
+
Files: app_minimal.py β app.py, requirements.txt (minimal)
|
| 175 |
+
Hardware: CPU Basic
|
| 176 |
+
Goal: Verify basic functionality
|
| 177 |
+
```
|
| 178 |
+
|
| 179 |
+
### **Step 2: Add Features**
|
| 180 |
+
```yaml
|
| 181 |
+
Files: Add complete app.py, config.py, utils.py
|
| 182 |
+
Hardware: CPU Upgrade
|
| 183 |
+
Goal: Test advanced features
|
| 184 |
+
```
|
| 185 |
+
|
| 186 |
+
### **Step 3: Full Power**
|
| 187 |
+
```yaml
|
| 188 |
+
Files: All files
|
| 189 |
+
Hardware: T4 Small or higher
|
| 190 |
+
Goal: Production deployment
|
| 191 |
+
```
|
| 192 |
+
|
| 193 |
+
---
|
| 194 |
+
|
| 195 |
+
## π **Troubleshooting Workflow**
|
| 196 |
+
|
| 197 |
+
```
|
| 198 |
+
1. π¨ ERROR OCCURS
|
| 199 |
+
β
|
| 200 |
+
2. π CHECK THIS GUIDE
|
| 201 |
+
β
|
| 202 |
+
3. π οΈ APPLY QUICK FIX
|
| 203 |
+
β
|
| 204 |
+
4. π§ͺ TEST SOLUTION
|
| 205 |
+
β
|
| 206 |
+
5. β
SUCCESS OR β¬οΈ ESCALATE
|
| 207 |
+
```
|
| 208 |
+
|
| 209 |
+
### **Escalation Path:**
|
| 210 |
+
1. **Try minimal version** β `app_minimal.py`
|
| 211 |
+
2. **Check dependencies** β Install missing packages
|
| 212 |
+
3. **Review logs** β Look for specific errors
|
| 213 |
+
4. **Contact support** β Provide error details
|
| 214 |
+
|
| 215 |
+
---
|
| 216 |
+
|
| 217 |
+
## π‘ **Pro Tips**
|
| 218 |
+
|
| 219 |
+
### **Development Best Practices**
|
| 220 |
+
- β
**Start minimal, add complexity gradually**
|
| 221 |
+
- β
**Test locally before deploying**
|
| 222 |
+
- β
**Use version control for file management**
|
| 223 |
+
- β
**Monitor Space logs for errors**
|
| 224 |
+
|
| 225 |
+
### **Performance Optimization**
|
| 226 |
+
- β
**CPU Basic for development/testing**
|
| 227 |
+
- β
**T4 Small for production**
|
| 228 |
+
- β
**Enable persistent storage for large datasets**
|
| 229 |
+
- β
**Use minimal version when possible**
|
| 230 |
+
|
| 231 |
+
### **Reliability Tips**
|
| 232 |
+
- β
**Always have a fallback version ready**
|
| 233 |
+
- β
**Test with sample URLs before large batches**
|
| 234 |
+
- β
**Monitor Space analytics for usage patterns**
|
| 235 |
+
- β
**Keep dependencies up to date**
|
| 236 |
+
|
| 237 |
+
---
|
| 238 |
+
|
| 239 |
+
## π **Getting Help**
|
| 240 |
+
|
| 241 |
+
### **Information to Include When Asking for Help:**
|
| 242 |
+
```
|
| 243 |
+
1. Exact error message
|
| 244 |
+
2. Files you're using (app.py vs app_minimal.py)
|
| 245 |
+
3. Hardware type (CPU Basic, T4 Small, etc.)
|
| 246 |
+
4. Dependencies installed
|
| 247 |
+
5. Space logs (if available)
|
| 248 |
+
```
|
| 249 |
+
|
| 250 |
+
### **Quick Health Check Script:**
|
| 251 |
+
```python
|
| 252 |
+
import sys
|
| 253 |
+
print(f"Python: {sys.version}")
|
| 254 |
+
|
| 255 |
+
try:
|
| 256 |
+
import gradio
|
| 257 |
+
print(f"β
Gradio: {gradio.__version__}")
|
| 258 |
+
except ImportError:
|
| 259 |
+
print("β Gradio not available")
|
| 260 |
+
|
| 261 |
+
try:
|
| 262 |
+
from bs4 import BeautifulSoup
|
| 263 |
+
print("β
BeautifulSoup available")
|
| 264 |
+
except ImportError:
|
| 265 |
+
print("β BeautifulSoup not available")
|
| 266 |
+
|
| 267 |
+
try:
|
| 268 |
+
from app import DatasetStudio
|
| 269 |
+
print("β
DatasetStudio available")
|
| 270 |
+
except ImportError as e:
|
| 271 |
+
print(f"β DatasetStudio error: {e}")
|
| 272 |
+
```
|
| 273 |
+
|
| 274 |
+
---
|
| 275 |
+
|
| 276 |
+
## π **Success Indicators**
|
| 277 |
+
|
| 278 |
+
You'll know everything is working when you see:
|
| 279 |
+
|
| 280 |
+
```
|
| 281 |
+
π Starting AI Dataset Studio...
|
| 282 |
+
π Features: β
AI Models | β
Advanced NLP | β
HuggingFace Integration
|
| 283 |
+
β
DatasetStudio initialized successfully
|
| 284 |
+
β
Interface created successfully
|
| 285 |
+
Running on local URL: http://0.0.0.0:7860
|
| 286 |
+
```
|
| 287 |
+
|
| 288 |
+
**If you see this, you're ready to create amazing datasets!** π―
|
| 289 |
+
|
| 290 |
+
---
|
| 291 |
+
|
| 292 |
+
## π **Support Channels**
|
| 293 |
+
|
| 294 |
+
- π **Documentation**: README.md in your Space
|
| 295 |
+
- π¬ **Community**: HuggingFace Discussions
|
| 296 |
+
- π **Bug Reports**: Include logs and error details
|
| 297 |
+
- π§ **Direct Help**: Describe your setup and error
|
| 298 |
+
|
| 299 |
+
**Remember: Every issue has a solution - start with the minimal version and build up!** πͺ
|