Instructions to use shehrozrafaqat/football-llama31-8b-qlora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use shehrozrafaqat/football-llama31-8b-qlora with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("unsloth/Meta-Llama-3.1-8B-Instruct-bnb-4bit") model = PeftModel.from_pretrained(base_model, "shehrozrafaqat/football-llama31-8b-qlora") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Unsloth Studio
How to use shehrozrafaqat/football-llama31-8b-qlora 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 shehrozrafaqat/football-llama31-8b-qlora 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 shehrozrafaqat/football-llama31-8b-qlora to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for shehrozrafaqat/football-llama31-8b-qlora to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="shehrozrafaqat/football-llama31-8b-qlora", max_seq_length=2048, )
Football Llama 3.1 8B QLoRA Adapter
This repository contains a PEFT LoRA adapter fine-tuned for a global football knowledge assistant assignment.
It is not a full copied model. Load the base model first, then attach this adapter.
- Base model:
unsloth/Meta-Llama-3.1-8B-Instruct-bnb-4bit - Adapter repo:
shehrozrafaqat/football-llama31-8b-qlora - Dataset:
shehrozrafaqat/global-football-assistant-dataset - Training route: Unsloth + TRL
SFTTrainer+ QLoRA - Training hardware: Google Colab Tesla T4
- Training run: 1 epoch, 3,840 steps
- Final Colab training loss: 2.3110
- Dataset verified date: 2026-04-23
Dataset
The synthetic ChatML dataset contains 9,600 examples:
- Train: 7,680
- Validation: 960
- Test: 960
- Held-out bonus evaluation prompts: 240
- Duplicate user prompts: 0
- Training/evaluation prompt overlap: 0
The dataset covers FIFA/global football, continental competitions, domestic leagues, clubs, rules, tactics, positions, analytics, history, and date-aware safety behavior.
Included Evaluation Files
This repo includes two 20-prompt held-out comparison files:
base_model_eval.jsonlfinetuned_model_eval.jsonl
Each row includes:
promptexpected_answermodel_answersubjectcategory
These files are useful for assignment evidence because the 8B model is too large to load comfortably on a normal laptop CPU.
Inference Example
Use a GPU runtime for live inference.
import torch
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
base_model_id = "unsloth/Meta-Llama-3.1-8B-Instruct-bnb-4bit"
adapter_id = "shehrozrafaqat/football-llama31-8b-qlora"
bnb_config = BitsAndBytesConfig(load_in_4bit=True)
tokenizer = AutoTokenizer.from_pretrained(adapter_id)
base_model = AutoModelForCausalLM.from_pretrained(
base_model_id,
quantization_config=bnb_config,
device_map="auto",
torch_dtype=torch.float16,
)
model = PeftModel.from_pretrained(base_model, adapter_id)
model.eval()
messages = [
{"role": "system", "content": "You are a careful football knowledge assistant."},
{"role": "user", "content": "Explain goal difference in football."},
]
prompt = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
with torch.no_grad():
output_ids = model.generate(
**inputs,
max_new_tokens=120,
do_sample=False,
pad_token_id=tokenizer.eos_token_id,
)
answer_ids = output_ids[0][inputs["input_ids"].shape[-1]:]
print(tokenizer.decode(answer_ids, skip_special_tokens=True).strip())
Notes
The model is intended for assignment demonstration and controlled evaluation, not for live football news. Current fixtures, scores, standings, transfers, injuries, and manager status should be verified from official or trusted current sources.
- Downloads last month
- 4
Model tree for shehrozrafaqat/football-llama31-8b-qlora
Base model
meta-llama/Llama-3.1-8B