Spaces:
Runtime error
Runtime error
Commit
·
6573dab
1
Parent(s):
bcffc89
els solved
Browse files- app.py +10 -5
- install.sh +8 -0
- lib/__pycache__/gematria.cpython-39.pyc +0 -0
- lib/__pycache__/torah.cpython-39.pyc +0 -0
- lib/torah.py +1 -0
app.py
CHANGED
|
@@ -1,15 +1,20 @@
|
|
| 1 |
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 |
-
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(book_num, els_space, tracert='false')
|
| 11 |
-
|
| 12 |
-
return (response_els)
|
|
|
|
|
|
|
| 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)
|
|
@@ -78,7 +83,7 @@ with gr.Blocks() as demo:
|
|
| 78 |
with gr.Tab("ELS"):
|
| 79 |
with gr.Row():
|
| 80 |
books_sel = gr.Dropdown(
|
| 81 |
-
|
| 82 |
)
|
| 83 |
with gr.Row():
|
| 84 |
to_convert = gr.Textbox(label="Prompt to gematria conversion for apply ELS",scale=3)
|
|
|
|
| 1 |
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 |
+
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 |
|
| 19 |
def translate_texts(start, end, step, length=0, tlang="en", spaces_include=False, strip_in_braces=True, strip_diacritics=True):
|
| 20 |
results = torah.process_json_files(start, end, step, length, tlang, spaces_include, strip_in_braces, strip_diacritics)
|
|
|
|
| 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)
|
install.sh
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
rm -r venv
|
| 2 |
+
python3 -m venv ./venv
|
| 3 |
+
source venv/bin/activate
|
| 4 |
+
pip3 install git+https://github.com/pedroelbanquero/torahcodespython
|
| 5 |
+
pip3 install gradio
|
| 6 |
+
pip3 install -r requirements.txt
|
| 7 |
+
|
| 8 |
+
|
lib/__pycache__/gematria.cpython-39.pyc
ADDED
|
Binary file (7.07 kB). View file
|
|
|
lib/__pycache__/torah.cpython-39.pyc
ADDED
|
Binary file (8.29 kB). View file
|
|
|
lib/torah.py
CHANGED
|
@@ -23,6 +23,7 @@ class BibleBooks():
|
|
| 23 |
def load(self):
|
| 24 |
|
| 25 |
for f in listdir(self.folder):
|
|
|
|
| 26 |
if isfile(join(self.folder, f)) and f.endswith(".json"):
|
| 27 |
fn = f.split('.')
|
| 28 |
#print('Load', fn[0])
|
|
|
|
| 23 |
def load(self):
|
| 24 |
|
| 25 |
for f in listdir(self.folder):
|
| 26 |
+
print(f)
|
| 27 |
if isfile(join(self.folder, f)) and f.endswith(".json"):
|
| 28 |
fn = f.split('.')
|
| 29 |
#print('Load', fn[0])
|