Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -20,7 +20,6 @@ def generate_exegesis(passage):
|
|
20 |
|
21 |
prompt = f"""<s>[INST] You are a professional Bible Scholar. Provide a detailed exegesis of the following biblical verse, including:
|
22 |
The original Greek text and transliteration with word-by-word analysis and meanings, historical and cultural context, and theological significance for:
|
23 |
-
|
24 |
{passage} [/INST] Exegesis:</s>"""
|
25 |
|
26 |
payload = {
|
@@ -45,15 +44,56 @@ def generate_exegesis(passage):
|
|
45 |
except requests.exceptions.RequestException as e:
|
46 |
return f"API Error: {e}"
|
47 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
|
49 |
# Gradio interface
|
50 |
demo = gr.Interface(
|
51 |
fn=generate_exegesis,
|
52 |
-
inputs=gr.Textbox(label="Enter Bible Passage", placeholder="e.g., John 3:16"),
|
53 |
outputs=gr.Textbox(label="Exegesis Commentary"),
|
54 |
title="JR Study Bible",
|
55 |
-
description="Enter a Bible passage to receive insightful exegesis commentary. Thanks. Any
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
)
|
57 |
|
58 |
-
if __name__ == "__main__":
|
59 |
-
|
|
|
20 |
|
21 |
prompt = f"""<s>[INST] You are a professional Bible Scholar. Provide a detailed exegesis of the following biblical verse, including:
|
22 |
The original Greek text and transliteration with word-by-word analysis and meanings, historical and cultural context, and theological significance for:
|
|
|
23 |
{passage} [/INST] Exegesis:</s>"""
|
24 |
|
25 |
payload = {
|
|
|
44 |
except requests.exceptions.RequestException as e:
|
45 |
return f"API Error: {e}"
|
46 |
|
47 |
+
def lookup_passage(passage):
|
48 |
+
# Implement a function to lookup a Bible passage
|
49 |
+
return f"Lookup result for {passage}"
|
50 |
+
|
51 |
+
def generate_commentary(passage):
|
52 |
+
# Implement a function to generate commentary for a passage
|
53 |
+
return f"Commentary for {passage}"
|
54 |
+
|
55 |
+
def keyword_search(keyword):
|
56 |
+
# Implement a function to search for a keyword in the Bible
|
57 |
+
return f"Search results for {keyword}"
|
58 |
|
59 |
# Gradio interface
|
60 |
demo = gr.Interface(
|
61 |
fn=generate_exegesis,
|
62 |
+
inputs=gr.Textbox(label="Enter Bible Passage for Exegesis", placeholder="e.g., John 3:16"),
|
63 |
outputs=gr.Textbox(label="Exegesis Commentary"),
|
64 |
title="JR Study Bible",
|
65 |
+
description="Enter a Bible passage to receive insightful exegesis commentary. Thanks. Any complaints please email: [email protected]."
|
66 |
+
)
|
67 |
+
|
68 |
+
lookup_demo = gr.Interface(
|
69 |
+
fn=lookup_passage,
|
70 |
+
inputs=gr.Textbox(label="Lookup Bible Passage", placeholder="e.g., John 3:16"),
|
71 |
+
outputs=gr.Textbox(label="Passage Text"),
|
72 |
+
title="Bible Passage Lookup",
|
73 |
+
description="Enter a Bible passage to lookup its text."
|
74 |
+
)
|
75 |
+
|
76 |
+
commentary_demo = gr.Interface(
|
77 |
+
fn=generate_commentary,
|
78 |
+
inputs=gr.Textbox(label="Generate Commentary", placeholder="e.g., John 3:16"),
|
79 |
+
outputs=gr.Textbox(label="Commentary"),
|
80 |
+
title="Bible Commentary Generator",
|
81 |
+
description="Enter a Bible passage to generate commentary."
|
82 |
+
)
|
83 |
+
|
84 |
+
search_demo = gr.Interface(
|
85 |
+
fn=keyword_search,
|
86 |
+
inputs=gr.Textbox(label="Keyword Search", placeholder="e.g., love"),
|
87 |
+
outputs=gr.Textbox(label="Search Results"),
|
88 |
+
title="Bible Keyword Search",
|
89 |
+
description="Enter a keyword to search in the Bible."
|
90 |
+
)
|
91 |
+
|
92 |
+
# Combine all interfaces into one app
|
93 |
+
app = gr.TabbedInterface(
|
94 |
+
[demo, lookup_demo, commentary_demo, search_demo],
|
95 |
+
["Exegesis", "Passage Lookup", "Commentary", "Keyword Search"]
|
96 |
)
|
97 |
|
98 |
+
if __name__ == "__main__":
|
99 |
+
app.launch()
|