Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,9 +4,9 @@ import requests
|
|
| 4 |
import json
|
| 5 |
|
| 6 |
# Constants
|
| 7 |
-
API_URL = "https://api-inference.huggingface.co/models/mistralai/Mistral-
|
| 8 |
MAX_NEW_TOKENS = 1000 # Increased to handle longer inputs
|
| 9 |
-
TEMPERATURE = 0.
|
| 10 |
TOP_P = 0.9
|
| 11 |
|
| 12 |
# Retrieve the API token from environment variables
|
|
@@ -37,11 +37,11 @@ def analyze_figure_of_speech(text: str) -> str:
|
|
| 37 |
f"""<s>[INST] You are JR-Sacred Syntax, an expert biblical scholar specializing in Bible analysis.
|
| 38 |
Analyze the following Bible passage to identify any figures of speech (e.g., Metaphor, Synecdoche, Hyperbole, Simile, Paradox, and others).
|
| 39 |
Return your answer as a JSON array where each element includes:
|
| 40 |
-
- "verses": the Bible verse(s) in NJV,
|
| 41 |
-
- "figure": the type of figure of speech,
|
| 42 |
- "definition": define the figure of speech you identified,
|
| 43 |
-
- "phrase": the exact phrase from the verse,
|
| 44 |
-
- "explanation": a brief explanation in the biblical context.
|
| 45 |
Consider each verse individually and provide a detailed analysis.
|
| 46 |
Bible Passage: "{text}"
|
| 47 |
[/INST] Figures: </s>"""
|
|
|
|
| 4 |
import json
|
| 5 |
|
| 6 |
# Constants
|
| 7 |
+
API_URL = "https://api-inference.huggingface.co/models/mistralai/Mistral-Small-24B-Instruct-2501"
|
| 8 |
MAX_NEW_TOKENS = 1000 # Increased to handle longer inputs
|
| 9 |
+
TEMPERATURE = 0.7
|
| 10 |
TOP_P = 0.9
|
| 11 |
|
| 12 |
# Retrieve the API token from environment variables
|
|
|
|
| 37 |
f"""<s>[INST] You are JR-Sacred Syntax, an expert biblical scholar specializing in Bible analysis.
|
| 38 |
Analyze the following Bible passage to identify any figures of speech (e.g., Metaphor, Synecdoche, Hyperbole, Simile, Paradox, and others).
|
| 39 |
Return your answer as a JSON array where each element includes:
|
| 40 |
+
- "verses": Display the Bible verse(s) in NJV with the verses number,
|
| 41 |
+
- "figure": identify the type of figure of speech(s) in each of the verses,
|
| 42 |
- "definition": define the figure of speech you identified,
|
| 43 |
+
- "phrase": Give the exact phrase from the verse,
|
| 44 |
+
- "explanation": Give a brief explanation in the biblical context.
|
| 45 |
Consider each verse individually and provide a detailed analysis.
|
| 46 |
Bible Passage: "{text}"
|
| 47 |
[/INST] Figures: </s>"""
|