Commit
Β·
2ea01fd
1
Parent(s):
a3d157a
fix: simplify HSDD example to fix Gradio click issue (P2)
Browse filesThe third example wasn't filling the chat box when clicked.
Likely caused by parentheses in "HSDD (Hypoactive Sexual Desire Disorder)".
Fix: Remove abbreviation and parentheses - just use full name.
Also more readable since HSDD was getting cut off anyway.
- docs/bugs/P2_GRADIO_EXAMPLE_NOT_FILLING.md +67 -0
- src/app.py +1 -1
docs/bugs/P2_GRADIO_EXAMPLE_NOT_FILLING.md
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# P2 Bug Report: Third Example Not Filling Chat Box
|
| 2 |
+
|
| 3 |
+
## Status
|
| 4 |
+
- **Date:** 2025-11-29
|
| 5 |
+
- **Priority:** P2 (UX issue)
|
| 6 |
+
- **Component:** `src/app.py` - Gradio examples
|
| 7 |
+
|
| 8 |
+
---
|
| 9 |
+
|
| 10 |
+
## Symptoms
|
| 11 |
+
|
| 12 |
+
When clicking the third example in the Gradio UI:
|
| 13 |
+
- **Example 1** (female libido): β
Fills chat box correctly
|
| 14 |
+
- **Example 2** (ED alternatives): β
Fills chat box correctly
|
| 15 |
+
- **Example 3** (HSDD testosterone): β Does NOT fill chat box
|
| 16 |
+
|
| 17 |
+
### User Experience
|
| 18 |
+
User clicks example β nothing happens β confusion
|
| 19 |
+
|
| 20 |
+
---
|
| 21 |
+
|
| 22 |
+
## Root Cause Hypothesis
|
| 23 |
+
|
| 24 |
+
The third example contains parentheses and an abbreviation:
|
| 25 |
+
```
|
| 26 |
+
"Testosterone therapy for HSDD (Hypoactive Sexual Desire Disorder)?"
|
| 27 |
+
```
|
| 28 |
+
|
| 29 |
+
Possible causes:
|
| 30 |
+
1. **Parentheses** - Gradio may have parsing issues with `(...)` in example text
|
| 31 |
+
2. **Text length** - When expanded, this is the longest example
|
| 32 |
+
3. **Special characters** - The combination of abbreviation + parenthetical may confuse Gradio's example caching
|
| 33 |
+
|
| 34 |
+
---
|
| 35 |
+
|
| 36 |
+
## The Fix
|
| 37 |
+
|
| 38 |
+
Simplify the example text - expand the abbreviation and remove parentheses:
|
| 39 |
+
|
| 40 |
+
```python
|
| 41 |
+
# Before (broken)
|
| 42 |
+
"Testosterone therapy for HSDD (Hypoactive Sexual Desire Disorder)?"
|
| 43 |
+
|
| 44 |
+
# After (fixed)
|
| 45 |
+
"Testosterone therapy for Hypoactive Sexual Desire Disorder?"
|
| 46 |
+
```
|
| 47 |
+
|
| 48 |
+
This:
|
| 49 |
+
1. Removes problematic parentheses
|
| 50 |
+
2. Makes the text more readable (no cut-off abbreviation)
|
| 51 |
+
3. Users don't need to know what HSDD stands for
|
| 52 |
+
|
| 53 |
+
---
|
| 54 |
+
|
| 55 |
+
## Test Plan
|
| 56 |
+
|
| 57 |
+
- [ ] Change example text in `src/app.py`
|
| 58 |
+
- [ ] Deploy to HuggingFace Space
|
| 59 |
+
- [ ] Verify all 3 examples fill chat box correctly
|
| 60 |
+
- [ ] `make check` passes
|
| 61 |
+
|
| 62 |
+
---
|
| 63 |
+
|
| 64 |
+
## Related
|
| 65 |
+
|
| 66 |
+
- Gradio ChatInterface example caching behavior
|
| 67 |
+
- Similar to P0 example caching crash (but different manifestation)
|
src/app.py
CHANGED
|
@@ -261,7 +261,7 @@ def create_demo() -> tuple[gr.ChatInterface, gr.Accordion]:
|
|
| 261 |
None,
|
| 262 |
],
|
| 263 |
[
|
| 264 |
-
"Testosterone therapy for
|
| 265 |
"simple",
|
| 266 |
None,
|
| 267 |
None,
|
|
|
|
| 261 |
None,
|
| 262 |
],
|
| 263 |
[
|
| 264 |
+
"Testosterone therapy for Hypoactive Sexual Desire Disorder?",
|
| 265 |
"simple",
|
| 266 |
None,
|
| 267 |
None,
|