milwright commited on
Commit
db9c40d
Β·
1 Parent(s): 777f0c6

update troubleshooting section with nested accordions

Browse files
Files changed (1) hide show
  1. support_docs.py +81 -21
support_docs.py CHANGED
@@ -237,31 +237,91 @@ def create_support_docs():
237
  gr.Markdown("""
238
  ### Common Issues and Solutions
239
 
240
- **Build Errors**
241
- - Check requirements.txt compatibility
242
- - Ensure Gradio version β‰₯ 5.39.0
243
- - Verify all dependencies are available
244
 
245
- **API Errors**
246
- - Verify API_KEY is set correctly
247
- - Check API key starts with 'sk-or-'
248
- - Ensure you have API credits
 
 
 
 
 
 
 
 
249
 
250
- **Access Issues**
251
- - ACCESS_CODE must match exactly
252
- - Check for extra spaces in password
253
- - Verify secret is properly saved
 
 
 
 
 
 
 
 
 
254
 
255
- **Preview Not Working**
256
- - Set API_KEY in local environment
257
- - Check browser console for errors
258
- - Ensure configuration is saved
 
 
 
 
 
 
 
 
 
259
 
260
- **Configuration Status Shows Red X:**
261
- - Verify API key secret name matches configuration
262
- - Check OpenRouter account has credits
263
- - Regenerate API key if needed
264
- """)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
265
 
266
  with gr.Accordion("πŸ“š Additional Resources", open=False):
267
  gr.Markdown("""
 
237
  gr.Markdown("""
238
  ### Common Issues and Solutions
239
 
240
+ Find solutions to common problems organized by category.
241
+ """)
 
 
242
 
243
+ with gr.Accordion("Build Errors", open=False):
244
+ gr.Markdown("""
245
+ **Requirements Compatibility**
246
+ - Ensure Gradio version β‰₯ 5.39.0 in requirements.txt
247
+ - Check all dependencies are spelled correctly
248
+ - Verify version numbers are compatible
249
+
250
+ **Common Build Failures**
251
+ - Missing dependencies: Add to requirements.txt
252
+ - Import errors: Check module names and casing
253
+ - Syntax errors: Review app.py for Python syntax issues
254
+ """)
255
 
256
+ with gr.Accordion("API Errors", open=False):
257
+ gr.Markdown("""
258
+ **API Key Issues**
259
+ - Verify API_KEY is set in HuggingFace Secrets
260
+ - Ensure key starts with 'sk-or-' for OpenRouter
261
+ - Check for extra spaces or quotes in the secret value
262
+
263
+ **API Response Errors**
264
+ - 401 Unauthorized: Invalid API key
265
+ - 402 Payment Required: No API credits remaining
266
+ - 429 Rate Limited: Too many requests, wait and retry
267
+ - 500 Server Error: OpenRouter service issue
268
+ """)
269
 
270
+ with gr.Accordion("Access Control Issues", open=False):
271
+ gr.Markdown("""
272
+ **ACCESS_CODE Problems**
273
+ - Code must match exactly (case-sensitive)
274
+ - Don't include quotes around the password
275
+ - Check for trailing spaces in the secret
276
+ - To disable: Delete the ACCESS_CODE secret entirely
277
+
278
+ **Authentication Flow**
279
+ - Users enter code on first visit
280
+ - Code is stored in browser session
281
+ - Clear cookies to re-prompt for code
282
+ """)
283
 
284
+ with gr.Accordion("Preview Tab Not Working", open=False):
285
+ gr.Markdown("""
286
+ **Local Testing**
287
+ - Set API_KEY in your local .env file
288
+ - Format: `API_KEY=sk-or-your-key-here`
289
+ - Restart the app after adding environment variable
290
+
291
+ **Preview Issues**
292
+ - Click "πŸ’¬ Preview Configuration" first
293
+ - Check browser console (F12) for JavaScript errors
294
+ - Ensure all required fields are filled
295
+ - Try refreshing the page
296
+ """)
297
+
298
+ with gr.Accordion("Configuration Status Shows ❌", open=False):
299
+ gr.Markdown("""
300
+ **Status Check Failures**
301
+ - Red X means configuration issue detected
302
+ - Usually indicates missing or invalid API key
303
+
304
+ **Resolution Steps**
305
+ 1. Verify secret name matches your configuration
306
+ 2. Default is API_KEY, check if you changed it
307
+ 3. Regenerate API key at openrouter.ai/keys
308
+ 4. Update secret in HuggingFace Space settings
309
+ 5. Wait 30 seconds and refresh
310
+ """)
311
+
312
+ with gr.Accordion("Space Not Loading", open=False):
313
+ gr.Markdown("""
314
+ **Infinite Loading**
315
+ - Check Space logs for error messages
316
+ - Common cause: Missing required secrets
317
+ - Verify all files uploaded correctly
318
+
319
+ **Gradio App Errors**
320
+ - Component version mismatches
321
+ - Update to latest Gradio version
322
+ - Check for deprecated components
323
+ - Review migration guides for Gradio 5.x
324
+ """)
325
 
326
  with gr.Accordion("πŸ“š Additional Resources", open=False):
327
  gr.Markdown("""