CoolFace
Modelpublic

slavayosome/llama-3.2-3b-linkedin-lora

sourceHugging Faceapache-2.0updated 1y agoView on Hugging Face
3likes
Model Card

LinkedIn Content Generator - LoRA Adapter

This repository contains a LoRA (Low-Rank Adaptation) adapter for fine-tuning Llama 3.2 3B Instruct to generate high-quality LinkedIn content.

Model Details

  • —Base Model: unsloth/Llama-3.2-3B-Instruct
  • —Adapter Type: LoRA (Low-Rank Adaptation)
  • —Training Data: Curated LinkedIn content dataset
  • —Specialization: LinkedIn posts, articles, and professional content generation

Features

  • —17 Tones: Professional, conversational, inspirational, thought-provoking, educational, storytelling, humorous, motivational, analytical, personal, industry-expert, controversial, supportive, celebratory, questioning, bold, empathetic
  • —15 Formats: Post, article, poll, carousel, video-script, infographic-text, case-study, how-to, list, quote, announcement, behind-the-scenes, industry-news, personal-story, tip-series
  • —5 Lengths: Short, medium, long, very-long, thread
  • —16 Audiences: Entrepreneurs, executives, marketers, developers, sales-professionals, hr-professionals, consultants, freelancers, students, job-seekers, industry-leaders, small-business-owners, remote-workers, creatives, general-professional, investors

Usage

With Transformers + PEFT

python
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
import torch

# Load base model and tokenizer
base_model_name = "unsloth/Llama-3.2-3B-Instruct"
model = AutoModelForCausalLM.from_pretrained(
    base_model_name,
    torch_dtype=torch.float16,
    device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained(base_model_name)

# Load LoRA adapter
model = PeftModel.from_pretrained(model, "slavayosome/llama-3.2-3b-linkedin-lora")
model = model.merge_and_unload()

# Generate content
prompt = \"\"\"### System
You are an expert LinkedIn content creator. Generate high-quality LinkedIn content based on the specified parameters.

Parameters:
- Topic: AI in business
- Tone: professional
- Format: post
- Length: medium
- Target Audience: entrepreneurs

### User
Create a medium post about AI in business in a professional tone for entrepreneurs.

### Assistant
\"\"\"

inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=512, temperature=0.7)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response.split("### Assistant")[-1].strip())

With HuggingFace Hub

python
from huggingface_hub import snapshot_download

# Download adapter files
adapter_path = snapshot_download(repo_id="slavayosome/llama-3.2-3b-linkedin-lora")

API Usage

For production use, check out the LinkedIn Content Generator API deployed on Hugging Face Spaces.

Training Details

  • —Training Framework: Unsloth + LoRA
  • —Rank: 16
  • —Alpha: 32
  • —Target Modules: All linear layers
  • —Training Steps: 1000+ steps
  • —Learning Rate: 2e-4

Performance

  • —GPU Inference: ~1-2 seconds per generation (T4)
  • —CPU Inference: ~5-10 seconds per generation
  • —Memory Usage: ~6GB VRAM (with base model)

Files

  • —adapter_model.safetensors: LoRA adapter weights (1.8GB)
  • —adapter_config.json: LoRA configuration
  • —tokenizer.json: Tokenizer vocabulary
  • —tokenizer_config.json: Tokenizer configuration
  • —special_tokens_map.json: Special token mappings
  • —training_info.json: Training metadata

License

Apache 2.0

Citation

bibtex
@misc{linkedin-content-generator-lora,
  title={LinkedIn Content Generator LoRA Adapter},
  author={Your Name},
  year={2024},
  publisher={HuggingFace},
  url={https://huggingface.co/slavayosome/llama-3.2-3b-linkedin-lora}
}