BhagwadGitaAI-LLaMA is an AI-powered tool designed to fine-tune the LLaMA language model on the Bhagavad Gita dataset. It provides users with an interactive Gradio-based interface to input quotes from the Bhagavad Gita and receive precise interpretations and meanings. This project combines the power of advanced language models with sacred texts to deliver insightful analyses.
- Fine-tune the LLaMA model on a Bhagavad Gita dataset.
- Interactive Gradio interface for quote analysis.
- Generate contextual meanings for Gita verses.
- Easy-to-use architecture for researchers and enthusiasts.
- Languages: Python
- Frameworks: PyTorch, Gradio
- Libraries: Transformers, Hugging Face
- Dataset: Bhagavad Gita
BhagwadGitaAI-LLaMA/
├── Bhagwad_Gita.csv # Dataset file
├── gita_llama.ipynb # LLaMA fine-tuning notebook
├── gita_gradio.ipynb # Gradio interface notebook
├── README.md # Project documentation
└── requirements.txt # Required Python packages
Below is the flowchart representing the workflow of the Gita-LLaMA project:
- Clone the repository:
git clone https://github.com/vedant0321/BhagwadGitaAI-LLama.git
- Navigate to the project directory:
cd Gita-LLaMA - Install the required dependencies:
pip install -r requirements.txt
The gita_llama.ipynb notebook provides a complete pipeline for fine-tuning the LLaMA model on the Bhagavad Gita dataset.
- Dataset Preparation:
- Load and preprocess the Bhagavad Gita dataset from
data/Bhagwad_Gita.csv.
- Load and preprocess the Bhagavad Gita dataset from
- Model Initialization:
- Set up the LLaMA model using Hugging Face Transformers.
- Fine-Tuning:
- Use the dataset to train the LLaMA model with hyperparameter tuning.
- Saving the Model:
- Export the fine-tuned model for integration with the Gradio interface.
The gita_gradio.ipynb notebook provides an intuitive Gradio application for users to input quotes from the Bhagavad Gita and receive contextual meanings.
- Load the Model:
- Import the fine-tuned LLaMA model.
- Set up Gradio:
- Build a user-friendly interface with input fields and output sections.
- Run the Interface:
- Launch the Gradio app locally using:
gradio app.py
- Launch the Gradio app locally using:
- Usage:
- Enter a quote from the Bhagavad Gita in the input box.
- View the generated meaning in the output section.
| Input Quote | Interpretation |
|---|---|
| "Karmanye vadhikaraste ..." | Focus on your actions without attachment ... |
This project is licensed under the MIT License.
- Author: Vedant Birewar
- Email: vedantbirewar8@gmail.com
- LinkedIn: Vedant Birewar
- Hugging Face for their powerful Transformers library.
- Gradio for providing an easy-to-use interface framework.
- The teachings of the Bhagavad Gita for inspiration.
Made with ❤️ by Vedant Birewar.
