Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Upload folder using huggingface_hub
Browse files- modules/config/bhagavat_gita.py +2 -1
- modules/config/bhagavata_purana.py +4 -1
- modules/config/categories.py +58 -0
- modules/config/chathusloki.py +4 -1
- modules/config/divya_prabandham.py +2 -1
- modules/config/kamba_ramayanam.py +4 -1
- modules/config/kamba_ramayanam_en.py +2 -1
- modules/config/katakam.py +4 -1
- modules/config/pancha_sooktham.py +2 -1
- modules/config/shanthi_panchakam.py +2 -1
- modules/config/shukla_yajur_vedam.py +4 -1
- modules/config/sri_stavam.py +4 -1
- modules/config/taitriya_brahmanam.py +4 -1
- modules/config/taitriya_samhitha.py +4 -1
- modules/config/taitriya_upanishad.py +2 -1
- modules/config/valmiki_ramayanam.py +4 -1
- modules/config/vishnu_puranam.py +4 -1
- modules/config/vishnu_sahasranamam.py +2 -1
- modules/config/yt_metadata.py +4 -1
- server.py +6 -0
modules/config/bhagavat_gita.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
from modules.scripture_helpers.bhagavat_gita_helper import (
|
| 2 |
get_bhagavat_gita_chapters,
|
| 3 |
get_chapter_order_from_bhagavat_gita,
|
|
@@ -6,7 +7,7 @@ from modules.scripture_helpers.bhagavat_gita_helper import (
|
|
| 6 |
bhagavat_gita_config = {
|
| 7 |
"name": "bhagavat_gita",
|
| 8 |
"title": "Bhagavat Gita",
|
| 9 |
-
"category" :
|
| 10 |
"output_dir": "./output/bhagavat_gita",
|
| 11 |
"collection_name": "bhagavat_gita_openai",
|
| 12 |
"collection_embedding_fn": "openai",
|
|
|
|
| 1 |
+
from modules.config.categories import ScriptureCategoryConstants
|
| 2 |
from modules.scripture_helpers.bhagavat_gita_helper import (
|
| 3 |
get_bhagavat_gita_chapters,
|
| 4 |
get_chapter_order_from_bhagavat_gita,
|
|
|
|
| 7 |
bhagavat_gita_config = {
|
| 8 |
"name": "bhagavat_gita",
|
| 9 |
"title": "Bhagavat Gita",
|
| 10 |
+
"category" : ScriptureCategoryConstants.ITHIHASAM,
|
| 11 |
"output_dir": "./output/bhagavat_gita",
|
| 12 |
"collection_name": "bhagavat_gita_openai",
|
| 13 |
"collection_embedding_fn": "openai",
|
modules/config/bhagavata_purana.py
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
| 1 |
bhagavata_purana_config = {
|
| 2 |
"name": "bhagavata_purana",
|
| 3 |
"title": "Bhagavatha Puranam",
|
| 4 |
-
"category" :
|
| 5 |
"output_dir": "./output/bhagavata_purana",
|
| 6 |
"collection_name": "bhagavata_purana",
|
| 7 |
"unit": "page",
|
|
|
|
| 1 |
+
from modules.config.categories import ScriptureCategoryConstants
|
| 2 |
+
|
| 3 |
+
|
| 4 |
bhagavata_purana_config = {
|
| 5 |
"name": "bhagavata_purana",
|
| 6 |
"title": "Bhagavatha Puranam",
|
| 7 |
+
"category" : ScriptureCategoryConstants.PURANAM,
|
| 8 |
"output_dir": "./output/bhagavata_purana",
|
| 9 |
"collection_name": "bhagavata_purana",
|
| 10 |
"unit": "page",
|
modules/config/categories.py
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from dataclasses import dataclass
|
| 2 |
+
from typing import List
|
| 3 |
+
from pydantic import BaseModel
|
| 4 |
+
|
| 5 |
+
@dataclass
|
| 6 |
+
class ScriptureCategoryConstants():
|
| 7 |
+
LITERATURE: str = "literature"
|
| 8 |
+
VEDAM: str = "vedam"
|
| 9 |
+
ITHIHASAM: str = "ithihasam"
|
| 10 |
+
PURANAM: str = "puranam"
|
| 11 |
+
STOTRAM: str = "stotram"
|
| 12 |
+
SOCIAL_MEDIA: str = "social"
|
| 13 |
+
|
| 14 |
+
@dataclass
|
| 15 |
+
class ScriptureCategory():
|
| 16 |
+
name: str
|
| 17 |
+
title: str
|
| 18 |
+
|
| 19 |
+
@dataclass
|
| 20 |
+
class ScriptureCategories():
|
| 21 |
+
categories: list[ScriptureCategory]
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
scripture_categories = ScriptureCategories(
|
| 25 |
+
categories=[
|
| 26 |
+
ScriptureCategory(
|
| 27 |
+
name=ScriptureCategoryConstants.LITERATURE,
|
| 28 |
+
title="Devotional Literature (அருளிச்செயல்)",
|
| 29 |
+
),
|
| 30 |
+
ScriptureCategory(
|
| 31 |
+
name=ScriptureCategoryConstants.VEDAM, title="Vedas & Upanishads"
|
| 32 |
+
),
|
| 33 |
+
ScriptureCategory(
|
| 34 |
+
name=ScriptureCategoryConstants.ITHIHASAM, title="Ithihasams"
|
| 35 |
+
),
|
| 36 |
+
ScriptureCategory(name=ScriptureCategoryConstants.PURANAM, title="Puranams"),
|
| 37 |
+
ScriptureCategory(name=ScriptureCategoryConstants.STOTRAM, title="Stotrams"),
|
| 38 |
+
ScriptureCategory(
|
| 39 |
+
name=ScriptureCategoryConstants.SOCIAL_MEDIA, title="Social Media"
|
| 40 |
+
),
|
| 41 |
+
]
|
| 42 |
+
)
|
| 43 |
+
|
| 44 |
+
|
| 45 |
+
def get_scripture_category_by_name(name: str):
|
| 46 |
+
matches = [
|
| 47 |
+
category
|
| 48 |
+
for category in scripture_categories.categories
|
| 49 |
+
if category.name == name
|
| 50 |
+
]
|
| 51 |
+
if matches:
|
| 52 |
+
return matches[0]
|
| 53 |
+
else:
|
| 54 |
+
raise Exception(f"No category found by name [{name}]!")
|
| 55 |
+
|
| 56 |
+
|
| 57 |
+
def get_scripture_categories():
|
| 58 |
+
return scripture_categories
|
modules/config/chathusloki.py
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
| 1 |
chathusloki_config = {
|
| 2 |
"name": "chathusloki",
|
| 3 |
"title": "Chathusloki by Sri Alavandar",
|
| 4 |
-
"category" :
|
| 5 |
"output_dir": "./output/chathusloki",
|
| 6 |
"collection_name": "chathusloki",
|
| 7 |
"unit": "verse",
|
|
|
|
| 1 |
+
from modules.config.categories import ScriptureCategoryConstants
|
| 2 |
+
|
| 3 |
+
|
| 4 |
chathusloki_config = {
|
| 5 |
"name": "chathusloki",
|
| 6 |
"title": "Chathusloki by Sri Alavandar",
|
| 7 |
+
"category" : ScriptureCategoryConstants.STOTRAM,
|
| 8 |
"output_dir": "./output/chathusloki",
|
| 9 |
"collection_name": "chathusloki",
|
| 10 |
"unit": "verse",
|
modules/config/divya_prabandham.py
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
|
|
| 1 |
import nalayiram_helper
|
| 2 |
|
| 3 |
divya_prabandham_config = {
|
| 4 |
"name": "divya_prabandham",
|
| 5 |
"title": "4000 Divya Prabandham",
|
| 6 |
-
"category" :
|
| 7 |
"output_dir": "./output/divya_prabandham",
|
| 8 |
"collection_name": "divya_prabandham",
|
| 9 |
"collection_embedding_fn": "openai",
|
|
|
|
| 1 |
+
from modules.config.categories import ScriptureCategoryConstants
|
| 2 |
import nalayiram_helper
|
| 3 |
|
| 4 |
divya_prabandham_config = {
|
| 5 |
"name": "divya_prabandham",
|
| 6 |
"title": "4000 Divya Prabandham",
|
| 7 |
+
"category" : ScriptureCategoryConstants.LITERATURE,
|
| 8 |
"output_dir": "./output/divya_prabandham",
|
| 9 |
"collection_name": "divya_prabandham",
|
| 10 |
"collection_embedding_fn": "openai",
|
modules/config/kamba_ramayanam.py
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
| 1 |
kamba_ramayanam_config = {
|
| 2 |
"name": "kamba_ramayanam",
|
| 3 |
"title": "Kamba Ramayanam (Tamil)",
|
| 4 |
-
"category" :
|
| 5 |
"output_dir": "./output/kamba_ramayanam",
|
| 6 |
"collection_name": "kamba_ramayanam",
|
| 7 |
"unit": "chunk",
|
|
|
|
| 1 |
+
from modules.config.categories import ScriptureCategoryConstants
|
| 2 |
+
|
| 3 |
+
|
| 4 |
kamba_ramayanam_config = {
|
| 5 |
"name": "kamba_ramayanam",
|
| 6 |
"title": "Kamba Ramayanam (Tamil)",
|
| 7 |
+
"category" : ScriptureCategoryConstants.ITHIHASAM,
|
| 8 |
"output_dir": "./output/kamba_ramayanam",
|
| 9 |
"collection_name": "kamba_ramayanam",
|
| 10 |
"unit": "chunk",
|
modules/config/kamba_ramayanam_en.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
from modules.scripture_helpers.kamba_ramayanam_helper import (
|
| 2 |
get_list_of_kandams,
|
| 3 |
get_list_of_padalams,
|
|
@@ -7,7 +8,7 @@ from modules.scripture_helpers.kamba_ramayanam_helper import (
|
|
| 7 |
kamba_ramayanam_en_config = {
|
| 8 |
"name": "kamba_ramayanam_en",
|
| 9 |
"title": "Kamba Ramayanam (English)",
|
| 10 |
-
"category" :
|
| 11 |
"output_dir": "./output/kamba_ramayanam",
|
| 12 |
"collection_name": "kamba_ramayanam_en",
|
| 13 |
"unit": "verse",
|
|
|
|
| 1 |
+
from modules.config.categories import ScriptureCategoryConstants
|
| 2 |
from modules.scripture_helpers.kamba_ramayanam_helper import (
|
| 3 |
get_list_of_kandams,
|
| 4 |
get_list_of_padalams,
|
|
|
|
| 8 |
kamba_ramayanam_en_config = {
|
| 9 |
"name": "kamba_ramayanam_en",
|
| 10 |
"title": "Kamba Ramayanam (English)",
|
| 11 |
+
"category" : ScriptureCategoryConstants.ITHIHASAM,
|
| 12 |
"output_dir": "./output/kamba_ramayanam",
|
| 13 |
"collection_name": "kamba_ramayanam_en",
|
| 14 |
"unit": "verse",
|
modules/config/katakam.py
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
| 1 |
katakam_config = {
|
| 2 |
"name": "katakam",
|
| 3 |
"title": "Katakam",
|
| 4 |
-
"category" :
|
| 5 |
"output_dir": "./output/katakam",
|
| 6 |
"collection_name": "katakam",
|
| 7 |
"collection_embedding_fn": "openai",
|
|
|
|
| 1 |
+
from modules.config.categories import ScriptureCategoryConstants
|
| 2 |
+
|
| 3 |
+
|
| 4 |
katakam_config = {
|
| 5 |
"name": "katakam",
|
| 6 |
"title": "Katakam",
|
| 7 |
+
"category" : ScriptureCategoryConstants.VEDAM,
|
| 8 |
"output_dir": "./output/katakam",
|
| 9 |
"collection_name": "katakam",
|
| 10 |
"collection_embedding_fn": "openai",
|
modules/config/pancha_sooktham.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
from modules.scripture_helpers.pancha_sooktham_helper import (
|
| 2 |
get_chapter_order_from_pancha_sooktham,
|
| 3 |
get_pancha_sooktham_chapters,
|
|
@@ -5,7 +6,7 @@ from modules.scripture_helpers.pancha_sooktham_helper import (
|
|
| 5 |
pancha_sooktham_config = {
|
| 6 |
"name": "pancha_sooktham",
|
| 7 |
"title": "Pancha Sooktham",
|
| 8 |
-
"category" :
|
| 9 |
"output_dir": "./output/pancha_sooktham",
|
| 10 |
"collection_name": "pancha_sooktham",
|
| 11 |
"collection_embedding_fn": "openai",
|
|
|
|
| 1 |
+
from modules.config.categories import ScriptureCategoryConstants
|
| 2 |
from modules.scripture_helpers.pancha_sooktham_helper import (
|
| 3 |
get_chapter_order_from_pancha_sooktham,
|
| 4 |
get_pancha_sooktham_chapters,
|
|
|
|
| 6 |
pancha_sooktham_config = {
|
| 7 |
"name": "pancha_sooktham",
|
| 8 |
"title": "Pancha Sooktham",
|
| 9 |
+
"category" : ScriptureCategoryConstants.VEDAM,
|
| 10 |
"output_dir": "./output/pancha_sooktham",
|
| 11 |
"collection_name": "pancha_sooktham",
|
| 12 |
"collection_embedding_fn": "openai",
|
modules/config/shanthi_panchakam.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
from modules.scripture_helpers.shanthi_panchakam_helper import (
|
| 2 |
get_chapter_order_from_shanthi_panchakam,
|
| 3 |
get_shanthi_panchakam_chapters,
|
|
@@ -6,7 +7,7 @@ from modules.scripture_helpers.shanthi_panchakam_helper import (
|
|
| 6 |
shanthi_panchakam_config = {
|
| 7 |
"name": "shanthi_panchakam",
|
| 8 |
"title": "Shanthi Panchakam",
|
| 9 |
-
"category" :
|
| 10 |
"output_dir": "./output/shanthi_panchakam",
|
| 11 |
"collection_name": "shanthi_panchakam",
|
| 12 |
"collection_embedding_fn": "openai",
|
|
|
|
| 1 |
+
from modules.config.categories import ScriptureCategoryConstants
|
| 2 |
from modules.scripture_helpers.shanthi_panchakam_helper import (
|
| 3 |
get_chapter_order_from_shanthi_panchakam,
|
| 4 |
get_shanthi_panchakam_chapters,
|
|
|
|
| 7 |
shanthi_panchakam_config = {
|
| 8 |
"name": "shanthi_panchakam",
|
| 9 |
"title": "Shanthi Panchakam",
|
| 10 |
+
"category" : ScriptureCategoryConstants.VEDAM,
|
| 11 |
"output_dir": "./output/shanthi_panchakam",
|
| 12 |
"collection_name": "shanthi_panchakam",
|
| 13 |
"collection_embedding_fn": "openai",
|
modules/config/shukla_yajur_vedam.py
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
| 1 |
shukla_yajur_vedam_config = {
|
| 2 |
"name": "shukla_yajur_vedam",
|
| 3 |
"title": "Shukla Yajur Vedam",
|
| 4 |
-
"category" :
|
| 5 |
"output_dir": "./output/shukla_yajur_vedam",
|
| 6 |
"collection_name": "shukla_yajur_vedam",
|
| 7 |
"unit": "page",
|
|
|
|
| 1 |
+
from modules.config.categories import ScriptureCategoryConstants
|
| 2 |
+
|
| 3 |
+
|
| 4 |
shukla_yajur_vedam_config = {
|
| 5 |
"name": "shukla_yajur_vedam",
|
| 6 |
"title": "Shukla Yajur Vedam",
|
| 7 |
+
"category" : ScriptureCategoryConstants.VEDAM,
|
| 8 |
"output_dir": "./output/shukla_yajur_vedam",
|
| 9 |
"collection_name": "shukla_yajur_vedam",
|
| 10 |
"unit": "page",
|
modules/config/sri_stavam.py
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
| 1 |
sri_stavam_config = {
|
| 2 |
"name": "sri_stavam",
|
| 3 |
"title": "Sri Stavam by Sri Koorathazhwan",
|
| 4 |
-
"category" :
|
| 5 |
"output_dir": "./output/sri_stavam",
|
| 6 |
"collection_name": "sri_stavam",
|
| 7 |
"unit": "slokam",
|
|
|
|
| 1 |
+
from modules.config.categories import ScriptureCategoryConstants
|
| 2 |
+
|
| 3 |
+
|
| 4 |
sri_stavam_config = {
|
| 5 |
"name": "sri_stavam",
|
| 6 |
"title": "Sri Stavam by Sri Koorathazhwan",
|
| 7 |
+
"category" : ScriptureCategoryConstants.STOTRAM,
|
| 8 |
"output_dir": "./output/sri_stavam",
|
| 9 |
"collection_name": "sri_stavam",
|
| 10 |
"unit": "slokam",
|
modules/config/taitriya_brahmanam.py
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
| 1 |
taitriya_brahmanam_config = {
|
| 2 |
"name": "taitriya_brahmanam",
|
| 3 |
"title": "Taitriya Brahmanam",
|
| 4 |
-
"category" :
|
| 5 |
"output_dir": "./output/taitriya_brahmanam",
|
| 6 |
"collection_name": "taitriya_brahmanam",
|
| 7 |
"collection_embedding_fn": "openai",
|
|
|
|
| 1 |
+
from modules.config.categories import ScriptureCategoryConstants
|
| 2 |
+
|
| 3 |
+
|
| 4 |
taitriya_brahmanam_config = {
|
| 5 |
"name": "taitriya_brahmanam",
|
| 6 |
"title": "Taitriya Brahmanam",
|
| 7 |
+
"category" : ScriptureCategoryConstants.VEDAM,
|
| 8 |
"output_dir": "./output/taitriya_brahmanam",
|
| 9 |
"collection_name": "taitriya_brahmanam",
|
| 10 |
"collection_embedding_fn": "openai",
|
modules/config/taitriya_samhitha.py
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
| 1 |
taitriya_samhitha_config = {
|
| 2 |
"name": "taitriya_samhitha",
|
| 3 |
"title": "Taitriya Samhitha",
|
| 4 |
-
"category" :
|
| 5 |
"output_dir": "./output/taitriya_samhitha",
|
| 6 |
"collection_name": "taitriya_samhitha",
|
| 7 |
"collection_embedding_fn": "openai",
|
|
|
|
| 1 |
+
from modules.config.categories import ScriptureCategoryConstants
|
| 2 |
+
|
| 3 |
+
|
| 4 |
taitriya_samhitha_config = {
|
| 5 |
"name": "taitriya_samhitha",
|
| 6 |
"title": "Taitriya Samhitha",
|
| 7 |
+
"category" : ScriptureCategoryConstants.VEDAM,
|
| 8 |
"output_dir": "./output/taitriya_samhitha",
|
| 9 |
"collection_name": "taitriya_samhitha",
|
| 10 |
"collection_embedding_fn": "openai",
|
modules/config/taitriya_upanishad.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
from modules.scripture_helpers.taitriya_upanishad_helper import (
|
| 2 |
get_chapter_order_from_taitriya_upanishad,
|
| 3 |
get_taitriya_upanishad_chapters,
|
|
@@ -6,7 +7,7 @@ from modules.scripture_helpers.taitriya_upanishad_helper import (
|
|
| 6 |
taitriya_upanishad_config = {
|
| 7 |
"name": "taitriya_upanishad",
|
| 8 |
"title": "Taitriya Upanishad",
|
| 9 |
-
"category" :
|
| 10 |
"output_dir": "./output/taitriya_upanishad",
|
| 11 |
"collection_name": "taitriya_upanishad",
|
| 12 |
"collection_embedding_fn": "openai",
|
|
|
|
| 1 |
+
from modules.config.categories import ScriptureCategoryConstants
|
| 2 |
from modules.scripture_helpers.taitriya_upanishad_helper import (
|
| 3 |
get_chapter_order_from_taitriya_upanishad,
|
| 4 |
get_taitriya_upanishad_chapters,
|
|
|
|
| 7 |
taitriya_upanishad_config = {
|
| 8 |
"name": "taitriya_upanishad",
|
| 9 |
"title": "Taitriya Upanishad",
|
| 10 |
+
"category" : ScriptureCategoryConstants.VEDAM,
|
| 11 |
"output_dir": "./output/taitriya_upanishad",
|
| 12 |
"collection_name": "taitriya_upanishad",
|
| 13 |
"collection_embedding_fn": "openai",
|
modules/config/valmiki_ramayanam.py
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
| 1 |
valmiki_ramayanam_config = {
|
| 2 |
"name": "valmiki_ramayanam",
|
| 3 |
"title": "Valmiki Ramayanam",
|
| 4 |
-
"category" :
|
| 5 |
"output_dir": "./output/valmiki_ramayanam",
|
| 6 |
"collection_name": "valmiki_ramayanam_openai",
|
| 7 |
"collection_embedding_fn": "openai",
|
|
|
|
| 1 |
+
from modules.config.categories import ScriptureCategoryConstants
|
| 2 |
+
|
| 3 |
+
|
| 4 |
valmiki_ramayanam_config = {
|
| 5 |
"name": "valmiki_ramayanam",
|
| 6 |
"title": "Valmiki Ramayanam",
|
| 7 |
+
"category" : ScriptureCategoryConstants.ITHIHASAM,
|
| 8 |
"output_dir": "./output/valmiki_ramayanam",
|
| 9 |
"collection_name": "valmiki_ramayanam_openai",
|
| 10 |
"collection_embedding_fn": "openai",
|
modules/config/vishnu_puranam.py
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
| 1 |
vishnu_puranam_config = {
|
| 2 |
"name": "vishnu_puranam",
|
| 3 |
"title": "Sri Vishnu Puranam",
|
| 4 |
-
"category" :
|
| 5 |
"output_dir": "./output/vishnu_puranam",
|
| 6 |
"collection_name": "vishnu_puranam_openai",
|
| 7 |
"collection_embedding_fn": "openai",
|
|
|
|
| 1 |
+
from modules.config.categories import ScriptureCategoryConstants
|
| 2 |
+
|
| 3 |
+
|
| 4 |
vishnu_puranam_config = {
|
| 5 |
"name": "vishnu_puranam",
|
| 6 |
"title": "Sri Vishnu Puranam",
|
| 7 |
+
"category" : ScriptureCategoryConstants.PURANAM,
|
| 8 |
"output_dir": "./output/vishnu_puranam",
|
| 9 |
"collection_name": "vishnu_puranam_openai",
|
| 10 |
"collection_embedding_fn": "openai",
|
modules/config/vishnu_sahasranamam.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
from modules.scripture_helpers.vishnu_sahasranamam_helper import (
|
| 2 |
get_chapter_order_from_sahasranamam,
|
| 3 |
get_chapters_from_sahasranamam,
|
|
@@ -6,7 +7,7 @@ from modules.scripture_helpers.vishnu_sahasranamam_helper import (
|
|
| 6 |
vishnu_sahasranamam_config = {
|
| 7 |
"name": "vishnu_sahasranamam",
|
| 8 |
"title": "Vishnu Sahasranamam",
|
| 9 |
-
"category" :
|
| 10 |
"output_dir": "./output/vishnu_sahasranamam",
|
| 11 |
"collection_name": "vishnu_sahasranamam_openai",
|
| 12 |
"collection_embedding_fn": "openai",
|
|
|
|
| 1 |
+
from modules.config.categories import ScriptureCategoryConstants
|
| 2 |
from modules.scripture_helpers.vishnu_sahasranamam_helper import (
|
| 3 |
get_chapter_order_from_sahasranamam,
|
| 4 |
get_chapters_from_sahasranamam,
|
|
|
|
| 7 |
vishnu_sahasranamam_config = {
|
| 8 |
"name": "vishnu_sahasranamam",
|
| 9 |
"title": "Vishnu Sahasranamam",
|
| 10 |
+
"category" : ScriptureCategoryConstants.STOTRAM,
|
| 11 |
"output_dir": "./output/vishnu_sahasranamam",
|
| 12 |
"collection_name": "vishnu_sahasranamam_openai",
|
| 13 |
"collection_embedding_fn": "openai",
|
modules/config/yt_metadata.py
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
| 1 |
yt_metadata_config = {
|
| 2 |
"name": "yt_metadata",
|
| 3 |
"title": "Sampradayam in YouTube",
|
| 4 |
-
"category" :
|
| 5 |
"output_dir": "./output/yt_metadata",
|
| 6 |
"collection_name": "yt_metadata",
|
| 7 |
"collection_embedding_fn": "openai",
|
|
|
|
| 1 |
+
from modules.config.categories import ScriptureCategoryConstants
|
| 2 |
+
|
| 3 |
+
|
| 4 |
yt_metadata_config = {
|
| 5 |
"name": "yt_metadata",
|
| 6 |
"title": "Sampradayam in YouTube",
|
| 7 |
+
"category" : ScriptureCategoryConstants.SOCIAL_MEDIA,
|
| 8 |
"output_dir": "./output/yt_metadata",
|
| 9 |
"collection_name": "yt_metadata",
|
| 10 |
"collection_embedding_fn": "openai",
|
server.py
CHANGED
|
@@ -14,6 +14,7 @@ from db import SanatanDatabase
|
|
| 14 |
from metadata import MetadataWhereClause
|
| 15 |
from modules.audio.model import AudioRequest
|
| 16 |
from modules.audio.service import svc_get_audio_urls
|
|
|
|
| 17 |
from modules.quiz.answer_validator import validate_answer
|
| 18 |
from modules.quiz.models import Question
|
| 19 |
from modules.quiz.quiz_helper import generate_question
|
|
@@ -341,3 +342,8 @@ async def generate_audio_urls(req: VideoRequest):
|
|
| 341 |
logger.info("generate_audio_urls: %s", req)
|
| 342 |
video_urls = await svc_get_video_urls(req)
|
| 343 |
return video_urls
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
from metadata import MetadataWhereClause
|
| 15 |
from modules.audio.model import AudioRequest
|
| 16 |
from modules.audio.service import svc_get_audio_urls
|
| 17 |
+
from modules.config.categories import get_scripture_categories
|
| 18 |
from modules.quiz.answer_validator import validate_answer
|
| 19 |
from modules.quiz.models import Question
|
| 20 |
from modules.quiz.quiz_helper import generate_question
|
|
|
|
| 342 |
logger.info("generate_audio_urls: %s", req)
|
| 343 |
video_urls = await svc_get_video_urls(req)
|
| 344 |
return video_urls
|
| 345 |
+
|
| 346 |
+
|
| 347 |
+
@router.get("/scripture_categories")
|
| 348 |
+
def route_get_scripture_categories():
|
| 349 |
+
return get_scripture_categories()
|