Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Upload folder using huggingface_hub
Browse files- copy_chromadb.py +5 -0
- modules/config/__init__.py +3 -1
- modules/config/categories.py +3 -3
- modules/config/sri_vachana_bhushanam.py +117 -0
copy_chromadb.py
CHANGED
|
@@ -78,6 +78,11 @@ db_config = {
|
|
| 78 |
"source_collection_name": "valmiki_ramayanam",
|
| 79 |
"destination_collection_name": "valmiki_ramayanam_openai",
|
| 80 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 81 |
}
|
| 82 |
|
| 83 |
parser = argparse.ArgumentParser(description="My app with database parameter")
|
|
|
|
| 78 |
"source_collection_name": "valmiki_ramayanam",
|
| 79 |
"destination_collection_name": "valmiki_ramayanam_openai",
|
| 80 |
},
|
| 81 |
+
"sri_vachana_bhushanam": {
|
| 82 |
+
"source_db_path": "../sri_vachana_bhushanam_ai/chromadb_store",
|
| 83 |
+
"source_collection_name": "sri_vachana_bhushanam",
|
| 84 |
+
"destination_collection_name": "sri_vachana_bhushanam",
|
| 85 |
+
},
|
| 86 |
}
|
| 87 |
|
| 88 |
parser = argparse.ArgumentParser(description="My app with database parameter")
|
modules/config/__init__.py
CHANGED
|
@@ -11,6 +11,7 @@ from modules.config.pancha_sooktham import pancha_sooktham_config
|
|
| 11 |
from modules.config.shanthi_panchakam import shanthi_panchakam_config
|
| 12 |
from modules.config.shukla_yajur_vedam import shukla_yajur_vedam_config
|
| 13 |
from modules.config.sri_stavam import sri_stavam_config
|
|
|
|
| 14 |
from modules.config.taitriya_aranyakam import taitriya_aranyakam_config
|
| 15 |
from modules.config.taitriya_brahmanam import taitriya_brahmanam_config
|
| 16 |
from modules.config.taitriya_samhitha import taitriya_samhitha_config
|
|
@@ -42,5 +43,6 @@ scripture_configurations = [
|
|
| 42 |
vishnu_puranam_config,
|
| 43 |
vishnu_sahasranamam_config,
|
| 44 |
yt_metadata_config,
|
| 45 |
-
brahma_sutra_config
|
|
|
|
| 46 |
]
|
|
|
|
| 11 |
from modules.config.shanthi_panchakam import shanthi_panchakam_config
|
| 12 |
from modules.config.shukla_yajur_vedam import shukla_yajur_vedam_config
|
| 13 |
from modules.config.sri_stavam import sri_stavam_config
|
| 14 |
+
from modules.config.sri_vachana_bhushanam import sri_vachana_bhushanam_config
|
| 15 |
from modules.config.taitriya_aranyakam import taitriya_aranyakam_config
|
| 16 |
from modules.config.taitriya_brahmanam import taitriya_brahmanam_config
|
| 17 |
from modules.config.taitriya_samhitha import taitriya_samhitha_config
|
|
|
|
| 43 |
vishnu_puranam_config,
|
| 44 |
vishnu_sahasranamam_config,
|
| 45 |
yt_metadata_config,
|
| 46 |
+
brahma_sutra_config,
|
| 47 |
+
sri_vachana_bhushanam_config
|
| 48 |
]
|
modules/config/categories.py
CHANGED
|
@@ -12,6 +12,7 @@ class ScriptureCategoryConstants:
|
|
| 12 |
STOTRAM: str = "stotram"
|
| 13 |
SOCIAL_MEDIA: str = "social"
|
| 14 |
VEDANTA: str = "vedanta"
|
|
|
|
| 15 |
|
| 16 |
|
| 17 |
@dataclass
|
|
@@ -42,9 +43,8 @@ scripture_categories = ScriptureCategories(
|
|
| 42 |
ScriptureCategory(
|
| 43 |
name=ScriptureCategoryConstants.SOCIAL_MEDIA, title="Social Media"
|
| 44 |
),
|
| 45 |
-
ScriptureCategory(
|
| 46 |
-
|
| 47 |
-
),
|
| 48 |
]
|
| 49 |
)
|
| 50 |
|
|
|
|
| 12 |
STOTRAM: str = "stotram"
|
| 13 |
SOCIAL_MEDIA: str = "social"
|
| 14 |
VEDANTA: str = "vedanta"
|
| 15 |
+
GRANTHAM: str = "grantham"
|
| 16 |
|
| 17 |
|
| 18 |
@dataclass
|
|
|
|
| 43 |
ScriptureCategory(
|
| 44 |
name=ScriptureCategoryConstants.SOCIAL_MEDIA, title="Social Media"
|
| 45 |
),
|
| 46 |
+
ScriptureCategory(name=ScriptureCategoryConstants.VEDANTA, title="Vedanta"),
|
| 47 |
+
ScriptureCategory(name=ScriptureCategoryConstants.GRANTHAM, title="Granthams"),
|
|
|
|
| 48 |
]
|
| 49 |
)
|
| 50 |
|
modules/config/sri_vachana_bhushanam.py
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from modules.config.categories import ScriptureCategoryConstants
|
| 2 |
+
from modules.google_drive.google_drive_utils import convert_drive_url_to_direct
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
sri_vachana_bhushanam_config = {
|
| 6 |
+
"name": "sri_vachana_bhushanam",
|
| 7 |
+
"title": "Sri Vachana Bhushanam",
|
| 8 |
+
"category": ScriptureCategoryConstants.GRANTHAM,
|
| 9 |
+
"output_dir": "./output/sri_vachana_bhushanam",
|
| 10 |
+
"collection_name": "sri_vachana_bhushanam",
|
| 11 |
+
"collection_embedding_fn": "openai",
|
| 12 |
+
"unit": "sutra",
|
| 13 |
+
"unit_field": "_global_index",
|
| 14 |
+
"chapter_order": lambda: {
|
| 15 |
+
"taniyans": 1,
|
| 16 |
+
"sutras": 2,
|
| 17 |
+
},
|
| 18 |
+
"field_mapping": {
|
| 19 |
+
"text": "sutra_text_ta",
|
| 20 |
+
"unit_index": "verse",
|
| 21 |
+
"chapter_name": lambda doc: (
|
| 22 |
+
f"{doc.get('chapter_name')}({doc.get('chapter_name_ta')})"
|
| 23 |
+
),
|
| 24 |
+
"author": lambda doc: f"Pillai Lokachariar",
|
| 25 |
+
"relative_path": lambda doc: (
|
| 26 |
+
f"{doc.get('chapter_name_ta')}:{doc.get('verse')} || {doc.get('_global_index')} ||"
|
| 27 |
+
),
|
| 28 |
+
},
|
| 29 |
+
"metadata_fields": [
|
| 30 |
+
{
|
| 31 |
+
"name": "chapter_name",
|
| 32 |
+
"datatype": "str",
|
| 33 |
+
"label": "Chapter Name",
|
| 34 |
+
"description": "Name of the Chapter in English",
|
| 35 |
+
"show_as_filter": True,
|
| 36 |
+
"component": "dropdown",
|
| 37 |
+
"lov": lambda: [
|
| 38 |
+
"thaniyans",
|
| 39 |
+
"sutras"
|
| 40 |
+
],
|
| 41 |
+
"is_unique": True,
|
| 42 |
+
},
|
| 43 |
+
{
|
| 44 |
+
"name": "chapter_name_ta",
|
| 45 |
+
"datatype": "str",
|
| 46 |
+
"label": "Chapter Name (Tamil)",
|
| 47 |
+
"description": "Name of the Chapter in Tamil",
|
| 48 |
+
"show_as_filter": True,
|
| 49 |
+
"component": "dropdown",
|
| 50 |
+
"lov": lambda: [
|
| 51 |
+
"தனியன்கள்",
|
| 52 |
+
"சூத்திரங்கள்"
|
| 53 |
+
],
|
| 54 |
+
"is_unique": True,
|
| 55 |
+
},
|
| 56 |
+
{
|
| 57 |
+
"name": "verse",
|
| 58 |
+
"datatype": "int",
|
| 59 |
+
"label": "Relative Sutra Number",
|
| 60 |
+
"description": "Relative Sutra Number",
|
| 61 |
+
"show_as_filter": True,
|
| 62 |
+
"is_unique": True,
|
| 63 |
+
},
|
| 64 |
+
{
|
| 65 |
+
"name": "_global_index",
|
| 66 |
+
"datatype": "int",
|
| 67 |
+
"label": "Absolute Sutra Number",
|
| 68 |
+
"description": "Absolute Sutra Number",
|
| 69 |
+
"show_as_filter": True,
|
| 70 |
+
"is_unique": True,
|
| 71 |
+
},
|
| 72 |
+
{
|
| 73 |
+
"name": "sutra_text_ta",
|
| 74 |
+
"label": "Lyrics in tamil",
|
| 75 |
+
"datatype": "str",
|
| 76 |
+
"description": "The original sutra in tamil.",
|
| 77 |
+
"show_as_filter": True,
|
| 78 |
+
},
|
| 79 |
+
],
|
| 80 |
+
"pdf_path": "./data/sri_vachana_bhushanam.pdf",
|
| 81 |
+
"source": "https://granthams.koyil.org",
|
| 82 |
+
"language": "tam+eng",
|
| 83 |
+
"example_labels": [
|
| 84 |
+
"Sri Vachana Bhushanam",
|
| 85 |
+
],
|
| 86 |
+
"examples": [
|
| 87 |
+
"Show some sutras from Sri Vachana Bhushanam",
|
| 88 |
+
],
|
| 89 |
+
"llm_hints": [],
|
| 90 |
+
"credits": {
|
| 91 |
+
"art": [
|
| 92 |
+
{
|
| 93 |
+
"name": "Sri TNCN",
|
| 94 |
+
"url": "https://www.linkedin.com/in/narashiman-chakravarthy-54326111/",
|
| 95 |
+
"role": "Illustrator",
|
| 96 |
+
"notes": "Original artwork used with permission",
|
| 97 |
+
"photo_url": "https://drive.google.com/uc?export=download&id=1D4Vo-Mvkp1RdZR6whUkcjvNBIW1yHSUE",
|
| 98 |
+
}
|
| 99 |
+
],
|
| 100 |
+
"data": [
|
| 101 |
+
{
|
| 102 |
+
"name": "koyil.org",
|
| 103 |
+
"url": "https://granthams.koyil.org",
|
| 104 |
+
"role": "Data provider",
|
| 105 |
+
}
|
| 106 |
+
],
|
| 107 |
+
"audio": [
|
| 108 |
+
{
|
| 109 |
+
"name": "Srirangam Sri Vasudevan Srinivasachariar",
|
| 110 |
+
"url": "https://www.youtube.com/@akivasudev",
|
| 111 |
+
"role": "Recitation audio provider",
|
| 112 |
+
"photo_url": "https://drive.google.com/uc?export=download&id=1HB1Nr39j2-55rIeOK_wYNbZZndcGZIaf",
|
| 113 |
+
},
|
| 114 |
+
],
|
| 115 |
+
"video": [],
|
| 116 |
+
},
|
| 117 |
+
}
|