Spaces:
Restarting
on
CPU Upgrade
Restarting
on
CPU Upgrade
Upload folder using huggingface_hub
Browse files- copy_chromadb.py +5 -0
- modules/config/__init__.py +2 -0
- modules/config/thiruvaimozhi_nootrandhadhi.py +133 -0
copy_chromadb.py
CHANGED
|
@@ -207,6 +207,11 @@ db_config = {
|
|
| 207 |
"source_db_path": "../upadesa_rathnamalai/chromadb_store",
|
| 208 |
"source_collection_name": "upadesa_rathnamalai",
|
| 209 |
"destination_collection_name": "upadesa_rathnamalai"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 210 |
}
|
| 211 |
|
| 212 |
}
|
|
|
|
| 207 |
"source_db_path": "../upadesa_rathnamalai/chromadb_store",
|
| 208 |
"source_collection_name": "upadesa_rathnamalai",
|
| 209 |
"destination_collection_name": "upadesa_rathnamalai"
|
| 210 |
+
},
|
| 211 |
+
"thiruvaimozhi_nootrandhadhi": {
|
| 212 |
+
"source_db_path": "../thiruvaimozhi_nootrandhadhi_ai/chromadb_store",
|
| 213 |
+
"source_collection_name": "thiruvaimozhi_nootrandhadhi",
|
| 214 |
+
"destination_collection_name": "thiruvaimozhi_nootrandhadhi"
|
| 215 |
}
|
| 216 |
|
| 217 |
}
|
modules/config/__init__.py
CHANGED
|
@@ -34,6 +34,7 @@ from modules.config.taitriya_aranyakam import taitriya_aranyakam_config
|
|
| 34 |
from modules.config.taitriya_brahmanam import taitriya_brahmanam_config
|
| 35 |
from modules.config.taitriya_samhitha import taitriya_samhitha_config
|
| 36 |
from modules.config.taitriya_upanishad import taitriya_upanishad_config
|
|
|
|
| 37 |
from modules.config.upadesa_rathnamalai import upadesa_rathnamalai_config
|
| 38 |
from modules.config.vaamanapuraanam import vaamanapuraanam_config
|
| 39 |
from modules.config.vaayupuraanam import vaayupuraanam_config
|
|
@@ -91,4 +92,5 @@ scripture_configurations = [
|
|
| 91 |
varahapuranam_config,
|
| 92 |
vaazhi_thirunaamams_config,
|
| 93 |
upadesa_rathnamalai_config,
|
|
|
|
| 94 |
]
|
|
|
|
| 34 |
from modules.config.taitriya_brahmanam import taitriya_brahmanam_config
|
| 35 |
from modules.config.taitriya_samhitha import taitriya_samhitha_config
|
| 36 |
from modules.config.taitriya_upanishad import taitriya_upanishad_config
|
| 37 |
+
from modules.config.thiruvaimozhi_nootrandhadhi import thiruvaimozhi_nootrandhadhi_config
|
| 38 |
from modules.config.upadesa_rathnamalai import upadesa_rathnamalai_config
|
| 39 |
from modules.config.vaamanapuraanam import vaamanapuraanam_config
|
| 40 |
from modules.config.vaayupuraanam import vaayupuraanam_config
|
|
|
|
| 92 |
varahapuranam_config,
|
| 93 |
vaazhi_thirunaamams_config,
|
| 94 |
upadesa_rathnamalai_config,
|
| 95 |
+
thiruvaimozhi_nootrandhadhi_config
|
| 96 |
]
|
modules/config/thiruvaimozhi_nootrandhadhi.py
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from modules.config.categories import ScriptureCategoryConstants
|
| 2 |
+
from modules.google_drive.google_drive_utils import convert_drive_url_to_direct
|
| 3 |
+
|
| 4 |
+
thiruvaimozhi_nootrandhadhi_config = {
|
| 5 |
+
"name": "thiruvaimozhi_nootrandhadhi",
|
| 6 |
+
"title": "Thiruvaimozhi NootrandhAdhi",
|
| 7 |
+
"banner_url": convert_drive_url_to_direct(
|
| 8 |
+
"https://drive.google.com/file/d/1uLPo1Upx1vLJ6InxqOEMspAOz4UT1F4r/view?usp=drive_link"
|
| 9 |
+
),
|
| 10 |
+
"category": ScriptureCategoryConstants.SRI_SOOKTHI, # adjust if needed
|
| 11 |
+
"output_dir": "./outputs/thiruvaimozhi_nootrandhadhi",
|
| 12 |
+
"collection_name": "thiruvaimozhi_nootrandhadhi",
|
| 13 |
+
"collection_embedding_fn": "openai",
|
| 14 |
+
|
| 15 |
+
# Each verse is a unit
|
| 16 |
+
"unit": "pasuram",
|
| 17 |
+
"unit_field": "_global_index",
|
| 18 |
+
|
| 19 |
+
# === FIELD MAPPING ===
|
| 20 |
+
"field_mapping": {
|
| 21 |
+
"text": "text_ta",
|
| 22 |
+
"chapter_name": "chapter_name",
|
| 23 |
+
"unit_index": "_global_index",
|
| 24 |
+
"relative_path": lambda doc: f"{doc.get('chapter_name')} — {doc.get('relative_verse_number')}",
|
| 25 |
+
"word_by_word_native": "word_by_word_en",
|
| 26 |
+
"translation": lambda doc: "\n\n".join(
|
| 27 |
+
filter(None, [
|
| 28 |
+
f"TAMIL:\n{doc.get('translation_ta')}" if doc.get('translation_ta') else None,
|
| 29 |
+
f"ENGLISH:\n{doc.get('translation_en')}" if doc.get('translation_en') else None,
|
| 30 |
+
f"VYAKYANAM:\n{doc.get('highlights')}" if doc.get('highlights') else None,
|
| 31 |
+
])
|
| 32 |
+
),
|
| 33 |
+
},
|
| 34 |
+
|
| 35 |
+
# === METADATA FIELDS ===
|
| 36 |
+
"metadata_fields": [
|
| 37 |
+
{
|
| 38 |
+
"name": "chapter_name",
|
| 39 |
+
"datatype": "str",
|
| 40 |
+
"label": "Chapter Name",
|
| 41 |
+
"description": "Chapter title",
|
| 42 |
+
"show_as_filter": True,
|
| 43 |
+
"component": "dropdown",
|
| 44 |
+
"lov": lambda: ["THANIYAN","ANDHADHI"],
|
| 45 |
+
},
|
| 46 |
+
{
|
| 47 |
+
"name": "_global_index",
|
| 48 |
+
"datatype": "int",
|
| 49 |
+
"label": "Global Index",
|
| 50 |
+
"description": "Absolute verse index",
|
| 51 |
+
"show_as_filter": True,
|
| 52 |
+
"is_unique": True,
|
| 53 |
+
},
|
| 54 |
+
{
|
| 55 |
+
"name": "chapter_index",
|
| 56 |
+
"datatype": "int",
|
| 57 |
+
"label": "Chapter Index",
|
| 58 |
+
"description": "Chapter index",
|
| 59 |
+
},
|
| 60 |
+
{
|
| 61 |
+
"name": "relative_verse_number",
|
| 62 |
+
"datatype": "int",
|
| 63 |
+
"label": "Verse Number (in chapter)",
|
| 64 |
+
"description": "Sequential verse index inside the chapter",
|
| 65 |
+
"show_as_filter": True,
|
| 66 |
+
},
|
| 67 |
+
{
|
| 68 |
+
"name": "text_ta",
|
| 69 |
+
"datatype": "str",
|
| 70 |
+
"label": "Tamil Verse",
|
| 71 |
+
"description": "Original verse text in Tamil",
|
| 72 |
+
"show_as_filter": True,
|
| 73 |
+
},
|
| 74 |
+
{
|
| 75 |
+
"name": "translation_ta",
|
| 76 |
+
"datatype": "str",
|
| 77 |
+
"label": "Translation (Tamil)",
|
| 78 |
+
"description": "Tamil translation",
|
| 79 |
+
},
|
| 80 |
+
{
|
| 81 |
+
"name": "word_by_word_en",
|
| 82 |
+
"datatype": "str",
|
| 83 |
+
"label": "Word by Word (English)",
|
| 84 |
+
"description": "Word by word meanings in English",
|
| 85 |
+
},
|
| 86 |
+
{
|
| 87 |
+
"name": "translation_en",
|
| 88 |
+
"datatype": "str",
|
| 89 |
+
"label": "Translation (English)",
|
| 90 |
+
"description": "Simple English translation",
|
| 91 |
+
},
|
| 92 |
+
{
|
| 93 |
+
"name": "highlights",
|
| 94 |
+
"datatype": "str",
|
| 95 |
+
"label": "Highlights",
|
| 96 |
+
"description": "Key points / commentary",
|
| 97 |
+
},
|
| 98 |
+
],
|
| 99 |
+
|
| 100 |
+
# Optional PDF if you have
|
| 101 |
+
"pdf_path": "./data/thiruvaimozhi_nootrandhadhi.pdf",
|
| 102 |
+
|
| 103 |
+
"source": "koyil.org",
|
| 104 |
+
"language": "tam",
|
| 105 |
+
"example_labels": [],
|
| 106 |
+
"examples": [],
|
| 107 |
+
"llm_hints": [],
|
| 108 |
+
"credits": {
|
| 109 |
+
"art": [
|
| 110 |
+
{
|
| 111 |
+
"name": "Sri TNCN",
|
| 112 |
+
"url": "https://www.linkedin.com/in/narashiman-chakravarthy-54326111/",
|
| 113 |
+
"role": "Illustrator",
|
| 114 |
+
"notes": "Original artwork used with permission",
|
| 115 |
+
"photo_url": "https://drive.google.com/uc?export=download&id=1D4Vo-Mvkp1RdZR6whUkcjvNBIW1yHSUE",
|
| 116 |
+
}
|
| 117 |
+
],
|
| 118 |
+
"data": [
|
| 119 |
+
{
|
| 120 |
+
"name": "koyil.org",
|
| 121 |
+
"url": "https://divyaprabandham.koyil.org/index.php/2020/09/thiruvaimozhi-nurrandhadhi-tamil-simple/",
|
| 122 |
+
"role": "Data provider (Tamil)",
|
| 123 |
+
},
|
| 124 |
+
{
|
| 125 |
+
"name": "koyil.org",
|
| 126 |
+
"url": "https://divyaprabandham.koyil.org/index.php/2018/11/thiruvaimozhi-nurrandhadhi/",
|
| 127 |
+
"role": "Data provider (English)",
|
| 128 |
+
},
|
| 129 |
+
],
|
| 130 |
+
"audio": [],
|
| 131 |
+
"video": [],
|
| 132 |
+
},
|
| 133 |
+
}
|