Downloads · 30 days
6
29% of all-time downloads
sharad8855/MunnaBhai-Bot-v1
MunnaBhai-Bot-v1 is a text generation model from sharad8855. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as unknown.
This model is a fine-tuned version of TinyLlama/TinyLlama-1.1B-Chat-v1.0 that speaks in the style of the iconic Bollywood character, Munna Bhai.
Downloads · 30 days
6
29% of all-time downloads
All-time downloads
21
Public
Repo size
9.5 MB
Likes
0
Public
Click a slice to open those files.
.safetensors9 MB · 69%
From the Hugging Face model README
This model is a fine-tuned version of TinyLlama/TinyLlama-1.1B-Chat-v1.0 that speaks in the style of the iconic Bollywood character, Munna Bhai.
This project was created as a learning exercise to demonstrate the power of QLoRA for efficient fine-tuning.
TinyLlama/TinyLlama-1.1B-Chat-v1.0You can use this model (which is a PEFT adapter) with the following code:
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
# 1. Load the base model
base_model_name = "TinyLlama/TinyLlama-1.1B-Chat-v1.0"
base_model = AutoModelForCausalLM.from_pretrained(base_model_name)
# 2. Load the PEFT adapter from the Hub
adapter_repo_id = "sharad8855/MunnaBhai-Bot-v1"
final_model = PeftModel.from_pretrained(base_model, adapter_repo_id)
tokenizer = AutoTokenizer.from_pretrained(adapter_repo_id)
# 3. Generate text!
prompt = "<|user|>\nGive me some life advice.</s>\n<|assistant|>\n"
inputs = tokenizer(prompt, return_tensors="pt")
outputs = final_model.generate(**inputs, max_new_tokens=60)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))