Downloads · 30 days
15
10% of all-time downloads
rudranshjoshi/WikiLlama
WikiLlama is a machine learning model from rudranshjoshi. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Downloads · 30 days
15
10% of all-time downloads
All-time downloads
145
Public
Parameters
1.1B
6.6 GB on disk
Likes
0
Public
Click a slice to open those files.
.gguf4.4 GB · 67%
From the Hugging Face model README
WikiLlama is a LoRA fine-tuned version of TinyLlama-1.1B, trained on the WikiText-103 dataset to improve general NLP performance.
TinyLlama/TinyLlama-1.1B-Chat-v1.0The model was evaluated on the HellaSwag dataset (Sentence Completion / Multiple Choice) using a sample size of 100 examples. The results demonstrate a significant accuracy improvement over the base model.
| Model | Accuracy (HellaSwag) |
|---|---|
| Original TinyLlama | 24% |
| WikiLlama (LoRA) | 30% |
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
# Load the model and tokenizer
model_id = "rudranshjoshi/WikiLlama"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.float16,
device_map="auto"
)
# Prepare input
messages = [
{"role": "user", "content": "What is the capital of France?"}
]
# Apply chat template (if available) or format prompt
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
# Generate response
outputs = model.generate(
**inputs,
max_new_tokens=256,
temperature=0.7,
do_sample=True
)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response)
Note: Fine-tuning on WikiText-103 resulted in a 6% absolute improvement in accuracy on the HellaSwag benchmark compared to the vanilla TinyLlama-1.1B checkpoint.