b1swas commited on
Commit
402ae9a
·
verified ·
1 Parent(s): a5e42e5

broadened color range

Browse files
Files changed (1) hide show
  1. app.py +9 -7
app.py CHANGED
@@ -17,15 +17,17 @@ if __name__ == "__main__":
17
 
18
  # Define your color-coding labels; if prob > x, then label = y; Sorted in descending probability order!
19
  probs_to_label = [
20
- (0.1, "p >= 10%"),
21
- (0.01, "p >= 1%"),
22
- (1e-20, "p < 1%"),
 
23
  ]
24
 
25
  label_to_color = {
26
- "p >= 10%": "green",
27
- "p >= 1%": "yellow",
28
- "p < 1%": "red"
 
29
  }
30
 
31
  def get_tokens_and_labels(prompt):
@@ -103,4 +105,4 @@ if __name__ == "__main__":
103
 
104
 
105
  if __name__ == "__main__":
106
- demo.launch()
 
17
 
18
  # Define your color-coding labels; if prob > x, then label = y; Sorted in descending probability order!
19
  probs_to_label = [
20
+ (0.8, "p >= 80%"),
21
+ (0.5, "p >= 50%"),
22
+ (0.2, "p >= 20%"),
23
+ (0.0, "p >= 0%")
24
  ]
25
 
26
  label_to_color = {
27
+ "p >= 80%": "blue",
28
+ "p >= 50%": "green",
29
+ "p >= 20%": "yellow",
30
+ "p >= 0%": "red"
31
  }
32
 
33
  def get_tokens_and_labels(prompt):
 
105
 
106
 
107
  if __name__ == "__main__":
108
+ demo.launch()