Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Upload folder using huggingface_hub
Browse files- copy_chromadb.py +6 -1
- modules/config/__init__.py +2 -0
- modules/config/gadhyathrayam.py +122 -0
copy_chromadb.py
CHANGED
|
@@ -267,7 +267,12 @@ db_config = {
|
|
| 267 |
"source_db_path": "../stotra_patam_ai/chromadb_store",
|
| 268 |
"source_collection_name": "yathiraja_vimsathi",
|
| 269 |
"destination_collection_name": "yathiraja_vimsathi"
|
| 270 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 271 |
|
| 272 |
}
|
| 273 |
|
|
|
|
| 267 |
"source_db_path": "../stotra_patam_ai/chromadb_store",
|
| 268 |
"source_collection_name": "yathiraja_vimsathi",
|
| 269 |
"destination_collection_name": "yathiraja_vimsathi"
|
| 270 |
+
},
|
| 271 |
+
"gadhyathrayam": {
|
| 272 |
+
"source_db_path": "../stotra_patam_ai/chromadb_store",
|
| 273 |
+
"source_collection_name": "gadhyathrayam",
|
| 274 |
+
"destination_collection_name": "gadhyathrayam"
|
| 275 |
+
},
|
| 276 |
|
| 277 |
}
|
| 278 |
|
modules/config/__init__.py
CHANGED
|
@@ -13,6 +13,7 @@ from modules.config.devaraja_mangalam import devaraja_mangalam_config
|
|
| 13 |
from modules.config.dhati_panchakam import dhati_panchakam_config
|
| 14 |
from modules.config.divya_prabandham import divya_prabandham_config
|
| 15 |
from modules.config.divya_prabandham_taniyans import divya_prabandham_taniyans_config
|
|
|
|
| 16 |
from modules.config.garudapuranam import garudapuranam_config
|
| 17 |
from modules.config.harivanshapuraanam import harivanshapuraanam_config
|
| 18 |
from modules.config.kamba_ramayanam import kamba_ramayanam_config
|
|
@@ -114,4 +115,5 @@ scripture_configurations = [
|
|
| 114 |
venkateswara_stotram_config,
|
| 115 |
yathiraja_vimsathi_config,
|
| 116 |
dhati_panchakam_config,
|
|
|
|
| 117 |
]
|
|
|
|
| 13 |
from modules.config.dhati_panchakam import dhati_panchakam_config
|
| 14 |
from modules.config.divya_prabandham import divya_prabandham_config
|
| 15 |
from modules.config.divya_prabandham_taniyans import divya_prabandham_taniyans_config
|
| 16 |
+
from modules.config.gadhyathrayam import gadhyathrayam_config
|
| 17 |
from modules.config.garudapuranam import garudapuranam_config
|
| 18 |
from modules.config.harivanshapuraanam import harivanshapuraanam_config
|
| 19 |
from modules.config.kamba_ramayanam import kamba_ramayanam_config
|
|
|
|
| 115 |
venkateswara_stotram_config,
|
| 116 |
yathiraja_vimsathi_config,
|
| 117 |
dhati_panchakam_config,
|
| 118 |
+
gadhyathrayam_config
|
| 119 |
]
|
modules/config/gadhyathrayam.py
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from modules.config.categories import ScriptureCategoryConstants
|
| 2 |
+
from modules.google_drive.google_drive_utils import convert_drive_url_to_direct
|
| 3 |
+
|
| 4 |
+
gadhyathrayam_config = {
|
| 5 |
+
"name": "gadhyathrayam",
|
| 6 |
+
"title": "Gadhyathrayam",
|
| 7 |
+
"banner_url": convert_drive_url_to_direct(
|
| 8 |
+
"https://drive.google.com/file/d/1ZE6vQp3goWL-xrnDv8rWBbKQjGPHjqIh/view?usp=drive_link"
|
| 9 |
+
),
|
| 10 |
+
"category": ScriptureCategoryConstants.SRI_SOOKTHI,
|
| 11 |
+
"output_dir": "./outputs/gadhyathrayam",
|
| 12 |
+
"collection_name": "gadhyathrayam",
|
| 13 |
+
"collection_embedding_fn": "openai",
|
| 14 |
+
"unit": "slokam",
|
| 15 |
+
"unit_field": "_global_index",
|
| 16 |
+
"field_mapping": {
|
| 17 |
+
"text": "lyrics_sa",
|
| 18 |
+
"chapter_name": "chapter_name",
|
| 19 |
+
"unit_index": "_global_index",
|
| 20 |
+
"relative_path": lambda doc: (
|
| 21 |
+
f"{doc.get('gadyam')} | {doc.get('chapter_name')} "
|
| 22 |
+
f"{doc.get('slokam_index')}"
|
| 23 |
+
f"{'.' + str(doc.get('split_index')) if doc.get('split_index') and doc.get('split_index') > 1 else ''}"
|
| 24 |
+
),
|
| 25 |
+
"author": lambda doc: "Sri Ramanuja",
|
| 26 |
+
"reference_link": "source_url",
|
| 27 |
+
},
|
| 28 |
+
"metadata_fields": [
|
| 29 |
+
{
|
| 30 |
+
"name": "gadyam",
|
| 31 |
+
"datatype": "str",
|
| 32 |
+
"label": "Gadyam Name",
|
| 33 |
+
"description": "Name of the Gadyam",
|
| 34 |
+
"show_as_filter": True,
|
| 35 |
+
"component": "dropdown",
|
| 36 |
+
"lov": lambda: ["SARANAGATHI GADYAM", "SRIRANGA GADYAM", "VAIKUNTA GADYAM"],
|
| 37 |
+
},
|
| 38 |
+
{
|
| 39 |
+
"name": "chapter_name",
|
| 40 |
+
"datatype": "str",
|
| 41 |
+
"label": "Chapter Name",
|
| 42 |
+
"description": "Chapter title",
|
| 43 |
+
"show_as_filter": True,
|
| 44 |
+
"component": "dropdown",
|
| 45 |
+
"lov": lambda: ["GADYAM", "THANIYAN"],
|
| 46 |
+
},
|
| 47 |
+
{
|
| 48 |
+
"name": "_global_index",
|
| 49 |
+
"datatype": "int",
|
| 50 |
+
"label": "Global Index",
|
| 51 |
+
"description": "Absolute verse index",
|
| 52 |
+
"show_as_filter": True,
|
| 53 |
+
"is_unique": True,
|
| 54 |
+
},
|
| 55 |
+
{
|
| 56 |
+
"name": "chapter_index",
|
| 57 |
+
"datatype": "int",
|
| 58 |
+
"label": "Chapter Index",
|
| 59 |
+
"description": "Chapter index",
|
| 60 |
+
},
|
| 61 |
+
{
|
| 62 |
+
"name": "slokam_index",
|
| 63 |
+
"datatype": "int",
|
| 64 |
+
"label": "Verse Number (in chapter)",
|
| 65 |
+
"description": "Sequential verse index inside the chapter",
|
| 66 |
+
"show_as_filter": True,
|
| 67 |
+
},
|
| 68 |
+
{
|
| 69 |
+
"name": "split_index",
|
| 70 |
+
"datatype": "int",
|
| 71 |
+
"label": "Slokam Split Index",
|
| 72 |
+
"description": "Sequential split index if a sloka is split",
|
| 73 |
+
"show_as_filter": True,
|
| 74 |
+
},
|
| 75 |
+
{
|
| 76 |
+
"name": "lyrics_sa",
|
| 77 |
+
"datatype": "str",
|
| 78 |
+
"label": "Sanskrit Verse",
|
| 79 |
+
"description": "Original verse text in Sanskrit",
|
| 80 |
+
"show_as_filter": True,
|
| 81 |
+
},
|
| 82 |
+
],
|
| 83 |
+
"pdf_path": "./data/gadhyathrayam.pdf",
|
| 84 |
+
"source": "sanskritdocuments.org",
|
| 85 |
+
"language": "san",
|
| 86 |
+
"example_labels": [],
|
| 87 |
+
"examples": [],
|
| 88 |
+
"llm_hints": [],
|
| 89 |
+
"credits": {
|
| 90 |
+
"art": [
|
| 91 |
+
{
|
| 92 |
+
"name": "Sri TNCN",
|
| 93 |
+
"url": "https://www.linkedin.com/in/narashiman-chakravarthy-54326111/",
|
| 94 |
+
"role": "Illustrator",
|
| 95 |
+
"notes": "Original artwork used with permission",
|
| 96 |
+
"photo_url": "https://drive.google.com/uc?export=download&id=1D4Vo-Mvkp1RdZR6whUkcjvNBIW1yHSUE",
|
| 97 |
+
}
|
| 98 |
+
],
|
| 99 |
+
"data": [
|
| 100 |
+
{
|
| 101 |
+
"name": "sanskritdocuments.org",
|
| 102 |
+
"url": "https://sanskritdocuments.org/doc_vishhnu/sharaNAgatigadyam.html",
|
| 103 |
+
"role": "Data Provider",
|
| 104 |
+
},
|
| 105 |
+
{
|
| 106 |
+
"name": "sanskritdocuments.org",
|
| 107 |
+
"url": "https://sanskritdocuments.org/doc_vishhnu/shrIrangagadyam.html",
|
| 108 |
+
"role": "Data Provider",
|
| 109 |
+
},
|
| 110 |
+
{
|
| 111 |
+
"name": "sanskritdocuments.org",
|
| 112 |
+
"url": "https://sanskritdocuments.org/doc_vishhnu/vaikuNThagadyam.html",
|
| 113 |
+
"role": "Data Provider",
|
| 114 |
+
},
|
| 115 |
+
],
|
| 116 |
+
"audio": [],
|
| 117 |
+
"video": [],
|
| 118 |
+
},
|
| 119 |
+
"audio_modes" : {
|
| 120 |
+
"recitation": "Recitation",
|
| 121 |
+
}
|
| 122 |
+
}
|