S-Rajesh commited on
Commit
5bf8f36
Β·
verified Β·
1 Parent(s): bfe9504

Upload TROUBLESHOOTING_QUICK_REFERENCE.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. TROUBLESHOOTING_QUICK_REFERENCE.md +146 -0
TROUBLESHOOTING_QUICK_REFERENCE.md ADDED
@@ -0,0 +1,146 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # TRIQA Hugging Face Demo - Quick Troubleshooting Reference
2
+
3
+ ## 🚨 Common Errors & Quick Fixes
4
+
5
+ ### 1. Short Description Too Long
6
+ **Error**: `"short_description" length must be less than or equal to 60 characters long`
7
+
8
+ **Quick Fix**:
9
+ ```yaml
10
+ # In README.md
11
+ short_description: TRIQA-IQA # 9 characters
12
+ ```
13
+
14
+ ### 2. Missing timm Module
15
+ **Error**: `ModuleNotFoundError: No module named 'timm'`
16
+
17
+ **Quick Fix**:
18
+ ```txt
19
+ # Add to requirements.txt
20
+ timm>=0.6.0
21
+ ```
22
+
23
+ ### 3. Model Files Not Found
24
+ **Error**: `FileNotFoundError: [Errno 2] No such file or directory: 'feature_models/...'`
25
+
26
+ **Quick Fix**:
27
+ 1. Download from Box: https://utexas.box.com/s/8aw6axc2lofouja65uc726lca8b1cduf
28
+ 2. Create directories: `feature_models/` and `Regression_Models/`
29
+ 3. Upload model files to correct locations
30
+
31
+ ### 4. Build Failures
32
+ **Error**: Various build errors
33
+
34
+ **Quick Fix**:
35
+ 1. Check space logs
36
+ 2. Verify all dependencies in requirements.txt
37
+ 3. Test locally: `python app.py`
38
+
39
+ ## πŸ“‹ Essential Files Checklist
40
+
41
+ ### Required Files:
42
+ - [ ] `app.py` - Main application
43
+ - [ ] `README.md` - Space description
44
+ - [ ] `requirements.txt` - Dependencies
45
+ - [ ] `package.json` - Node.js config
46
+ - [ ] `convnext_original.py` - Model architecture
47
+ - [ ] `convnext_finetune.py` - Model architecture
48
+ - [ ] `sample_image/` - Sample images
49
+
50
+ ### Model Files (Download from Box):
51
+ - [ ] `feature_models/convnext_tiny_22k_224.pth` (170MB)
52
+ - [ ] `feature_models/triqa_quality_aware.pth` (107MB)
53
+ - [ ] `Regression_Models/KonIQ_scaler.save`
54
+ - [ ] `Regression_Models/KonIQ_TRIQA.save` (111MB)
55
+
56
+ ## πŸ”§ Quick Commands
57
+
58
+ ### Upload Files:
59
+ ```bash
60
+ # Python CLI
61
+ python upload_to_space.py
62
+
63
+ # Git method
64
+ git clone https://huggingface.co/spaces/your-username/triqa-iqa
65
+ cd triqa-iqa
66
+ cp ../huggingface_demo/* .
67
+ git add . && git commit -m "Add TRIQA demo" && git push
68
+ ```
69
+
70
+ ### Test Locally:
71
+ ```bash
72
+ # Test file structure
73
+ python test_demo.py
74
+
75
+ # Test app
76
+ python app.py
77
+ ```
78
+
79
+ ### Update Single File:
80
+ ```bash
81
+ python -c "from huggingface_hub import HfApi; api = HfApi(); api.upload_file(path_or_fileobj='filename', path_in_repo='filename', repo_id='S-Rajesh/triqa-iqa', repo_type='space')"
82
+ ```
83
+
84
+ ## πŸ“Š Requirements.txt Template
85
+
86
+ ```txt
87
+ gradio>=4.0.0
88
+ torch>=1.8.0
89
+ torchvision>=0.9.0
90
+ timm>=0.6.0
91
+ pillow>=8.0.0
92
+ numpy>=1.19.0
93
+ scikit-learn>=0.24.0
94
+ ```
95
+
96
+ ## 🎯 README.md Metadata Template
97
+
98
+ ```yaml
99
+ ---
100
+ title: TRIQA Image Quality Assessment
101
+ emoji: πŸ–ΌοΈ
102
+ colorFrom: blue
103
+ colorTo: purple
104
+ sdk: gradio
105
+ sdk_version: 4.0.0
106
+ app_file: app.py
107
+ pinned: false
108
+ license: mit
109
+ short_description: TRIQA-IQA
110
+ ---
111
+ ```
112
+
113
+ ## πŸš€ Space URL Format
114
+
115
+ ```
116
+ https://huggingface.co/spaces/USERNAME/SPACE-NAME
117
+ ```
118
+
119
+ Example: `https://huggingface.co/spaces/S-Rajesh/triqa-iqa`
120
+
121
+ ## ⚑ Quick Debug Steps
122
+
123
+ 1. **Check build logs** in your space
124
+ 2. **Verify file paths** are correct
125
+ 3. **Test locally** before uploading
126
+ 4. **Check dependencies** in requirements.txt
127
+ 5. **Verify model files** are uploaded
128
+
129
+ ## πŸ“ž Quick Links
130
+
131
+ - **Space**: https://huggingface.co/spaces/S-Rajesh/triqa-iqa
132
+ - **Box Download**: https://utexas.box.com/s/8aw6axc2lofouja65uc726lca8b1cduf
133
+ - **GitHub**: https://github.com/rajeshsureddi/triqa
134
+ - **Paper**: https://arxiv.org/pdf/2507.12687
135
+
136
+ ## βœ… Success Indicators
137
+
138
+ - [ ] Space builds without errors
139
+ - [ ] Demo interface loads
140
+ - [ ] Sample images display
141
+ - [ ] Quality prediction works
142
+ - [ ] Paper links are accessible
143
+
144
+ ---
145
+
146
+ **Remember**: Most issues are solved by checking the build logs and ensuring all dependencies are properly listed in requirements.txt! 🎯