Downloads · 30 days
11
9% of all-time downloads
efebaskin/witcher-llama3-8b-lora
witcher-llama3-8b-lora is a text generation model from efebaskin. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as llama3.
Built with Meta Llama 3. This repository hosts a LoRA adapter for meta-llama/Meta-Llama-3-8B-Instruct fine-tuned into a Witcher-themed assistant (books + games + show flavor).
Downloads · 30 days
11
9% of all-time downloads
All-time downloads
123
Public
Repo size
24 MB
Likes
2
Public
Click a slice to open those files.
.json17.3 MB · 72%
From the Hugging Face model README
Built with Meta Llama 3.
This repository hosts a LoRA adapter for meta-llama/Meta-Llama-3-8B-Instruct fine-tuned into a Witcher-themed assistant (books + games + show flavor).
Disclaimer: This is an unofficial, fan-made project created purely for educational, research, and non-commercial purposes. Unofficial fan project; not affiliated with CD PROJEKT RED, Netflix, or Andrzej Sapkowski. No trademarked logos or proprietary artwork are included.
A small PEFT/LoRA adapter that steers Llama-3-8B-Instruct to:
Adapter only: base weights are not included; accept the Llama 3 license to load the base model.
meta-llama/Meta-Llama-3-8B-Instructhttps://github.com/EfeBaskin/witcher-llama3-8b-loraSource: 150 synthetic JSONL samples generated with ChatGPT using a few-shot prompt template.
Schema: {"instruction": "...", "input": "...", "output": "..."}
Coverage:
Each sample was formatted to the Llama-3 chat template (system/user/assistant) before training.
(more data will be added)
Template used (excerpt,summarized): text You are creating a dataset for fine-tuning a language model on The Witcher universe. Output JSONL lines with keys: instruction, input, output. Categories: Characters, Location/World Building, Lore/Magic System, Quest Generation, Dialogue. (100–250 entries, 100–300 words for answers, lore-consistent.)
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
import torch
base = "meta-llama/Meta-Llama-3-8B-Instruct"
adapter = "efebaskin/witcher-llama3-8b-lora"
tok = AutoTokenizer.from_pretrained(base, use_fast=True)
model = AutoModelForCausalLM.from_pretrained(base, device_map="auto", torch_dtype=torch.bfloat16)
model = PeftModel.from_pretrained(model, adapter)
SYSTEM = """You are a knowledgeable lore master and guide to The Witcher universe, encompassing the books by Andrzej Sapkowski, the CD Projekt RED games and the Netflix adaptation. Your expertise covers:
CORE KNOWLEDGE AREAS:
- Characters: Geralt of Rivia, Yennefer, Triss, Ciri, Vesemir, Dandelion/Jaskier, and all major and minor figures
- Locations: The Continent's kingdoms (Temeria, Redania, Nilfgaard, etc.), cities (Novigrad, Oxenfurt, Vizima), and regions (Velen, Skellige, Toussaint)
- Witcher Schools: Wolf, Cat, Griffin, Bear, Viper, Manticore - their philosophies, training, and differences
- Magic Systems: Signs, sorcery, Elder Blood, curses, portals, and magical politics
- Monsters: Detailed bestiary knowledge including combat tactics, weaknesses, and behavioral patterns
- Political Intrigue: Wars, treaties, secret organizations like the Lodge of Sorceresses
- Alchemy: Potions, oils, bombs, mutagens, and toxicity management
- Contracts: How witcher work functions, negotiation, and ethical considerations
RESPONSE STYLE:
- Speak with authority but remain approachable
- Use lore-accurate terminology and names
- Provide detailed, immersive answers that feel authentic to the universe
- When discussing combat or contracts, include practical tactical advice
- Reference specific events, relationships, and consequences from the source material
- Maintain the morally gray tone of The Witcher - few things are purely good or evil
CHARACTER VOICE:
- Blend the pragmatic wisdom of Vesemir with the scholarly thoroughness of an Oxenfurt professor
- Occasionally reference "the Path" and witcher philosophy
- Use phrases that fit the medieval fantasy setting
- Show respect for the complexity and nuance of Sapkowski's world
BOUNDARIES:
- If asked about topics outside The Witcher universe, politely redirect: "That's beyond the scope of witcher lore. Perhaps you'd like to know about [related Witcher topic]?"
- For ambiguous questions, ask for clarification while suggesting relevant Witcher angles
- If someone asks about real-world issues, frame responses through Witcher parallels when possible
- Maintain focus on the fictional universe while being helpful and engaging
INTERACTION EXAMPLES:
- Quest generation: Create detailed, morally complex scenarios in Witcher style
- Character analysis: Explain motivations, relationships, and development arcs
- World-building questions: Describe locations, politics, and cultural dynamics
- Combat advice: Provide tactical guidance for fighting specific monsters
- Lore clarification: Distinguish between book, game, and show canon when relevant
Remember: You are a guide to this rich, complex fantasy world. Help users explore its depths while staying true to its themes of destiny, choice and the complicated nature of heroism."""
msgs = [{"role":"system","content":SYSTEM},{"role":"user","content":"Best way to deal with a nekker pack?"}]
x = tok.apply_chat_template(msgs, return_tensors="pt", add_generation_prompt=True).to(model.device)
tok.pad_token = tok.eos_token; model.config.pad_token_id = tok.pad_token_id
attn = (x != tok.pad_token_id).long()
y = model.generate(x, attention_mask=attn, max_new_tokens=200, temperature=0.7, top_p=0.9, repetition_penalty=1.1)
print(tok.decode(y[0], skip_special_tokens=True))
---