poltextlab commited on
Commit
5bdfb1c
·
verified ·
1 Parent(s): fb0c046

add white bg

Browse files
Files changed (1) hide show
  1. interfaces/cap_minor.py +5 -1
interfaces/cap_minor.py CHANGED
@@ -88,6 +88,7 @@ def predict(text, model_id, tokenizer_id):
88
  first_n_items = take(5, output_pred.items())
89
 
90
  html = ""
 
91
  first = True
92
  for label, prob in first_n_items:
93
  bar_color = "#e0d890" if first else "#ccc"
@@ -96,6 +97,8 @@ def predict(text, model_id, tokenizer_id):
96
 
97
  bar_color = score_to_color(prob)
98
 
 
 
99
  if first:
100
  html += f"""
101
  <div style="text-align: center; font-weight: bold; font-size: 30px; margin-bottom: 10px;">
@@ -109,8 +112,9 @@ def predict(text, model_id, tokenizer_id):
109
  </div>
110
  """
111
  first = False
 
112
 
113
-
114
  output_info = f'<p style="text-align: center; display: block">Prediction was made using the <a href="https://huggingface.co/{model_id}">{model_id}</a> model.</p>'
115
  return html, output_info
116
 
 
88
  first_n_items = take(5, output_pred.items())
89
 
90
  html = ""
91
+ html += '<div style="background-color: white">'
92
  first = True
93
  for label, prob in first_n_items:
94
  bar_color = "#e0d890" if first else "#ccc"
 
97
 
98
  bar_color = score_to_color(prob)
99
 
100
+
101
+
102
  if first:
103
  html += f"""
104
  <div style="text-align: center; font-weight: bold; font-size: 30px; margin-bottom: 10px;">
 
112
  </div>
113
  """
114
  first = False
115
+
116
 
117
+ html += '</div>'
118
  output_info = f'<p style="text-align: center; display: block">Prediction was made using the <a href="https://huggingface.co/{model_id}">{model_id}</a> model.</p>'
119
  return html, output_info
120