Vrda commited on
Commit
533533e
·
verified ·
1 Parent(s): 6dfc3c2

Upload app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +9 -0
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> &nbsp;"
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> &nbsp;"
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
  )