Spaces:
Sleeping
Sleeping
broadened color range
Browse files
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.
|
| 21 |
-
(0.
|
| 22 |
-
(
|
|
|
|
| 23 |
]
|
| 24 |
|
| 25 |
label_to_color = {
|
| 26 |
-
"p >=
|
| 27 |
-
"p >=
|
| 28 |
-
"p
|
|
|
|
| 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()
|