Downloads · 30 days
14
0% of all-time downloads
Suru/Bhagvad-Gita-LLM
Bhagvad-Gita-LLM is a text generation model from Suru. Use it when you need the model to write or continue text. It is set up for transformers.
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 script…
Downloads · 30 days
14
0% of all-time downloads
All-time downloads
4.1K
Public
Repo size
27 GB
Likes
8
Public
Click a slice to open those files.
.bin13.5 GB · 100%
From the Hugging Face model README
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.
Start the converstaion by saying, "Hello Krishna, " followed by your question.
-> 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
!pip install transformers accelerate bitsandbytes
Than use the following code:
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: