kcarnold commited on
Commit
cc79a99
·
1 Parent(s): 3c6b0e4

Style tweaks

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -366,7 +366,7 @@ def logprobs_component(logprobs):
366
  token_to_show = html.escape(show_token(token, escape_markdown=False))
367
  else:
368
  token_to_show = html.escape("<empty>")
369
- html_out += f'<span style="border: 1px solid black;" onclick="showLogprobs({i})" title="Click to show logprobs for this token">{token_to_show}</span>'
370
  show_logprob_js = '''
371
  const makeElt = (tag, attrs, children) => {
372
  const elt = document.createElement(tag);
@@ -395,8 +395,7 @@ const makeElt = (tag, attrs, children) => {
395
  <style>
396
  p.logprobs-container {{
397
  background: white;
398
- line-height: 2.5;
399
- color: #2C3E50; /* Dark blue-grey for main text */
400
  }}
401
  p.logprobs-container > span {{
402
  position: relative;
@@ -412,9 +411,8 @@ const makeElt = (tag, attrs, children) => {
412
  showLogprobs(allLogprobs.length - 1);
413
  </script>
414
  """
415
- #return st.html(html_out)
416
  import streamlit.components.v1 as components
417
- return components.html(html_out, height=200, scrolling=True)
418
 
419
  rewrite_page = st.Page(rewrite_with_predictions, title="Rewrite with predictions", icon="📝")
420
  highlight_page = st.Page(highlight_edits, title="Highlight locations for possible edits", icon="🖍️")
 
366
  token_to_show = html.escape(show_token(token, escape_markdown=False))
367
  else:
368
  token_to_show = html.escape("<empty>")
369
+ html_out += f'<span style="border: 1px solid black; display: inline-block;" onclick="showLogprobs({i})" title="Click to show logprobs for this token">{token_to_show}</span>'
370
  show_logprob_js = '''
371
  const makeElt = (tag, attrs, children) => {
372
  const elt = document.createElement(tag);
 
395
  <style>
396
  p.logprobs-container {{
397
  background: white;
398
+ line-height: 1.5;
 
399
  }}
400
  p.logprobs-container > span {{
401
  position: relative;
 
411
  showLogprobs(allLogprobs.length - 1);
412
  </script>
413
  """
 
414
  import streamlit.components.v1 as components
415
+ return components.html(html_out, height=300, scrolling=True)
416
 
417
  rewrite_page = st.Page(rewrite_with_predictions, title="Rewrite with predictions", icon="📝")
418
  highlight_page = st.Page(highlight_edits, title="Highlight locations for possible edits", icon="🖍️")