cryptocalypse commited on
Commit
45dc70e
1 Parent(s): 6573dab
Files changed (1) hide show
  1. app.py +12 -7
app.py CHANGED
@@ -7,12 +7,14 @@ from torahcodes.resources.func.torah import *
7
  torah = Torah()
8
  books.load()
9
  booklist=books.booklist()
 
 
10
 
11
-
12
- def els_book(book_num,els_space):
13
- response_els, tvalue = torah.els(book_num, els_space, tracert='false')
14
  text_translate = torah.func_translate('iw', 'en', response_els)
15
- return (response_els,text_translate)
16
 
17
 
18
 
@@ -70,7 +72,7 @@ def flip_image(x):
70
 
71
 
72
  #with gr.Blocks(theme='gradio/soft') as demo:
73
- with gr.Blocks() as demo:
74
 
75
  with gr.Tab("Chat"):
76
  gr.ChatInterface(
@@ -83,17 +85,20 @@ with gr.Blocks() as demo:
83
  with gr.Tab("ELS"):
84
  with gr.Row():
85
  books_sel = gr.Dropdown(
86
- booklist, value=booklist, multiselect=True, label="Books", info="Select Books"
87
  )
88
  with gr.Row():
89
  to_convert = gr.Textbox(label="Prompt to gematria conversion for apply ELS",scale=3)
 
 
 
90
  to_jump = gr.Textbox(label="ELS value", scale=3)
91
  search_els = gr.Button("Search",scale=1)
92
  with gr.Row():
93
  els_results = gr.JSON(label="Results")
94
  search_els.click(
95
  els_book,
96
- inputs=[to_convert,to_jump],
97
  outputs=els_results
98
  )
99
  with gr.Row():
 
7
  torah = Torah()
8
  books.load()
9
  booklist=books.booklist()
10
+ bk = booklist[0]
11
+ print(torah.gematria_sum("בפומט"))
12
 
13
+ def els_book(book_num,prompt):
14
+ els_space = torah.gematria_sum(prompt)
15
+ response_els, tvalue = torah.els(bk, els_space, tracert='false')
16
  text_translate = torah.func_translate('iw', 'en', response_els)
17
+ return {"Book":bk,"Prompt gematria":els_space,"ELS Generated":response_els,"ELS Translated": text_translate}
18
 
19
 
20
 
 
72
 
73
 
74
  #with gr.Blocks(theme='gradio/soft') as demo:
75
+ with gr.Blocks(title="Sophia, Torah Codes") as demo:
76
 
77
  with gr.Tab("Chat"):
78
  gr.ChatInterface(
 
85
  with gr.Tab("ELS"):
86
  with gr.Row():
87
  books_sel = gr.Dropdown(
88
+ booklist, value=booklist, multiselect=True, filterable=True,label="Books", info="Select Books"
89
  )
90
  with gr.Row():
91
  to_convert = gr.Textbox(label="Prompt to gematria conversion for apply ELS",scale=3)
92
+ langgem=gr.Dropdown(
93
+ ["Hebrew", "Latin", "Greek"], label="Gematria Alphabet", info="Choose gematria conversion"
94
+ ),
95
  to_jump = gr.Textbox(label="ELS value", scale=3)
96
  search_els = gr.Button("Search",scale=1)
97
  with gr.Row():
98
  els_results = gr.JSON(label="Results")
99
  search_els.click(
100
  els_book,
101
+ inputs=[to_convert,to_convert],
102
  outputs=els_results
103
  )
104
  with gr.Row():