Text Generation
Transformers
Safetensors
PEFT
English
linkedin
content-generation
social-media
lora
llama
fine-tuned
Instructions to use slavayosome/llama-3.2-3b-linkedin-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use slavayosome/llama-3.2-3b-linkedin-lora with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="slavayosome/llama-3.2-3b-linkedin-lora")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("slavayosome/llama-3.2-3b-linkedin-lora", dtype="auto") - PEFT
How to use slavayosome/llama-3.2-3b-linkedin-lora with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use slavayosome/llama-3.2-3b-linkedin-lora with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "slavayosome/llama-3.2-3b-linkedin-lora" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "slavayosome/llama-3.2-3b-linkedin-lora", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/slavayosome/llama-3.2-3b-linkedin-lora
- SGLang
How to use slavayosome/llama-3.2-3b-linkedin-lora with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "slavayosome/llama-3.2-3b-linkedin-lora" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "slavayosome/llama-3.2-3b-linkedin-lora", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "slavayosome/llama-3.2-3b-linkedin-lora" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "slavayosome/llama-3.2-3b-linkedin-lora", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use slavayosome/llama-3.2-3b-linkedin-lora with Docker Model Runner:
docker model run hf.co/slavayosome/llama-3.2-3b-linkedin-lora
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
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
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 configurationtokenizer.json: Tokenizer vocabularytokenizer_config.json: Tokenizer configurationspecial_tokens_map.json: Special token mappingstraining_info.json: Training metadata
License
Apache 2.0
Citation
@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}
}
Model tree for slavayosome/llama-3.2-3b-linkedin-lora
Base model
meta-llama/Llama-3.2-3B-Instruct Finetuned
unsloth/Llama-3.2-3B-Instruct