MagicMeWizard commited on
Commit
1d9e7b0
Β·
verified Β·
1 Parent(s): 7e60a42

Create TROUBLESHOOTING.md

Browse files
Files changed (1) hide show
  1. TROUBLESHOOTING.md +299 -0
TROUBLESHOOTING.md ADDED
@@ -0,0 +1,299 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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!** πŸ’ͺ