Instructions to use rudranshjoshi/WikiLlama with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use rudranshjoshi/WikiLlama with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="rudranshjoshi/WikiLlama", filename="Wikillama.gguf", )
llm.create_chat_completion( messages = "No input example has been defined for this model task." )
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use rudranshjoshi/WikiLlama with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf rudranshjoshi/WikiLlama # Run inference directly in the terminal: llama cli -hf rudranshjoshi/WikiLlama
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf rudranshjoshi/WikiLlama # Run inference directly in the terminal: llama cli -hf rudranshjoshi/WikiLlama
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf rudranshjoshi/WikiLlama # Run inference directly in the terminal: ./llama-cli -hf rudranshjoshi/WikiLlama
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf rudranshjoshi/WikiLlama # Run inference directly in the terminal: ./build/bin/llama-cli -hf rudranshjoshi/WikiLlama
Use Docker
docker model run hf.co/rudranshjoshi/WikiLlama
- LM Studio
- Jan
- Ollama
How to use rudranshjoshi/WikiLlama with Ollama:
ollama run hf.co/rudranshjoshi/WikiLlama
- Unsloth Studio
How to use rudranshjoshi/WikiLlama with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for rudranshjoshi/WikiLlama to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for rudranshjoshi/WikiLlama to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for rudranshjoshi/WikiLlama to start chatting
- Atomic Chat new
- Docker Model Runner
How to use rudranshjoshi/WikiLlama with Docker Model Runner:
docker model run hf.co/rudranshjoshi/WikiLlama
- Lemonade
How to use rudranshjoshi/WikiLlama with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull rudranshjoshi/WikiLlama
Run and chat with the model
lemonade run user.WikiLlama-{{QUANT_TAG}}List all available models
lemonade list
llm.create_chat_completion(
messages = "No input example has been defined for this model task."
)YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
WikiLlama
WikiLlama is a LoRA fine-tuned version of TinyLlama-1.1B, trained on the WikiText-103 dataset to improve general NLP performance.
Model Details
- Base Model:
TinyLlama/TinyLlama-1.1B-Chat-v1.0 - Training Dataset: WikiText-103
- Training Method: LoRA (Low-Rank Adaptation) with base weights frozen.
- Author: Rudransh Joshi
- License: Same as TinyLlama
Evaluation & Performance
The 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% |
Example Usage
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.
- Downloads last month
- 11
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="rudranshjoshi/WikiLlama", filename="Wikillama.gguf", )