Spaces:
Running
Running
Upload folder using huggingface_hub
Browse files- copy_chromadb.py +5 -0
- modules/config/__init__.py +3 -1
- modules/config/chandogya_upanishad.py +127 -0
copy_chromadb.py
CHANGED
|
@@ -283,6 +283,11 @@ db_config = {
|
|
| 283 |
"source_collection_name": "padhuka_sahasram",
|
| 284 |
"destination_collection_name": "padhuka_sahasram"
|
| 285 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 286 |
|
| 287 |
}
|
| 288 |
|
|
|
|
| 283 |
"source_collection_name": "padhuka_sahasram",
|
| 284 |
"destination_collection_name": "padhuka_sahasram"
|
| 285 |
},
|
| 286 |
+
"chandogya_upanishad": {
|
| 287 |
+
"source_db_path": "../chandogya_upanishad_ai/chromadb_store",
|
| 288 |
+
"source_collection_name": "chandogya_upanishad",
|
| 289 |
+
"destination_collection_name": "chandogya_upanishad"
|
| 290 |
+
},
|
| 291 |
|
| 292 |
}
|
| 293 |
|
modules/config/__init__.py
CHANGED
|
@@ -7,6 +7,7 @@ from modules.config.brahma_sutra import brahma_sutra_config
|
|
| 7 |
from modules.config.brahmandpuranam import brahmandpuranam_config
|
| 8 |
from modules.config.brahmapuranam import brahmapuranam_config
|
| 9 |
from modules.config.brahmavaivarthapurana import brahmavaivarthapurana_config
|
|
|
|
| 10 |
from modules.config.chathusloki import chathusloki_config
|
| 11 |
from modules.config.desika_prabandham import desika_prabandham_config
|
| 12 |
from modules.config.devaraja_ashtakam import devaraja_ashtakam_config
|
|
@@ -119,5 +120,6 @@ scripture_configurations = [
|
|
| 119 |
dhati_panchakam_config,
|
| 120 |
gadhyathrayam_config,
|
| 121 |
aarthi_prabandham_config,
|
| 122 |
-
padhuka_sahasram_config
|
|
|
|
| 123 |
]
|
|
|
|
| 7 |
from modules.config.brahmandpuranam import brahmandpuranam_config
|
| 8 |
from modules.config.brahmapuranam import brahmapuranam_config
|
| 9 |
from modules.config.brahmavaivarthapurana import brahmavaivarthapurana_config
|
| 10 |
+
from modules.config.chandogya_upanishad import chandogya_upanishad_config
|
| 11 |
from modules.config.chathusloki import chathusloki_config
|
| 12 |
from modules.config.desika_prabandham import desika_prabandham_config
|
| 13 |
from modules.config.devaraja_ashtakam import devaraja_ashtakam_config
|
|
|
|
| 120 |
dhati_panchakam_config,
|
| 121 |
gadhyathrayam_config,
|
| 122 |
aarthi_prabandham_config,
|
| 123 |
+
padhuka_sahasram_config,
|
| 124 |
+
chandogya_upanishad_config
|
| 125 |
]
|
modules/config/chandogya_upanishad.py
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from modules.config.categories import ScriptureCategoryConstants
|
| 2 |
+
from modules.google_drive.google_drive_utils import convert_drive_url_to_direct
|
| 3 |
+
|
| 4 |
+
chandogya_upanishad_config = {
|
| 5 |
+
"name": "chandogya_upanishad",
|
| 6 |
+
"title": "Chāndogya Upaniṣad",
|
| 7 |
+
"banner_url": convert_drive_url_to_direct(
|
| 8 |
+
"https://drive.google.com/file/d/1JsD1k976QNaXRTMB1QtX1ASSbFSo_HoZ/view?usp=drive_link"
|
| 9 |
+
),
|
| 10 |
+
"category": ScriptureCategoryConstants.VEDAM,
|
| 11 |
+
"output_dir": "./outputs/chandogya_upanishad",
|
| 12 |
+
"collection_name": "chandogya_upanishad",
|
| 13 |
+
"collection_embedding_fn": "openai",
|
| 14 |
+
|
| 15 |
+
# ---- units ----
|
| 16 |
+
"unit": "sloka",
|
| 17 |
+
"unit_field": "_global_index",
|
| 18 |
+
|
| 19 |
+
# ---- how documents are interpreted ----
|
| 20 |
+
"field_mapping": {
|
| 21 |
+
"text": "lyrics_sa",
|
| 22 |
+
"unit_index": "_global_index",
|
| 23 |
+
# Human-readable reference
|
| 24 |
+
"relative_path": lambda doc: (
|
| 25 |
+
f"{doc['chapter']}.{doc['section']}.{doc['verse']}"
|
| 26 |
+
),
|
| 27 |
+
"author": lambda doc: "Vedic tradition (Sāmaveda)",
|
| 28 |
+
"translation" : lambda doc: (
|
| 29 |
+
f"Simple meaning: \n{doc['simple_meaning_en']}\n"
|
| 30 |
+
f"Commentary: \n {doc['commentary_en']}"
|
| 31 |
+
),
|
| 32 |
+
"word_by_word_native" : "word_by_word_en",
|
| 33 |
+
},
|
| 34 |
+
|
| 35 |
+
# ---- metadata exposed to UI / filters ----
|
| 36 |
+
"metadata_fields": [
|
| 37 |
+
{
|
| 38 |
+
"name": "chapter",
|
| 39 |
+
"datatype": "int",
|
| 40 |
+
"label": "Chapter",
|
| 41 |
+
"description": "Chapter (Adhyāya) number",
|
| 42 |
+
"show_as_filter": True,
|
| 43 |
+
},
|
| 44 |
+
{
|
| 45 |
+
"name": "section",
|
| 46 |
+
"datatype": "int",
|
| 47 |
+
"label": "Section",
|
| 48 |
+
"description": "Section (Khanda) number within chapter",
|
| 49 |
+
"show_as_filter": True,
|
| 50 |
+
},
|
| 51 |
+
{
|
| 52 |
+
"name": "verse",
|
| 53 |
+
"datatype": "int",
|
| 54 |
+
"label": "Verse",
|
| 55 |
+
"description": "Verse number within section",
|
| 56 |
+
"show_as_filter": True,
|
| 57 |
+
},
|
| 58 |
+
{
|
| 59 |
+
"name": "_global_index",
|
| 60 |
+
"datatype": "int",
|
| 61 |
+
"label": "Global Index",
|
| 62 |
+
"description": "Absolute verse index across the entire Upanishad",
|
| 63 |
+
"show_as_filter": True,
|
| 64 |
+
"is_unique": True,
|
| 65 |
+
},
|
| 66 |
+
{
|
| 67 |
+
"name": "lyrics_sa",
|
| 68 |
+
"datatype": "str",
|
| 69 |
+
"label": "Sanskrit Text",
|
| 70 |
+
"description": "Original Sanskrit verse",
|
| 71 |
+
"show_as_filter": True,
|
| 72 |
+
},
|
| 73 |
+
{
|
| 74 |
+
"name": "lyrics_en",
|
| 75 |
+
"datatype": "str",
|
| 76 |
+
"label": "IAST Transliteration",
|
| 77 |
+
"description": "Roman transliteration of Sanskrit",
|
| 78 |
+
"show_as_filter": True,
|
| 79 |
+
},
|
| 80 |
+
{
|
| 81 |
+
"name": "simple_meaning_en",
|
| 82 |
+
"datatype": "str",
|
| 83 |
+
"label": "Simple Meaning",
|
| 84 |
+
"description": "Prose English explanation",
|
| 85 |
+
"show_as_filter": False,
|
| 86 |
+
},
|
| 87 |
+
{
|
| 88 |
+
"name": "word_by_word_en",
|
| 89 |
+
"datatype": "str",
|
| 90 |
+
"label": "Word-by-word Meaning",
|
| 91 |
+
"description": "Gloss-based translation",
|
| 92 |
+
"show_as_filter": False,
|
| 93 |
+
},
|
| 94 |
+
{
|
| 95 |
+
"name": "commentary_en",
|
| 96 |
+
"datatype": "str",
|
| 97 |
+
"label": "Commentary",
|
| 98 |
+
"description": "Traditional explanatory commentary",
|
| 99 |
+
"show_as_filter": False,
|
| 100 |
+
},
|
| 101 |
+
],
|
| 102 |
+
|
| 103 |
+
# ---- source & attribution ----
|
| 104 |
+
"pdf_path": None,
|
| 105 |
+
"source": "wisdomlib.org",
|
| 106 |
+
"language": "san",
|
| 107 |
+
|
| 108 |
+
"example_labels": [],
|
| 109 |
+
"examples": [],
|
| 110 |
+
"llm_hints": [],
|
| 111 |
+
|
| 112 |
+
"credits": {
|
| 113 |
+
"data": [
|
| 114 |
+
{
|
| 115 |
+
"name": "Wisdom Library",
|
| 116 |
+
"url": "https://www.wisdomlib.org/hinduism/book/chandogya-upanishad-english",
|
| 117 |
+
"role": "Data Provider",
|
| 118 |
+
"photo_url" : "https://www.wisdomlib.org/images/logo.gif",
|
| 119 |
+
}
|
| 120 |
+
],
|
| 121 |
+
"art": [],
|
| 122 |
+
"audio": [],
|
| 123 |
+
"video": [],
|
| 124 |
+
},
|
| 125 |
+
|
| 126 |
+
"audio_modes": {},
|
| 127 |
+
}
|