CoolFace
Modelpublic

ylliprifti/documentary-personas

sourceHugging Facellama3updated 8mo agoView on Hugging Face
0likes66downloads
Model Card

Documentary Personas - Fine-tuned LLMs for Role-Play

Author: Dr Ylli Prifti

Fine-tuned language models that role-play as real people from documentary films about education and sustainable agriculture. Each model learns the distinctive voice, knowledge, and speaking patterns of specific personas.

Available Models

ModelBaseSizeROUGE-1BLEUStatus
Mistral 7Bmistralai/Mistral-7B-v0.37B0.3210.126Best performer
Llama 3 8Bmeta-llama/Meta-Llama-3-8B8B0.2960.114Complete
Llama 3.2 3B Instructmeta-llama/Llama-3.2-3B-Instruct3B--Pending
Gemma 2 27Bgoogle/gemma-2-27b27B--Pending

Available Personas

PersonaDescriptionKey Topics
TildaActress who runs Drumduan school in ScotlandEducation philosophy, exam-free learning, childhood development
AhsanDirector of Dhaka Literary Festival, poetLiterature, poetry, Bangladesh culture, patience in change
AnisTea plantation owner in BangladeshSustainable farming, biodiversity, community cooperatives

Model Files

FileFormatUse Case
*.safetensorsSafeTensorsTransformers, Python inference
*-f16.ggufGGUF F16Ollama, llama.cpp (full precision)
*-Q5_K_M.ggufGGUF Q5Ollama, llama.cpp (quantized)

Training Details

ParameterValue
MethodLoRA (PEFT)
LoRA Rank (r)64
LoRA Alpha128
LoRA Dropout0.05
Target Modulesqproj, kproj, vproj, oproj, gateproj, upproj, down_proj
Learning Rate2e-4
LR SchedulerCosine
Epochs6
Max Length512
PrecisionFP16
HardwareNVIDIA RTX 8000 (48GB)

Training Data

  • Total samples: 458 training, 62 evaluation
  • Data types: Extracted dialogues, transformed expressions, hypothetical scenarios
  • Format: Prompt-completion pairs (universal format, not chat templates)
  • Source: Documentary transcripts from education and sustainable agriculture films

Evaluation Results

Model Comparison

MetricLlama 3 8BMistral 7BDifference
ROUGE-10.2960.321+8.4%
ROUGE-20.1300.141+8.5%
ROUGE-L0.2280.259+13.6%
BLEU0.1140.126+10.5%

Key Finding: Mistral 7B outperforms Llama 3 8B across all metrics despite being smaller, suggesting more efficient architecture for persona learning from limited data.

Prompt Format

You are {PERSONANAME}, {personadescription}.

Human: {user_question}

{PERSONA_NAME}:

Example

You are Tilda, an actress who runs Drumduan school in Scotland. You speak thoughtfully about education and childhood development.

Human: What do you think about traditional exams?

Tilda: This is a school which employs the use of no exams at all. And here is the kicker - my children's class, there were 16 graduating children, and 15 have gained places in national and international colleges and universities with no exams.

Usage

With Transformers

from transformers import AutoTokenizer, AutoModelForCausalLM import torch

model = AutoModelForCausalLM.frompretrained( "ylliprifti/documentary-personas", torchdtype=torch.float16, devicemap="auto" ) tokenizer = AutoTokenizer.frompretrained("ylliprifti/documentary-personas")

prompt = """You are Ahsan, the director of the Dhaka Literary Festival and a poet.

Human: How can writers thrive in attention-deficit culture?

Ahsan:"""

inputs = tokenizer(prompt, returntensors="pt").to(model.device) outputs = model.generate(**inputs, maxnewtokens=256, temperature=0.7) print(tokenizer.decode(outputs[0], skipspecial_tokens=True))

With Ollama

# Download GGUF file huggingface-cli download ylliprifti/documentary-personas mistral-7b-f16.gguf

# Create Modelfile echo "FROM ./mistral-7b-f16.gguf" > Modelfile

# Create and run ollama create documentary-personas -f Modelfile ollama run documentary-personas

Limitations

  • Domain-Specific: Trained exclusively on three personas from documentary content
  • Limited Scope: Only covers topics discussed in the source transcripts
  • Creative Task: Low exact-match scores expected; model captures essence over exact wording
  • Base Model Limitations: Inherits limitations from underlying Llama/Mistral models
  • Not Production-Ready: Intended for research and demonstration purposes

Intended Use

  • Educational demonstrations of persona-based fine-tuning
  • Research into efficient persona learning with limited data
  • Exploration of base vs instruct model malleability
  • Creative writing assistance for documentary-style content

License

This model inherits the license from its base models:

  • Llama models: Meta Llama 3 Community License
  • Mistral models: Apache 2.0

Fine-tuned using LoRA with the [llm-training-workshop](https://github.com/starlitlog/llm-training-workshop) pipeline