初始化项目,由ModelHub XC社区提供模型

Model: Suru/Bhagvad-Gita-LLM
Source: Original Platform
This commit is contained in:
ModelHub XC
2026-04-24 20:08:06 +08:00
commit a4e37b0258
10 changed files with 93904 additions and 0 deletions

42
README.md Normal file
View File

@@ -0,0 +1,42 @@
# Bhagavad Gita Chat with LLaMA 2 7b
## Description
This project leverages the powerful LLaMA 2 7b language model to create an interactive chat experience based on the Bhagavad Gita. It aims to provide insightful conversations and interpretations of this ancient scripture, making it more accessible and engaging for users worldwide.
## Prompt
Start the converstaion by saying, "Hello Krishna, " followed by your question.
## Try on your free colab using 4 bit- quantization!
-> We will make the model load in smaller bit precision which allow us to use free colab gpu. Make sure that GPU is enabled under runtime settings.
First install libraries
```python
!pip install transformers accelerate bitsandbytes
```
Than use the following code:
```python
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "Suru/Bhagvad-Gita-LLM" # model from hugging face
model = AutoModelForCausalLM.from_pretrained(model_name, device_map="auto", load_in_4bit=True)
tokenizer = AutoTokenizer.from_pretrained(model_name, use_fast=True)
prompt = "Hello Krishna, how can I live fearless life?"
prompt_format = f"<s>[INST] {prompt} [/INST]"
model_inputs = tokenizer(prompt_format, return_tensors="pt").to("cuda:0")
output = model.generate(**model_inputs, max_new_tokens = 1000)
print(tokenizer.decode(output[0], skip_special_tokens=True))
```
You can change what you want to ask in the prompt.
[Check out the article here: ](https://medium.com/@suru10/duunveiling-the-wisdom-of-the-bhagavad-gita-through-ai-a-step-by-step-guide-to-using-the-llm-model-c249c89175fa)
## Features
- **Interactive Chat Interface**: Engage in conversations about the Bhagavad Gitas teachings, characters, and philosophical concepts.
- **AI-Powered Insights**: Utilize the LLaMA 2 7b model for deep and meaningful interpretations of the text.
- **Custom Queries**: Ask specific questions about verses, chapters, or themes in the Bhagavad Gita.
## Dataset source
- **Repo**: Suru/gita_alpaca_format
---
license: apache-2.0
---