Instructions to use Manoghn/tinyllama-lesson-synthesizer with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Manoghn/tinyllama-lesson-synthesizer with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Manoghn/tinyllama-lesson-synthesizer") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Manoghn/tinyllama-lesson-synthesizer", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use Manoghn/tinyllama-lesson-synthesizer with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Manoghn/tinyllama-lesson-synthesizer" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Manoghn/tinyllama-lesson-synthesizer", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Manoghn/tinyllama-lesson-synthesizer
- SGLang
How to use Manoghn/tinyllama-lesson-synthesizer 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 "Manoghn/tinyllama-lesson-synthesizer" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Manoghn/tinyllama-lesson-synthesizer", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "Manoghn/tinyllama-lesson-synthesizer" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Manoghn/tinyllama-lesson-synthesizer", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Manoghn/tinyllama-lesson-synthesizer with Docker Model Runner:
docker model run hf.co/Manoghn/tinyllama-lesson-synthesizer
Manoghn/tinyllama-lesson-synthesizer
π Model Description
This repository hosts Manoghn/tinyllama-lesson-synthesizer, a fine-tuned TinyLlama/TinyLlama-1.1B-Chat-v1.0 model designed to generate comprehensive and engaging educational lessons. It's a key component of the larger SynthAI project, which aims to create multi-modal learning content including lessons, images, quizzes, and audio narration.
The model has been specifically adapted using LoRA (Low-Rank Adaptation) to excel at generating structured, informative text suitable for educational purposes across various domains.
π― Objective
The primary objective of this fine-tuned model is to automatically generate detailed educational lessons on diverse topics. By providing a topic, the model produces well-structured, Markdown-formatted content, serving as a foundation for broader educational material synthesis.
π Training Data
The model was fine-tuned on a custom-curated dataset of 60 educational lessons.
- Data Collection: Lessons were generated using the Llama-3.1-8B-Instruct model via the Hugging Face Inference Client. Each lesson was crafted in response to a detailed prompt instructing the model to act as an "expert educational content creator."
- Content Structure: The generated lessons adhered to a specific Markdown format, including:
- A descriptive level-1 heading.
- An introduction explaining the topic's importance.
- 3-5 key concepts with clear explanations.
- Real-world applications or examples.
- Practical examples, formulas, or code snippets (if relevant).
- A concise summary.
- Domains Covered: The dataset spans four educational domains:
- Science (e.g., Photosynthesis, Newton's Laws of Motion)
- Mathematics (e.g., Pythagorean Theorem, Quadratic Equations)
- Computer Science (e.g., Binary Number System, Data Structures Overview)
- Humanities (e.g., Renaissance Art Period, World War II Causes)
- Dataset Size: The final dataset comprised 60 high-quality lesson examples, split into training (70%), validation (15%), and test (15%) sets.
βοΈ Fine-tuning Methodology
The Manoghn/tinyllama-lesson-synthesizer model was fine-tuned from TinyLlama/TinyLlama-1.1B-Chat-v1.0 using Parameter-Efficient Fine-tuning (PEFT) with LoRA.
- Base Model:
TinyLlama/TinyLlama-1.1B-Chat-v1.0 - Quantization: The base model was loaded with 8-bit quantization using
BitsAndBytesConfigto reduce memory footprint and enable training on resource-constrained environments (Colab free tier T4 GPU). - LoRA Configuration:
r=8: LoRA ranklora_alpha=32: Scaling factortarget_modules=["q_proj", "v_proj"]: LoRA adapters applied to query and value projection layers.lora_dropout=0.05bias="none"task_type=TaskType.CAUSAL_LM
- Training Parameters (
transformers.TrainingArguments):output_dir:/content/drive/MyDrive/genai_synthesizer/resultsper_device_train_batch_size=1per_device_eval_batch_size=1learning_rate=2e-4num_train_epochs=1logging_steps=10fp16=Truereport_to="none"
- Training Environment: The fine-tuning was performed on a Google Colab free tier T4 GPU.
Model tree for Manoghn/tinyllama-lesson-synthesizer
Base model
TinyLlama/TinyLlama-1.1B-Chat-v1.0