vikramvasudevan commited on
Commit
0dfd87b
·
verified ·
1 Parent(s): 3da03c3

Upload folder using huggingface_hub

Browse files
Files changed (2) hide show
  1. app.py +9 -3
  2. config.py +10 -7
app.py CHANGED
@@ -44,16 +44,21 @@ def chat(message, history, thread_id):
44
 
45
  thread_id = gr.State(init_session)
46
  supported_scriptures = "\n - ".join(
47
- [scripture["title"] for scripture in SanatanConfig.scriptures]
48
  )
49
  intro_messages = [
50
  {"role" : "assistant","content" : f"Namaskaram! I can assist with the following scriptures: \n - {supported_scriptures}"},
51
  {"role" : "assistant","content" : """
52
  #### You can ask me questions like:
53
- - How do all scriptures describe the form of Vishnu?
54
  - What did Krishna teach in Gita?
55
  - How did Arjun react on seeing the Vishwarupa form of Krishna?
56
  - Give some names of Vishnu from Sahasranamam.
 
 
 
 
 
57
  """}
58
  ]
59
  chatbot = gr.Chatbot(
@@ -64,7 +69,8 @@ chatbot = gr.Chatbot(
64
  show_copy_button=True,
65
  show_copy_all_button=True,
66
  type="messages",
67
- height=800
 
68
  )
69
  chatInterface = gr.ChatInterface(title="Sanatan-AI",
70
  fn=chat, additional_inputs=[thread_id], chatbot=chatbot
 
44
 
45
  thread_id = gr.State(init_session)
46
  supported_scriptures = "\n - ".join(
47
+ [f"{scripture['title']} [source]({scripture['source']})" for scripture in SanatanConfig.scriptures]
48
  )
49
  intro_messages = [
50
  {"role" : "assistant","content" : f"Namaskaram! I can assist with the following scriptures: \n - {supported_scriptures}"},
51
  {"role" : "assistant","content" : """
52
  #### You can ask me questions like:
53
+ - How do all scriptures describe the form of God?
54
  - What did Krishna teach in Gita?
55
  - How did Arjun react on seeing the Vishwarupa form of Krishna?
56
  - Give some names of Vishnu from Sahasranamam.
57
+ - Give me a pasuram by Andal
58
+ - explain sakrudeva prapannaaya shlokam in ramayana
59
+ - give the shlokam in ramayanam that vibheeshana uses to perform sharanagathi to rama, give the sanskrit shlokam and its meaning
60
+ - give one name in vishnu sahasranamam related to "cause"
61
+ - explain name of vishnu in sahasranamam related to wheel
62
  """}
63
  ]
64
  chatbot = gr.Chatbot(
 
69
  show_copy_button=True,
70
  show_copy_all_button=True,
71
  type="messages",
72
+ height=700,
73
+ render_markdown=True
74
  )
75
  chatInterface = gr.ChatInterface(title="Sanatan-AI",
76
  fn=chat, additional_inputs=[thread_id], chatbot=chatbot
config.py CHANGED
@@ -15,6 +15,7 @@ class SanatanConfig:
15
  "output_dir": "./output/vishnu_puranam",
16
  "collection_name": "vishnu_puranam",
17
  "pdf_path": "./data/vishnu_puranam.pdf",
 
18
  "language": "san+eng",
19
  "example_labels": [
20
  "Vishnu's form",
@@ -35,6 +36,7 @@ class SanatanConfig:
35
  "output_dir": "./output/shukla_yajur_vedam",
36
  "collection_name": "shukla_yajur_vedam",
37
  "pdf_path": "./data/shukla-yajur-veda.pdf",
 
38
  "language": "san+eng",
39
  "example_labels": [
40
  "About Vedam",
@@ -53,6 +55,7 @@ class SanatanConfig:
53
  "output_dir": "./output/bhagavat_gita",
54
  "collection_name": "bhagavat_gita",
55
  "pdf_path": "./data/bhagavat_gita.pdf",
 
56
  "language": "san+eng",
57
  "example_labels": [
58
  "About Arjuna",
@@ -75,6 +78,7 @@ class SanatanConfig:
75
  "output_dir": "./output/valmiki_ramayanam",
76
  "collection_name": "valmiki_ramayanam",
77
  "pdf_path": "./data/valmiki_ramayanam.pdf",
 
78
  "language": "san+eng",
79
  "example_labels": [
80
  "About Jatayu",
@@ -97,6 +101,7 @@ class SanatanConfig:
97
  "output_dir": "./output/vishnu_sahasranamam",
98
  "collection_name": "vishnu_sahasranamam",
99
  "pdf_path": "./data/vishnu_sahasranamam.pdf",
 
100
  "language": "san+eng",
101
  "example_labels": ["Vanamali", "1000 names", "Sanskrit text search"],
102
  "examples": [
@@ -111,6 +116,7 @@ class SanatanConfig:
111
  "output_dir": "./output/divya_prabandham",
112
  "collection_name": "divya_prabandham",
113
  "pdf_path": "./data/divya_prabandham.pdf",
 
114
  "language": "tam",
115
  "example_labels": [
116
  "Vishnu's form",
@@ -131,15 +137,12 @@ class SanatanConfig:
131
  "output_dir": "./output/bhagavata_purana",
132
  "collection_name": "bhagavata_purana",
133
  "pdf_path": "./data/bhagavata_purana.pdf",
 
134
  "language": "san+eng",
135
- "example_labels": [
136
- "Gajendra Moksham",
137
- "Prahalad"
138
- ],
139
  "examples": [
140
  "State some verses that showcase the devotion of Gajendra the elephant",
141
- "State some verses that showcase the devotion of Prahlada"
142
- ]
143
  },
144
-
145
  ]
 
15
  "output_dir": "./output/vishnu_puranam",
16
  "collection_name": "vishnu_puranam",
17
  "pdf_path": "./data/vishnu_puranam.pdf",
18
+ "source": "https://dn720005.ca.archive.org/0/items/vishnu-purana-sanskrit-english-ocr/VISHNU-PURANA-Sanskrit-English-OCR.pdf",
19
  "language": "san+eng",
20
  "example_labels": [
21
  "Vishnu's form",
 
36
  "output_dir": "./output/shukla_yajur_vedam",
37
  "collection_name": "shukla_yajur_vedam",
38
  "pdf_path": "./data/shukla-yajur-veda.pdf",
39
+ "source": "https://www.thearyasamaj.org/uploads/book/2014/04/R1sSjG_eLb_sub_406_yajurveda.pdf",
40
  "language": "san+eng",
41
  "example_labels": [
42
  "About Vedam",
 
55
  "output_dir": "./output/bhagavat_gita",
56
  "collection_name": "bhagavat_gita",
57
  "pdf_path": "./data/bhagavat_gita.pdf",
58
+ "source": "https://dn790006.ca.archive.org/0/items/in.gov.ignca.279/279_text.pdf",
59
  "language": "san+eng",
60
  "example_labels": [
61
  "About Arjuna",
 
78
  "output_dir": "./output/valmiki_ramayanam",
79
  "collection_name": "valmiki_ramayanam",
80
  "pdf_path": "./data/valmiki_ramayanam.pdf",
81
+ "source": "https://ia800509.us.archive.org/28/items/valmiki-ramayana-gita-press-english/Valmiki%20Ramayana%20Gita%20Press%20English.pdf",
82
  "language": "san+eng",
83
  "example_labels": [
84
  "About Jatayu",
 
101
  "output_dir": "./output/vishnu_sahasranamam",
102
  "collection_name": "vishnu_sahasranamam",
103
  "pdf_path": "./data/vishnu_sahasranamam.pdf",
104
+ "source": "https://www.swami-krishnananda.org/vishnu/vishnu_1.html",
105
  "language": "san+eng",
106
  "example_labels": ["Vanamali", "1000 names", "Sanskrit text search"],
107
  "examples": [
 
116
  "output_dir": "./output/divya_prabandham",
117
  "collection_name": "divya_prabandham",
118
  "pdf_path": "./data/divya_prabandham.pdf",
119
+ "source": "https://uveda.org",
120
  "language": "tam",
121
  "example_labels": [
122
  "Vishnu's form",
 
137
  "output_dir": "./output/bhagavata_purana",
138
  "collection_name": "bhagavata_purana",
139
  "pdf_path": "./data/bhagavata_purana.pdf",
140
+ "source": "https://dn790003.ca.archive.org/0/items/bhagavatapuranagitapress_201907/Bhagavata%20Purana%20-%20Gita%20Press_text.pdf",
141
  "language": "san+eng",
142
+ "example_labels": ["Gajendra Moksham", "Prahalad"],
 
 
 
143
  "examples": [
144
  "State some verses that showcase the devotion of Gajendra the elephant",
145
+ "State some verses that showcase the devotion of Prahlada",
146
+ ],
147
  },
 
148
  ]