Josebert commited on
Commit
dda7a68
·
verified ·
1 Parent(s): c31778b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -10
app.py CHANGED
@@ -1,7 +1,7 @@
1
  import os
2
  import gradio as gr
3
  import requests
4
- import json # Import the json module
5
 
6
  # Run the Hugging Face CLI login command.
7
  os.system("huggingface-cli login")
@@ -21,20 +21,15 @@ def generate_exegesis(passage):
21
  if not passage.strip():
22
  return "Please enter a Bible passage."
23
 
24
- prompt = (
25
- "You are a professional Bible Scholar. Provide a detailed exegesis of the following biblical verse, including:"
26
- " The original Greek text and transliteration with word-by-word analysis and meanings, historical and cultural context,"
27
- " and theological significance for:\n\n"
28
- f"{passage}\n\nExegesis:"
29
- )
30
 
31
  payload = {
32
  "inputs": prompt,
33
  }
34
 
35
- # If the above doesn't work, try this
36
- # payload = prompt
37
-
38
  try:
39
  response = requests.post(API_URL, headers=HEADERS, json=payload)
40
  response.raise_for_status() # Raise an error for bad responses (4xx, 5xx)
 
1
  import os
2
  import gradio as gr
3
  import requests
4
+ import json # Import the json module
5
 
6
  # Run the Hugging Face CLI login command.
7
  os.system("huggingface-cli login")
 
21
  if not passage.strip():
22
  return "Please enter a Bible passage."
23
 
24
+ prompt = f"""<s>[INST] You are a professional Bible Scholar. Provide a detailed exegesis of the following biblical verse, including:
25
+ The original Greek text and transliteration with word-by-word analysis and meanings, historical and cultural context, and theological significance for:
26
+
27
+ {passage} [/INST] Exegesis:</s>"""
 
 
28
 
29
  payload = {
30
  "inputs": prompt,
31
  }
32
 
 
 
 
33
  try:
34
  response = requests.post(API_URL, headers=HEADERS, json=payload)
35
  response.raise_for_status() # Raise an error for bad responses (4xx, 5xx)