Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Upload folder using huggingface_hub
Browse files- .gitignore +1 -0
- copy_chromadb.py +5 -0
- modules/config/bhagavata_purana.py +69 -9
.gitignore
CHANGED
|
@@ -13,3 +13,4 @@ chromadb-store/
|
|
| 13 |
chromadb-store.zip
|
| 14 |
outputs/
|
| 15 |
chromadb-store_20251112.zip
|
|
|
|
|
|
| 13 |
chromadb-store.zip
|
| 14 |
outputs/
|
| 15 |
chromadb-store_20251112.zip
|
| 16 |
+
chromadb-store_20251118.zip
|
copy_chromadb.py
CHANGED
|
@@ -98,6 +98,11 @@ db_config = {
|
|
| 98 |
"source_collection_name": "narayaneeyam",
|
| 99 |
"destination_collection_name": "narayaneeyam",
|
| 100 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 101 |
}
|
| 102 |
|
| 103 |
parser = argparse.ArgumentParser(description="My app with database parameter")
|
|
|
|
| 98 |
"source_collection_name": "narayaneeyam",
|
| 99 |
"destination_collection_name": "narayaneeyam",
|
| 100 |
},
|
| 101 |
+
"bhagavata_purana": {
|
| 102 |
+
"source_db_path": "../bhagavata_purana_ai/chromadb_store",
|
| 103 |
+
"source_collection_name": "bhagavata_purana",
|
| 104 |
+
"destination_collection_name": "bhagavata_purana",
|
| 105 |
+
},
|
| 106 |
}
|
| 107 |
|
| 108 |
parser = argparse.ArgumentParser(description="My app with database parameter")
|
modules/config/bhagavata_purana.py
CHANGED
|
@@ -4,32 +4,72 @@ from modules.google_drive.google_drive_utils import convert_drive_url_to_direct
|
|
| 4 |
|
| 5 |
bhagavata_purana_config = {
|
| 6 |
"name": "bhagavata_purana",
|
| 7 |
-
"title": "
|
| 8 |
"banner_url": convert_drive_url_to_direct(
|
| 9 |
"https://drive.google.com/file/d/1APDzjcF-G4tn6qHHn0QFmA-odcrQS2-e/view?usp=drive_link"
|
| 10 |
),
|
| 11 |
"category" : ScriptureCategoryConstants.PURANAM,
|
| 12 |
"output_dir": "./output/bhagavata_purana",
|
| 13 |
"collection_name": "bhagavata_purana",
|
| 14 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
"metadata_fields": [
|
| 16 |
{
|
| 17 |
-
"name": "
|
| 18 |
-
"label": "File Name",
|
| 19 |
"datatype": "str",
|
| 20 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
},
|
| 22 |
{
|
| 23 |
-
"name": "
|
| 24 |
"datatype": "int",
|
| 25 |
-
"label": "
|
| 26 |
-
"description": "
|
| 27 |
"show_as_filter": True,
|
| 28 |
"is_unique": True,
|
| 29 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
],
|
| 31 |
"pdf_path": "./data/bhagavata_purana.pdf",
|
| 32 |
-
"source": "https://
|
| 33 |
"language": "san+eng",
|
| 34 |
"example_labels": ["Gajendra Moksham", "Prahalad"],
|
| 35 |
"examples": [
|
|
@@ -37,4 +77,24 @@ bhagavata_purana_config = {
|
|
| 37 |
"State some verses that showcase the devotion of Prahlada",
|
| 38 |
],
|
| 39 |
"llm_hints": [],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
}
|
|
|
|
| 4 |
|
| 5 |
bhagavata_purana_config = {
|
| 6 |
"name": "bhagavata_purana",
|
| 7 |
+
"title": "Srimad Bhagavatham",
|
| 8 |
"banner_url": convert_drive_url_to_direct(
|
| 9 |
"https://drive.google.com/file/d/1APDzjcF-G4tn6qHHn0QFmA-odcrQS2-e/view?usp=drive_link"
|
| 10 |
),
|
| 11 |
"category" : ScriptureCategoryConstants.PURANAM,
|
| 12 |
"output_dir": "./output/bhagavata_purana",
|
| 13 |
"collection_name": "bhagavata_purana",
|
| 14 |
+
"collection_embedding_fn": "openai",
|
| 15 |
+
"unit": "sloka",
|
| 16 |
+
"unit_field": "_global_index",
|
| 17 |
+
"field_mapping": {
|
| 18 |
+
"text": "sanskrit",
|
| 19 |
+
"unit_index": "sloka_number",
|
| 20 |
+
"chapter_name": lambda doc: (
|
| 21 |
+
f"Book {doc.get('book_number')}:Chapter {doc.get('chapter_number')}"
|
| 22 |
+
),
|
| 23 |
+
"author": lambda doc: f" Sage Vyasa",
|
| 24 |
+
"word_by_word_native": "wbw",
|
| 25 |
+
"translation": "translation",
|
| 26 |
+
"relative_path": lambda doc: (
|
| 27 |
+
f"Book#{doc.get('book_number')}: Chapter#{doc.get('chapter_number')}:Sloka#{doc.get('sloka_number')} || {doc.get('_global_index')} ||"
|
| 28 |
+
),
|
| 29 |
+
},
|
| 30 |
"metadata_fields": [
|
| 31 |
{
|
| 32 |
+
"name": "book_number",
|
|
|
|
| 33 |
"datatype": "str",
|
| 34 |
+
"label": "Book Number",
|
| 35 |
+
"description": "Book Number",
|
| 36 |
+
"show_as_filter": True,
|
| 37 |
+
"is_unique": True,
|
| 38 |
+
},
|
| 39 |
+
{
|
| 40 |
+
"name": "chapter_number",
|
| 41 |
+
"datatype": "str",
|
| 42 |
+
"label": "Chapter Number",
|
| 43 |
+
"description": "Chapter Number",
|
| 44 |
+
"show_as_filter": True,
|
| 45 |
+
"is_unique": True,
|
| 46 |
+
},
|
| 47 |
+
{
|
| 48 |
+
"name": "sloka_number",
|
| 49 |
+
"datatype": "int",
|
| 50 |
+
"label": "Relative Verse Number",
|
| 51 |
+
"description": "Relative Verse Number",
|
| 52 |
+
"show_as_filter": True,
|
| 53 |
+
"is_unique": True,
|
| 54 |
},
|
| 55 |
{
|
| 56 |
+
"name": "_global_index",
|
| 57 |
"datatype": "int",
|
| 58 |
+
"label": "Absolute Verse Number",
|
| 59 |
+
"description": "Absolute Verse Number",
|
| 60 |
"show_as_filter": True,
|
| 61 |
"is_unique": True,
|
| 62 |
},
|
| 63 |
+
{
|
| 64 |
+
"name": "sanskrit",
|
| 65 |
+
"label": "Lyrics in Sanskrit",
|
| 66 |
+
"datatype": "str",
|
| 67 |
+
"description": "The original verse in Sanskrit.",
|
| 68 |
+
"show_as_filter": True,
|
| 69 |
+
},
|
| 70 |
],
|
| 71 |
"pdf_path": "./data/bhagavata_purana.pdf",
|
| 72 |
+
"source": "https://bhaagavatam-firststep.org/",
|
| 73 |
"language": "san+eng",
|
| 74 |
"example_labels": ["Gajendra Moksham", "Prahalad"],
|
| 75 |
"examples": [
|
|
|
|
| 77 |
"State some verses that showcase the devotion of Prahlada",
|
| 78 |
],
|
| 79 |
"llm_hints": [],
|
| 80 |
+
"credits": {
|
| 81 |
+
"art": [
|
| 82 |
+
{
|
| 83 |
+
"name": "Sri TNCN",
|
| 84 |
+
"url": "https://www.linkedin.com/in/narashiman-chakravarthy-54326111/",
|
| 85 |
+
"role": "Illustrator",
|
| 86 |
+
"notes": "Original artwork used with permission",
|
| 87 |
+
"photo_url": "https://drive.google.com/uc?export=download&id=1D4Vo-Mvkp1RdZR6whUkcjvNBIW1yHSUE",
|
| 88 |
+
}
|
| 89 |
+
],
|
| 90 |
+
"data": [
|
| 91 |
+
{
|
| 92 |
+
"name": "First Step",
|
| 93 |
+
"url": "https://bhaagavatam-firststep.org/",
|
| 94 |
+
"role": "Data provider",
|
| 95 |
+
},
|
| 96 |
+
],
|
| 97 |
+
"audio": [],
|
| 98 |
+
"video": [],
|
| 99 |
+
},
|
| 100 |
}
|