Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -17,24 +17,16 @@ def analyze_figure_of_speech(verse):
|
|
| 17 |
return "Please enter a Bible verse."
|
| 18 |
|
| 19 |
# Construct a prompt to instruct the model to analyze figures of speech in the verse.
|
| 20 |
-
prompt = f"""
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
"phrase": "[Highlight the specific phrase]",
|
| 31 |
-
"analysis": "[Explain why this phrase fits the identified figure of speech]"
|
| 32 |
-
}}
|
| 33 |
-
]
|
| 34 |
-
}}
|
| 35 |
-
[/INST]
|
| 36 |
-
"""
|
| 37 |
-
|
| 38 |
payload = {"inputs": prompt, "parameters": {"max_new_tokens": 250, "temperature": 0.7, "top_p": 0.9}}
|
| 39 |
|
| 40 |
try:
|
|
|
|
| 17 |
return "Please enter a Bible verse."
|
| 18 |
|
| 19 |
# Construct a prompt to instruct the model to analyze figures of speech in the verse.
|
| 20 |
+
prompt = f"""<s>[INST] You are JR-Sacred Syntax, an expert biblical scholar specializing in Bible analysis.
|
| 21 |
+
Analyze the following Bible verse to identify any figures of speech (e.g., Metaphor, Synecdoche, Hyperbole, Simile, Paradox).
|
| 22 |
+
Return your answer as a JSON array where each element includes:
|
| 23 |
+
- "verses": the Bible verse reference,
|
| 24 |
+
- "figure": the type of figure of speech,
|
| 25 |
+
- "phrase": the exact phrase from the verse,
|
| 26 |
+
- "explanation": a brief explanation in biblical context.
|
| 27 |
+
Bible Verse: "{verse}"
|
| 28 |
+
[/INST] Figures:</s>"""
|
| 29 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
payload = {"inputs": prompt, "parameters": {"max_new_tokens": 250, "temperature": 0.7, "top_p": 0.9}}
|
| 31 |
|
| 32 |
try:
|