Spaces:
Running
Running
Commit
·
4acd90c
1
Parent(s):
50a6f4d
remove wechatlog dependency
Browse files- Dockerfile +1 -1
- compressedContentViewer.py +239 -1
- requirements.txt +3 -1
Dockerfile
CHANGED
@@ -13,4 +13,4 @@ CMD ["panel", "serve", "/code/compressedContentViewer.py", "--address", "0.0.0.0
|
|
13 |
RUN mkdir /.cache
|
14 |
RUN chmod 777 /.cache
|
15 |
RUN mkdir .chroma
|
16 |
-
RUN chmod 777 .
|
|
|
13 |
RUN mkdir /.cache
|
14 |
RUN chmod 777 /.cache
|
15 |
RUN mkdir .chroma
|
16 |
+
RUN chmod 777 .chromap
|
compressedContentViewer.py
CHANGED
@@ -4,7 +4,8 @@ import xml.sax.saxutils
|
|
4 |
import html
|
5 |
import io
|
6 |
import xml.dom.minidom
|
7 |
-
|
|
|
8 |
|
9 |
# Initialize Panel with Bootstrap design
|
10 |
pn.extension(design="bootstrap", sizing_mode="stretch_width")
|
@@ -15,6 +16,243 @@ ICON_URLS = {
|
|
15 |
"message-circle": "https://discourse.holoviz.org/",
|
16 |
}
|
17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
def process_content(data):
|
19 |
"""
|
20 |
Process both CompressContent and BytesExtra content.
|
|
|
4 |
import html
|
5 |
import io
|
6 |
import xml.dom.minidom
|
7 |
+
import blackboxprotobuf
|
8 |
+
# from wechatlog.adaptors.pywxdumpAdapter import decode_bytes_extra
|
9 |
|
10 |
# Initialize Panel with Bootstrap design
|
11 |
pn.extension(design="bootstrap", sizing_mode="stretch_width")
|
|
|
16 |
"message-circle": "https://discourse.holoviz.org/",
|
17 |
}
|
18 |
|
19 |
+
def decode_bytes_extra(data):
|
20 |
+
"""
|
21 |
+
Decode BytesExtra data using pywxdump's decode_bytes_extra function.
|
22 |
+
"""
|
23 |
+
def get_BytesExtra(BytesExtra):
|
24 |
+
BytesExtra_message_type = {
|
25 |
+
"1": {
|
26 |
+
"type": "message",
|
27 |
+
"message_typedef": {
|
28 |
+
"1": {
|
29 |
+
"type": "int",
|
30 |
+
"name": ""
|
31 |
+
},
|
32 |
+
"2": {
|
33 |
+
"type": "int",
|
34 |
+
"name": ""
|
35 |
+
}
|
36 |
+
},
|
37 |
+
"name": "1"
|
38 |
+
},
|
39 |
+
"3": {
|
40 |
+
"type": "message",
|
41 |
+
"message_typedef": {
|
42 |
+
"1": {
|
43 |
+
"type": "int",
|
44 |
+
"name": ""
|
45 |
+
},
|
46 |
+
"2": {
|
47 |
+
"type": "str",
|
48 |
+
"name": ""
|
49 |
+
}
|
50 |
+
},
|
51 |
+
"name": "3",
|
52 |
+
"alt_typedefs": {
|
53 |
+
"1": {
|
54 |
+
"1": {
|
55 |
+
"type": "int",
|
56 |
+
"name": ""
|
57 |
+
},
|
58 |
+
"2": {
|
59 |
+
"type": "message",
|
60 |
+
"message_typedef": {},
|
61 |
+
"name": ""
|
62 |
+
}
|
63 |
+
},
|
64 |
+
"2": {
|
65 |
+
"1": {
|
66 |
+
"type": "int",
|
67 |
+
"name": ""
|
68 |
+
},
|
69 |
+
"2": {
|
70 |
+
"type": "message",
|
71 |
+
"message_typedef": {
|
72 |
+
"13": {
|
73 |
+
"type": "fixed32",
|
74 |
+
"name": ""
|
75 |
+
},
|
76 |
+
"12": {
|
77 |
+
"type": "fixed32",
|
78 |
+
"name": ""
|
79 |
+
}
|
80 |
+
},
|
81 |
+
"name": ""
|
82 |
+
}
|
83 |
+
},
|
84 |
+
"3": {
|
85 |
+
"1": {
|
86 |
+
"type": "int",
|
87 |
+
"name": ""
|
88 |
+
},
|
89 |
+
"2": {
|
90 |
+
"type": "message",
|
91 |
+
"message_typedef": {
|
92 |
+
"15": {
|
93 |
+
"type": "fixed64",
|
94 |
+
"name": ""
|
95 |
+
}
|
96 |
+
},
|
97 |
+
"name": ""
|
98 |
+
}
|
99 |
+
},
|
100 |
+
"4": {
|
101 |
+
"1": {
|
102 |
+
"type": "int",
|
103 |
+
"name": ""
|
104 |
+
},
|
105 |
+
"2": {
|
106 |
+
"type": "message",
|
107 |
+
"message_typedef": {
|
108 |
+
"15": {
|
109 |
+
"type": "int",
|
110 |
+
"name": ""
|
111 |
+
},
|
112 |
+
"14": {
|
113 |
+
"type": "fixed32",
|
114 |
+
"name": ""
|
115 |
+
}
|
116 |
+
},
|
117 |
+
"name": ""
|
118 |
+
}
|
119 |
+
},
|
120 |
+
"5": {
|
121 |
+
"1": {
|
122 |
+
"type": "int",
|
123 |
+
"name": ""
|
124 |
+
},
|
125 |
+
"2": {
|
126 |
+
"type": "message",
|
127 |
+
"message_typedef": {
|
128 |
+
"12": {
|
129 |
+
"type": "fixed32",
|
130 |
+
"name": ""
|
131 |
+
},
|
132 |
+
"7": {
|
133 |
+
"type": "fixed64",
|
134 |
+
"name": ""
|
135 |
+
},
|
136 |
+
"6": {
|
137 |
+
"type": "fixed64",
|
138 |
+
"name": ""
|
139 |
+
}
|
140 |
+
},
|
141 |
+
"name": ""
|
142 |
+
}
|
143 |
+
},
|
144 |
+
"6": {
|
145 |
+
"1": {
|
146 |
+
"type": "int",
|
147 |
+
"name": ""
|
148 |
+
},
|
149 |
+
"2": {
|
150 |
+
"type": "message",
|
151 |
+
"message_typedef": {
|
152 |
+
"7": {
|
153 |
+
"type": "fixed64",
|
154 |
+
"name": ""
|
155 |
+
},
|
156 |
+
"6": {
|
157 |
+
"type": "fixed32",
|
158 |
+
"name": ""
|
159 |
+
}
|
160 |
+
},
|
161 |
+
"name": ""
|
162 |
+
}
|
163 |
+
},
|
164 |
+
"7": {
|
165 |
+
"1": {
|
166 |
+
"type": "int",
|
167 |
+
"name": ""
|
168 |
+
},
|
169 |
+
"2": {
|
170 |
+
"type": "message",
|
171 |
+
"message_typedef": {
|
172 |
+
"12": {
|
173 |
+
"type": "fixed64",
|
174 |
+
"name": ""
|
175 |
+
}
|
176 |
+
},
|
177 |
+
"name": ""
|
178 |
+
}
|
179 |
+
},
|
180 |
+
"8": {
|
181 |
+
"1": {
|
182 |
+
"type": "int",
|
183 |
+
"name": ""
|
184 |
+
},
|
185 |
+
"2": {
|
186 |
+
"type": "message",
|
187 |
+
"message_typedef": {
|
188 |
+
"6": {
|
189 |
+
"type": "fixed64",
|
190 |
+
"name": ""
|
191 |
+
},
|
192 |
+
"12": {
|
193 |
+
"type": "fixed32",
|
194 |
+
"name": ""
|
195 |
+
}
|
196 |
+
},
|
197 |
+
"name": ""
|
198 |
+
}
|
199 |
+
},
|
200 |
+
"9": {
|
201 |
+
"1": {
|
202 |
+
"type": "int",
|
203 |
+
"name": ""
|
204 |
+
},
|
205 |
+
"2": {
|
206 |
+
"type": "message",
|
207 |
+
"message_typedef": {
|
208 |
+
"15": {
|
209 |
+
"type": "int",
|
210 |
+
"name": ""
|
211 |
+
},
|
212 |
+
"12": {
|
213 |
+
"type": "fixed64",
|
214 |
+
"name": ""
|
215 |
+
},
|
216 |
+
"6": {
|
217 |
+
"type": "int",
|
218 |
+
"name": ""
|
219 |
+
}
|
220 |
+
},
|
221 |
+
"name": ""
|
222 |
+
}
|
223 |
+
},
|
224 |
+
"10": {
|
225 |
+
"1": {
|
226 |
+
"type": "int",
|
227 |
+
"name": ""
|
228 |
+
},
|
229 |
+
"2": {
|
230 |
+
"type": "message",
|
231 |
+
"message_typedef": {
|
232 |
+
"6": {
|
233 |
+
"type": "fixed32",
|
234 |
+
"name": ""
|
235 |
+
},
|
236 |
+
"12": {
|
237 |
+
"type": "fixed64",
|
238 |
+
"name": ""
|
239 |
+
}
|
240 |
+
},
|
241 |
+
"name": ""
|
242 |
+
}
|
243 |
+
},
|
244 |
+
}
|
245 |
+
}
|
246 |
+
}
|
247 |
+
if BytesExtra is None or not isinstance(BytesExtra, bytes):
|
248 |
+
return None
|
249 |
+
try:
|
250 |
+
deserialize_data, message_type = blackboxprotobuf.decode_message(BytesExtra, BytesExtra_message_type)
|
251 |
+
return deserialize_data
|
252 |
+
except Exception as e:
|
253 |
+
return None
|
254 |
+
return get_BytesExtra(data)
|
255 |
+
|
256 |
def process_content(data):
|
257 |
"""
|
258 |
Process both CompressContent and BytesExtra content.
|
requirements.txt
CHANGED
@@ -4,4 +4,6 @@ transformers
|
|
4 |
numpy
|
5 |
torch
|
6 |
aiohttp
|
7 |
-
lz4
|
|
|
|
|
|
4 |
numpy
|
5 |
torch
|
6 |
aiohttp
|
7 |
+
lz4
|
8 |
+
lxml
|
9 |
+
blackboxprotobuf
|