Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
| from modules.config.categories import ScriptureCategoryConstants | |
| from modules.google_drive.google_drive_utils import convert_drive_url_to_direct | |
| hanuman_chalisa_config = { | |
| "name": "hanuman_chalisa", | |
| "title": "Hanuman Chalisa", | |
| "banner_url": convert_drive_url_to_direct( | |
| "https://drive.google.com/file/d/1G0zLFMHKKUF8tsQiUqFQ86ybTUjV-Dvj/view?usp=drive_link" | |
| ), | |
| "category": ScriptureCategoryConstants.STOTRAM, | |
| "output_dir": "./outputs/hanuman_chalisa", | |
| "collection_name": "hanuman_chalisa", | |
| "collection_embedding_fn": "openai", | |
| # ---------- Unit semantics ---------- | |
| "unit": "verse", | |
| "unit_field": "_global_index", | |
| # ---------- Field mapping ---------- | |
| "field_mapping": { | |
| "text": "text", # Sanskrit verse | |
| "translation": "meaning", # English meaning | |
| "chapter_name": "chapter_name", | |
| "unit_index": "_global_index", | |
| "relative_path": lambda doc: ( | |
| f"{doc.get('chapter_name')} — Verse {doc.get('verse_index')}" | |
| ), | |
| "author": lambda doc: "Sri Tulasidas", | |
| }, | |
| # ---------- Metadata ---------- | |
| "metadata_fields": [ | |
| { | |
| "name": "chapter_name", | |
| "datatype": "str", | |
| "label": "Section", | |
| "description": "Section of the Hanuman Chalisa", | |
| "show_as_filter": True, | |
| "component": "dropdown", | |
| "lov": lambda: [ | |
| "दोहा", | |
| "चौपाई", | |
| "आरती", | |
| ], | |
| }, | |
| { | |
| "name": "_global_index", | |
| "datatype": "int", | |
| "label": "Global Index", | |
| "description": "Absolute verse index", | |
| "show_as_filter": True, | |
| "is_unique": True, | |
| }, | |
| { | |
| "name": "verse_index", | |
| "datatype": "int", | |
| "label": "Verse Number (in chapter)", | |
| "description": "Sequential verse number inside the chapter", | |
| "show_as_filter": True, | |
| }, | |
| { | |
| "name": "text", | |
| "datatype": "str", | |
| "label": "Verse (Devanagari)", | |
| "description": "Original verse text", | |
| "show_as_filter": False, | |
| }, | |
| { | |
| "name": "meaning", | |
| "datatype": "str", | |
| "label": "Meaning (English)", | |
| "description": "English explanation of the verse", | |
| "show_as_filter": False, | |
| }, | |
| ], | |
| # ---------- Source & language ---------- | |
| "pdf_path": "./data/hanuman_chalisa.pdf", | |
| "source": "sanskritdocuments.org", | |
| "language": "hin", # Hindi / Awadhi (Devanagari) | |
| # ---------- Examples / prompts ---------- | |
| "example_labels": [], | |
| "examples": [], | |
| "llm_hints": [ | |
| "Hanuman Chalisa is a devotional hymn by Tulasidas", | |
| "There are 40 chaupais, preceded by a doha and followed by arati", | |
| ], | |
| # ---------- Credits ---------- | |
| "credits": { | |
| "art": [], | |
| "data": [ | |
| { | |
| "name": "sanskritdocuments.org", | |
| "url": "https://sanskritdocuments.org/doc_z_otherlang_hindi/chaalisa.html", | |
| "role": "Data Provider", | |
| } | |
| ], | |
| "audio": [], | |
| "video": [], | |
| }, | |
| # ---------- Audio ---------- | |
| "audio_modes": {}, | |
| } | |