Spaces:
Running
Running
Download modules/config/matsyapuranam.py from vikramvasudevan/sanatan_ai: direct link, hf CLI and curl.
- Browser
- Download file 3.08 kB
-
https://huggingface.co/spaces/vikramvasudevan/sanatan_ai/resolve/main/modules/config/matsyapuranam.py
- Command line
-
hf download hf://spaces/vikramvasudevan/sanatan_ai/modules/config/matsyapuranam.py
-
curl -L -o matsyapuranam.py https://huggingface.co/spaces/vikramvasudevan/sanatan_ai/resolve/main/modules/config/matsyapuranam.py
3.08 kB
| from modules.config.categories import ScriptureCategoryConstants | |
| from modules.google_drive.google_drive_utils import convert_drive_url_to_direct | |
| matsyapuranam_config = { | |
| "name": "matsyapuranam", | |
| "title": "Matsya Puranam", | |
| "banner_url": convert_drive_url_to_direct( | |
| "https://drive.google.com/file/d/1DxlpvcRqHGTFsE0tDgxThzUy-F0gmlMb/view?usp=drive_link" | |
| ), | |
| "category": ScriptureCategoryConstants.PURANAM, | |
| "output_dir": "./output/matsyapuranam", | |
| "collection_name": "matsyapuranam", | |
| "collection_embedding_fn": "openai", | |
| "unit": "sloka", | |
| "unit_field": "_global_index", | |
| "field_mapping": { | |
| "text": "lyrics_sa", | |
| "chapter_name": "chapter_name", | |
| "unit_index": "_global_index", | |
| "relative_path": lambda doc: ( | |
| " | ".join( | |
| [ | |
| doc[key] | |
| for key in sorted( | |
| [k for k in doc.keys() if k.startswith("title_") and doc[k]], | |
| key=lambda x: int(x.split("_")[1]), | |
| ) | |
| ] | |
| ) | |
| + f" || {doc.get('_global_index', '')} ||" | |
| ), | |
| "hierarchy": lambda doc: [ | |
| {"type": key, "name": str(doc[key]).strip()} | |
| for key in sorted( | |
| [k for k in doc.keys() if k.startswith("title_") and doc[k]], | |
| key=lambda x: int(x.split("_")[1]), | |
| ) | |
| ], | |
| }, | |
| "metadata_fields": [ | |
| { | |
| "name": "_global_index", | |
| "datatype": "int", | |
| "label": "Verse Index", | |
| "description": "Absolute verse index", | |
| "show_as_filter": True, | |
| "is_unique": True, | |
| }, | |
| { | |
| "name": "chapter_name", | |
| "datatype": "str", | |
| "label": "Chapter", | |
| "description": "Original chapter title", | |
| "show_as_filter": True, | |
| }, | |
| { | |
| "name": "lyrics_sa", | |
| "datatype": "str", | |
| "label": "Sanskrit", | |
| "description": "Verse text in Sanskrit", | |
| }, | |
| ], | |
| "pdf_path": "./data/matsyapuranam.pdf", | |
| "source": "", | |
| "language": "san", | |
| "example_labels": [], | |
| "examples": [], | |
| "llm_hints": [], | |
| "credits": { | |
| "art": [], | |
| "data": [ | |
| { | |
| "name": "Sanskritam", | |
| "url": "https://www.sanskritam.world/puranas", | |
| "role": "Data provider", | |
| }, | |
| ], | |
| "audio": [], | |
| "video": [], | |
| }, | |
| "audio_modes": {}, | |
| "title_translations": { | |
| "en": "Matsya Puranam", | |
| "ta": "மத்ஸ்ய புராணம்", | |
| "te": "మత్స్య పురాణం", | |
| "hi": "मत्स्य पुराणम्", | |
| "mr": "मत्स्य पुराणम्", | |
| "kn": "ಮತ್ಸ್ಯ ಪುರಾಣಂ", | |
| "ml": "മത്സ്യ പുരാണം", | |
| "or": "ମତ୍ସ୍ୟ ପୁରାଣମ୍", | |
| "pa": "ਮਤ੍ਸ੍ਯ ਪੁਰਾਣਮ", | |
| }, | |
| } | |