Spaces:
Sleeping
Sleeping
nos
commited on
Commit
•
33e40b8
1
Parent(s):
e98fe04
Update app.py
Browse files
app.py
CHANGED
@@ -2,7 +2,15 @@ import gradio as gr
|
|
2 |
from huggingface_hub import InferenceClient
|
3 |
from lib.gematria import calculate_gematria, strip_diacritics
|
4 |
import lib.torah as torah
|
|
|
5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
def translate_texts(start, end, step, length=0, tlang="en", spaces_include=False, strip_in_braces=True, strip_diacritics=True):
|
7 |
results = torah.process_json_files(start, end, step, length, tlang, spaces_include, strip_in_braces, strip_diacritics)
|
8 |
return results
|
@@ -72,6 +80,12 @@ with gr.Blocks() as demo:
|
|
72 |
text1 = gr.Textbox(label="Prompt to gematria conversion for apply ELS",scale=3)
|
73 |
text2 = gr.Textbox(label="ELS value", scale=3)
|
74 |
inbtw = gr.Button("Search",scale=1)
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
with gr.Row():
|
76 |
start = gr.Number(label="Start", value=1)
|
77 |
end = gr.Number(label="End", value=1)
|
|
|
2 |
from huggingface_hub import InferenceClient
|
3 |
from lib.gematria import calculate_gematria, strip_diacritics
|
4 |
import lib.torah as torah
|
5 |
+
from torahcodes.resources.func.torah import *
|
6 |
|
7 |
+
torah = Torah()
|
8 |
+
|
9 |
+
def els_book(book_num,els_space):
|
10 |
+
response_els, tvalue = torah.els(bookNumber, gematriaNumber, tracert='false')
|
11 |
+
text_translate = torah.func_translate('iw', 'en', response_els)
|
12 |
+
return (response_els,text_translate)
|
13 |
+
|
14 |
def translate_texts(start, end, step, length=0, tlang="en", spaces_include=False, strip_in_braces=True, strip_diacritics=True):
|
15 |
results = torah.process_json_files(start, end, step, length, tlang, spaces_include, strip_in_braces, strip_diacritics)
|
16 |
return results
|
|
|
80 |
text1 = gr.Textbox(label="Prompt to gematria conversion for apply ELS",scale=3)
|
81 |
text2 = gr.Textbox(label="ELS value", scale=3)
|
82 |
inbtw = gr.Button("Search",scale=1)
|
83 |
+
results_els=gr.Markdown("### Results")
|
84 |
+
inbtw.click(
|
85 |
+
els_book,
|
86 |
+
inputs=[ 1, text2 ],
|
87 |
+
outputs=results_els
|
88 |
+
)
|
89 |
with gr.Row():
|
90 |
start = gr.Number(label="Start", value=1)
|
91 |
end = gr.Number(label="End", value=1)
|