awacke1 commited on
Commit
515f7f1
·
1 Parent(s): 8806ee3

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +226 -0
app.py ADDED
@@ -0,0 +1,226 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import time
2
+ import re
3
+ import pandas as pd
4
+ import numpy as np
5
+ import torch
6
+ import torch.nn.functional as F
7
+ import graphviz as graphviz
8
+ import pydeck as pdk
9
+ import streamlit as st
10
+
11
+ from transformers import AutoTokenizer, AutoModel
12
+ from tokenizers import Tokenizer, AddedToken
13
+ from st_click_detector import click_detector
14
+
15
+
16
+ st.graphviz_chart('''
17
+ graph Color_wheel {
18
+ graph [
19
+ layout = neato
20
+ label = "Color wheel, 33 colors.\nNeato layout"
21
+ labelloc = b
22
+ fontname = "Helvetica,Arial,sans-serif"
23
+ start = regular
24
+ normalize = 0
25
+ ]
26
+ node [
27
+ shape = circle
28
+ style = filled
29
+ color = "#00000088"
30
+ fontname = "Helvetica,Arial,sans-serif"
31
+ ]
32
+ edge [
33
+ len = 2.7
34
+ color = "#00000088"
35
+ fontname = "Helvetica,Arial,sans-serif"
36
+ ]
37
+ subgraph Dark {
38
+ node [fontcolor = white width = 1.4]
39
+ center [width = 1 style = invis shape = point]
40
+ center -- darkred [label = "0°/360°"]
41
+ darkred [fillcolor = darkred]
42
+ brown [fillcolor = brown]
43
+ brown -- center [label = "30°"]
44
+ olive [fillcolor = olive]
45
+ olive -- center [label = "60°"]
46
+ darkolivegreen [fillcolor = darkolivegreen fontsize = 10]
47
+ darkolivegreen -- center [label = "90°"]
48
+ darkgreen [fillcolor = darkgreen]
49
+ darkgreen -- center [label = "120°"]
50
+ "dark hue 0.416" [color = ".416 1 .6" fontcolor = white]
51
+ "dark hue 0.416" -- center [label = "150°"]
52
+ darkcyan [fillcolor = darkcyan]
53
+ darkcyan -- center [label = "180°"]
54
+ "dark hue 0.583" [color = ".583 1 .6" fontcolor = white]
55
+ "dark hue 0.583" -- center [label = "210°"]
56
+ darkblue [fillcolor = darkblue]
57
+ darkblue -- center [label = "240°"]
58
+ "dark hue 0.750" [color = ".750 1 .6"]
59
+ "dark hue 0.750" -- center [label = "270°"]
60
+ darkmagenta [fillcolor = darkmagenta]
61
+ darkmagenta -- center [label = "300°"]
62
+ "dark hue 0.916" [color = ".916 1 .6"]
63
+ "dark hue 0.916" -- center [label = "330°"]
64
+ }
65
+ subgraph Tue {
66
+ node [width = 1.3]
67
+ "hue 0.083" -- brown
68
+ "hue 0.083" [color = ".083 1 1"]
69
+ "hue 0.125" [color = ".125 1 1"]
70
+ "hue 0.166" -- olive
71
+ "hue 0.166" [color = ".166 1 1"]
72
+ "hue 0.208" [color = ".208 1 1"]
73
+ "hue 0.250" -- darkolivegreen
74
+ "hue 0.250" [color = ".250 1 1"]
75
+ "hue 0.291" [color = ".291 1 1"]
76
+ "hue 0.333" -- darkgreen
77
+ "hue 0.333" [color = ".333 1 1"]
78
+ "hue 0.375" [color = ".375 1 1"]
79
+ "hue 0.416" -- "dark hue 0.416"
80
+ "hue 0.416" [color = ".416 1 1"]
81
+ "hue 0.458" [color = ".458 1 1"]
82
+ "hue 0.500" -- darkcyan
83
+ "hue 0.500" [color = ".500 1 1"]
84
+ "hue 0.541" [color = ".541 1 1"]
85
+ node [fontcolor = white]
86
+ "hue 0.000" [color = ".000 1 1"]
87
+ "hue 0.000" -- darkred
88
+ "hue 0.041" [color = ".041 1 1"]
89
+ "hue 0.583" -- "dark hue 0.583"
90
+ "hue 0.583" [color = ".583 1 1"]
91
+ "hue 0.625" [color = ".625 1 1"]
92
+ "hue 0.666" -- darkblue
93
+ "hue 0.666" [color = ".666 1 1"]
94
+ "hue 0.708" [color = ".708 1 1"]
95
+ "hue 0.750" -- "dark hue 0.750"
96
+ "hue 0.750" [color = ".750 1 1"]
97
+ "hue 0.791" [color = ".791 1 1"]
98
+ "hue 0.833" -- darkmagenta
99
+ "hue 0.833" [color = ".833 1 1"]
100
+ "hue 0.875" [color = ".875 1 1"]
101
+ "hue 0.916" -- "dark hue 0.916"
102
+ "hue 0.916" [color = ".916 1 1"]
103
+ "hue 0.958" [color = ".958 1 1"]
104
+ edge [len = 1]
105
+ "hue 0.000" -- "hue 0.041" -- "hue 0.083" -- "hue 0.125" -- "hue 0.166" -- "hue 0.208"
106
+ "hue 0.208" -- "hue 0.250" -- "hue 0.291" -- "hue 0.333" -- "hue 0.375" -- "hue 0.416"
107
+ "hue 0.416" -- "hue 0.458" -- "hue 0.500" --"hue 0.541" -- "hue 0.583" -- "hue 0.625"
108
+ "hue 0.625" -- "hue 0.666" -- "hue 0.708" -- "hue 0.750" -- "hue 0.791" -- "hue 0.833"
109
+ "hue 0.833" -- "hue 0.875" -- "hue 0.916" -- "hue 0.958" -- "hue 0.000"
110
+ }
111
+ subgraph Main_colors {
112
+ node [width = 2 fontsize = 20]
113
+ red [fillcolor = red fontcolor = white]
114
+ orangered [fillcolor = orangered]
115
+ orange [fillcolor = orange]
116
+ gold [fillcolor = gold]
117
+ yellow [fillcolor = yellow]
118
+ yellowgreen [fillcolor = yellowgreen]
119
+ deeppink [fillcolor = deeppink fontcolor = white]
120
+ fuchsia [label = "fuchsia\nmagenta" fillcolor = fuchsia fontcolor = white]
121
+ purple [fillcolor = purple fontcolor = white]
122
+ blue [fillcolor = blue fontcolor = white]
123
+ cornflowerblue [fillcolor = cornflowerblue]
124
+ deepskyblue [fillcolor = deepskyblue]
125
+ aqua [fillcolor = aqua label = "aqua\ncyan"]
126
+ springgreen [fillcolor = springgreen]
127
+ green [fillcolor = green]
128
+ purple -- fuchsia -- deeppink -- red
129
+ cornflowerblue -- blue -- purple
130
+ cornflowerblue -- deepskyblue -- aqua [len = 1.7]
131
+ aqua -- springgreen -- green -- yellowgreen -- yellow
132
+ yellow -- gold -- orange -- orangered -- red [len = 1.6]
133
+ orange -- "hue 0.083"
134
+ deeppink -- "hue 0.916"
135
+ deeppink -- "hue 0.875"
136
+ red -- "hue 0.000"
137
+ yellowgreen -- "hue 0.250"
138
+ blue -- "hue 0.666"
139
+ yellow -- "hue 0.166"
140
+ gold -- "hue 0.125"
141
+ green -- "hue 0.333"
142
+ springgreen -- "hue 0.416"
143
+ aqua -- "hue 0.500"
144
+ cornflowerblue -- "hue 0.583"
145
+ deepskyblue -- "hue 0.541"
146
+ purple -- "hue 0.791"
147
+ purple -- "hue 0.750"
148
+ fuchsia -- "hue 0.833"
149
+ }
150
+ subgraph Light_colors {
151
+ node [width = 2 fontsize = 20]
152
+ node [shape = circle width = 1.8]
153
+ edge [len = 2.1]
154
+ pink [fillcolor = pink]
155
+ pink -- red
156
+ lightyellow [fillcolor = lightyellow]
157
+ lightyellow -- yellow
158
+ mediumpurple [fillcolor = mediumpurple]
159
+ mediumpurple -- purple
160
+ violet [fillcolor = violet]
161
+ violet -- fuchsia
162
+ hotpink [fillcolor = hotpink]
163
+ hotpink -- deeppink
164
+ "light hue 0.250" [color = ".250 .2 1"]
165
+ "light hue 0.250" -- yellowgreen
166
+ lightcyan [fillcolor = lightcyan]
167
+ lightcyan -- aqua
168
+ lightslateblue [fillcolor = lightslateblue]
169
+ lightslateblue -- blue
170
+ lightgreen [fillcolor = lightgreen]
171
+ lightgreen -- green
172
+ lightskyblue [fillcolor = lightskyblue]
173
+ lightskyblue -- deepskyblue
174
+ peachpuff [fillcolor = peachpuff]
175
+ peachpuff -- orange
176
+ "light hue 0.416" [color = ".416 .2 1"]
177
+ "light hue 0.416" -- springgreen
178
+ }
179
+ subgraph Tints {
180
+ node [width = 1]
181
+ edge [len = 2.4]
182
+ "hue 0 tint" -- pink
183
+ "hue 0 tint" [color = "0 .1 1"]
184
+ "hue 0.041 tint" [color = ".041 .1 1"]
185
+ "hue 0.083 tint" -- peachpuff
186
+ "hue 0.083 tint" [color = ".083 .1 1"]
187
+ "hue 0.125 tint" [color = ".125 .1 1"]
188
+ "hue 0.166 tint" -- lightyellow
189
+ "hue 0.166 tint" [color = ".166 .1 1"]
190
+ "hue 0.208 tint" [color = ".208 .1 1"]
191
+ "hue 0.250 tint" -- "light hue 0.250"
192
+ "hue 0.250 tint" [color = ".250 .1 1"]
193
+ "hue 0.291 tint" [color = ".291 .1 1"]
194
+ "hue 0.333 tint" -- lightgreen
195
+ "hue 0.333 tint" [color = ".333 .1 1"]
196
+ "hue 0.375 tint" [color = ".375 .1 1"]
197
+ "hue 0.416 tint" -- "light hue 0.416"
198
+ "hue 0.416 tint" [color = ".416 .1 1"]
199
+ "hue 0.458 tint" [color = ".458 .1 1"]
200
+ "hue 0.5 tint" -- lightcyan
201
+ "hue 0.5 tint" [color = ".5 .1 1"]
202
+ "hue 0.541 tint" -- lightskyblue
203
+ "hue 0.541 tint" [color = ".541 .1 1"]
204
+ "hue 0.583 tint" [color = ".583 .1 1"]
205
+ "hue 0.625 tint" [color = ".625 .1 1"]
206
+ "hue 0.666 tint" -- lightslateblue
207
+ "hue 0.666 tint" [color = ".666 .1 1"]
208
+ "hue 0.708 tint" [color = ".708 .1 1"]
209
+ "hue 0.750 tint" -- mediumpurple
210
+ "hue 0.750 tint" [color = ".750 .1 1"]
211
+ "hue 0.791 tint" [color = ".791 .1 1"]
212
+ "hue 0.833 tint" -- violet
213
+ "hue 0.833 tint" [color = ".833 .1 1"]
214
+ "hue 0.875 tint" [color = ".875 .1 1"]
215
+ "hue 0.916 tint" -- hotpink
216
+ "hue 0.916 tint" [color = ".916 .1 1"]
217
+ "hue 0.958 tint" [color = ".958 .1 1"]
218
+ edge [len = 2]
219
+ "hue 0 tint" -- "hue 0.041 tint" -- "hue 0.083 tint" -- "hue 0.125 tint" -- "hue 0.166 tint" -- "hue 0.208 tint"
220
+ "hue 0.208 tint" -- "hue 0.250 tint" -- "hue 0.291 tint" -- "hue 0.333 tint" -- "hue 0.375 tint" -- "hue 0.416 tint"
221
+ "hue 0.416 tint" -- "hue 0.458 tint" -- "hue 0.5 tint" --"hue 0.541 tint" -- "hue 0.583 tint" -- "hue 0.625 tint"
222
+ "hue 0.625 tint" -- "hue 0.666 tint" -- "hue 0.708 tint" -- "hue 0.750 tint" -- "hue 0.791 tint" -- "hue 0.833 tint"
223
+ "hue 0.833 tint" -- "hue 0.875 tint" -- "hue 0.916 tint" -- "hue 0.958 tint" -- "hue 0 tint"
224
+ }
225
+ }
226
+ ''')