cryptocalypse commited on
Commit
1cf280e
1 Parent(s): cd49593

entropy memory views

Browse files
Files changed (2) hide show
  1. app.py +67 -3
  2. requirements.txt +1 -0
app.py CHANGED
@@ -4,8 +4,37 @@ from lib.gematria import calculate_gematria, strip_diacritics
4
  from lib.temuraeh import temura_conv
5
  from lib.notarikon import notarikon
6
  from lib.ziruph import encrypt,decrypt
7
-
8
  from torahcodes.resources.func.torah import *
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
 
10
 
11
  torah = Torah()
@@ -121,6 +150,7 @@ with gr.Blocks(title="Sophia, Torah Codes",css=css,js=js) as app:
121
  # undo_btn="Undo",
122
  # clear_btn="Clear",
123
  # )
 
124
  with gr.Tab("ELS"):
125
  with gr.Row():
126
  books_sel = gr.CheckboxGroup(booklist,value=booklist, label="Books", info="Torah books source")
@@ -210,8 +240,42 @@ with gr.Blocks(title="Sophia, Torah Codes",css=css,js=js) as app:
210
  outputs=zir_result2
211
  )
212
 
213
-
214
- with gr.Tab("Files"):
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
215
  with gr.Row():
216
  image_input = gr.Image()
217
  image_output = gr.Image()
 
4
  from lib.temuraeh import temura_conv
5
  from lib.notarikon import notarikon
6
  from lib.ziruph import encrypt,decrypt
 
7
  from torahcodes.resources.func.torah import *
8
+ import math
9
+ import pandas as pd
10
+ import datetime
11
+ import numpy as np
12
+
13
+
14
+ def get_time():
15
+ return datetime.datetime.now()
16
+
17
+
18
+ plot_end = 2 * math.pi
19
+
20
+
21
+ def get_plot(period=1):
22
+ global plot_end
23
+ x = np.arange(plot_end - 2 * math.pi, plot_end, 0.02)
24
+ y = np.sin(2 * math.pi * period * x)
25
+ update = gr.LinePlot(
26
+ value=pd.DataFrame({"x": x, "y": y}),
27
+ x="x",
28
+ y="y",
29
+ title="Memory (updates every second)",
30
+ width=600,
31
+ height=350,
32
+ )
33
+ plot_end += 2 * math.pi
34
+ if plot_end > 1000:
35
+ plot_end = 2 * math.pi
36
+ return update
37
+
38
 
39
 
40
  torah = Torah()
 
150
  # undo_btn="Undo",
151
  # clear_btn="Clear",
152
  # )
153
+
154
  with gr.Tab("ELS"):
155
  with gr.Row():
156
  books_sel = gr.CheckboxGroup(booklist,value=booklist, label="Books", info="Torah books source")
 
240
  outputs=zir_result2
241
  )
242
 
243
+ with gr.Tab("Memory"):
244
+
245
+
246
+
247
+ with gr.Row():
248
+ with gr.Column():
249
+ c_time2 = gr.Textbox(label="Memory refreshed every second")
250
+ gr.Textbox(
251
+ "Change the value of the slider to calibrate the memory",
252
+ label="",
253
+ )
254
+ period = gr.Slider(
255
+ label="Period of plot", value=1, minimum=0, maximum=10, step=1
256
+ )
257
+ plot = gr.LinePlot(show_label=False)
258
+
259
+
260
+ demo.load(lambda: datetime.datetime.now(), None, c_time2, every=1)
261
+ dep = demo.load(get_plot, None, plot, every=1)
262
+ period.change(get_plot, period, plot, every=1, cancels=[dep])
263
+
264
+
265
+
266
+ with gr.Tab("Entropy"):
267
+ zir_text2 = gr.Textbox(label="Text to analyze",scale=3)
268
+ zir_btn2 = gr.Button("Analyze",scale=1)
269
+ with gr.Row():
270
+ zir_result2 = gr.Markdown("Paste a text for analysis")
271
+
272
+ zir_btn2.click(
273
+ ziruph_dec,
274
+ inputs=[zir_text2,custom_dic2],
275
+ outputs=zir_result2
276
+ )
277
+
278
+ with gr.Tab("Drive"):
279
  with gr.Row():
280
  image_input = gr.Image()
281
  image_output = gr.Image()
requirements.txt CHANGED
@@ -4,3 +4,4 @@ colorama
4
  gradio
5
  torahcodes==1.0.10
6
  deep-translator
 
 
4
  gradio
5
  torahcodes==1.0.10
6
  deep-translator
7
+ pandas