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 | |
| def fn_list_of_chapters(): | |
| return [ | |
| "Intro", | |
| "बालकाण्डम्", | |
| "अयोध्याकाण्डम्", | |
| "आरण्यकाण्डम्", | |
| "किष्किन्धाकाण्डम्", | |
| "सुन्दरकाण्डम्", | |
| "युद्धकाण्डम्", | |
| "उत्तरकाण्डम्", | |
| ] | |
| raghuveera_gadhyam_config = { | |
| "name": "raghuveera_gadhyam", | |
| "title": "Raghuveera Gadhyam", | |
| "category": ScriptureCategoryConstants.SRI_SOOKTHI, | |
| "banner_url": convert_drive_url_to_direct( | |
| "https://drive.google.com/file/d/1aRvTo0rOqwWgV_gekntrw1h0B0Hln3Yf/view?usp=drive_link" | |
| ), | |
| "output_dir": "./output/raghuveera_gadhyam", | |
| "collection_name": "raghuveera_gadhyam", | |
| "collection_embedding_fn": "openai", | |
| "unit": "sloka", | |
| "unit_field": "_global_index", | |
| "field_mapping": { | |
| "text": "text_sa", | |
| "unit_index": "relative_verse_number", | |
| "chapter_name": "chapter_name", | |
| "author": lambda doc: f"ஸ்ரீமந்நிகமாந்த மஹாதேசிகர்", | |
| "relative_path": lambda doc: ( | |
| f"{doc.get('chapter_name')}:{doc.get('relative_verse_number')} || {doc.get('_global_index')} ||" | |
| ), | |
| }, | |
| "metadata_fields": [ | |
| { | |
| "name": "chapter_name", | |
| "datatype": "str", | |
| "label": "Chapter Name", | |
| "description": "Name of the Chapter in Sanskrit", | |
| "show_as_filter": True, | |
| "component": "dropdown", | |
| "lov": lambda: [x["chapter_name"] for x in fn_list_of_chapters()], | |
| "is_unique": True, | |
| }, | |
| { | |
| "name": "relative_verse_number", | |
| "datatype": "int", | |
| "label": "Relative Verse Number", | |
| "description": "Relative Verse Number", | |
| "show_as_filter": True, | |
| "is_unique": True, | |
| }, | |
| { | |
| "name": "_global_index", | |
| "datatype": "int", | |
| "label": "Absolute Verse Number", | |
| "description": "Absolute Verse Number", | |
| "show_as_filter": True, | |
| "is_unique": True, | |
| }, | |
| { | |
| "name": "text_sa", | |
| "label": "Lyrics in Sanskrit", | |
| "datatype": "str", | |
| "description": "The original verse in Sanskrit.", | |
| "show_as_filter": True, | |
| }, | |
| ], | |
| "pdf_path": "./data/raghuveera_gadhyam.pdf", | |
| "source": "https://sanskritdocuments.org/doc_raama/traghuvira.html", | |
| "language": "san+eng", | |
| "example_labels": [ | |
| "Raghuveera Gadhyam", | |
| ], | |
| "examples": [ | |
| "Show some verses from Raghuveera Gadhyam", | |
| ], | |
| "llm_hints": [], | |
| "credits": { | |
| "art": [ | |
| { | |
| "name": "Sri TNCN", | |
| "url": "https://www.linkedin.com/in/narashiman-chakravarthy-54326111/", | |
| "role": "Illustrator", | |
| "notes": "Original artwork used with permission", | |
| "photo_url": "https://drive.google.com/uc?export=download&id=1D4Vo-Mvkp1RdZR6whUkcjvNBIW1yHSUE", | |
| } | |
| ], | |
| "data": [ | |
| { | |
| "name": "Sanskrit Documents", | |
| "url": "https://sanskritdocuments.org/doc_raama/traghuvira.html", | |
| "role": "Data provider", | |
| }, | |
| ], | |
| "audio": [], | |
| "video": [], | |
| }, | |
| "audio_modes": { | |
| "recitation": "Recitation", | |
| }, | |
| } | |