Spaces:
Running
Running
Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
|
@@ -435,11 +435,20 @@ def render_model_output(result, header_class: str):
|
|
| 435 |
if result.suggestions:
|
| 436 |
for i, sug in enumerate(result.suggestions, 1):
|
| 437 |
cat = CATEGORY_LABELS.get(sug.category, sug.category)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 438 |
st.markdown(
|
| 439 |
f'<div class="suggestion-card">'
|
| 440 |
f"<strong>Suggestion {i}</strong> "
|
| 441 |
f'<span class="category-badge">{cat}</span><br>'
|
| 442 |
f"{sug.description}"
|
|
|
|
| 443 |
f"</div>",
|
| 444 |
unsafe_allow_html=True,
|
| 445 |
)
|
|
|
|
| 435 |
if result.suggestions:
|
| 436 |
for i, sug in enumerate(result.suggestions, 1):
|
| 437 |
cat = CATEGORY_LABELS.get(sug.category, sug.category)
|
| 438 |
+
details = ""
|
| 439 |
+
if getattr(sug, "quote", ""):
|
| 440 |
+
details += f'<br><em>Original: "{sug.quote}"</em>'
|
| 441 |
+
if getattr(sug, "suggested_rewrite", ""):
|
| 442 |
+
details += (
|
| 443 |
+
"<br><strong>Suggested rewrite:</strong> "
|
| 444 |
+
f"{sug.suggested_rewrite}"
|
| 445 |
+
)
|
| 446 |
st.markdown(
|
| 447 |
f'<div class="suggestion-card">'
|
| 448 |
f"<strong>Suggestion {i}</strong> "
|
| 449 |
f'<span class="category-badge">{cat}</span><br>'
|
| 450 |
f"{sug.description}"
|
| 451 |
+
f"{details}"
|
| 452 |
f"</div>",
|
| 453 |
unsafe_allow_html=True,
|
| 454 |
)
|