Text Generation
PEFT
Safetensors
Transformers
llama-factory
lora
question-generation
education
secondary-school
conversational
Instructions to use tokhey/question_generation_1.5B_model_v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use tokhey/question_generation_1.5B_model_v2 with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-1.5B-Instruct") model = PeftModel.from_pretrained(base_model, "tokhey/question_generation_1.5B_model_v2") - Transformers
How to use tokhey/question_generation_1.5B_model_v2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="tokhey/question_generation_1.5B_model_v2") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("tokhey/question_generation_1.5B_model_v2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use tokhey/question_generation_1.5B_model_v2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "tokhey/question_generation_1.5B_model_v2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tokhey/question_generation_1.5B_model_v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/tokhey/question_generation_1.5B_model_v2
- SGLang
How to use tokhey/question_generation_1.5B_model_v2 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 "tokhey/question_generation_1.5B_model_v2" \ --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": "tokhey/question_generation_1.5B_model_v2", "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 "tokhey/question_generation_1.5B_model_v2" \ --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": "tokhey/question_generation_1.5B_model_v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use tokhey/question_generation_1.5B_model_v2 with Docker Model Runner:
docker model run hf.co/tokhey/question_generation_1.5B_model_v2
Update README.md
Browse files
README.md
CHANGED
|
@@ -7,68 +7,117 @@ tags:
|
|
| 7 |
- llama-factory
|
| 8 |
- lora
|
| 9 |
- transformers
|
|
|
|
|
|
|
|
|
|
| 10 |
pipeline_tag: text-generation
|
| 11 |
model-index:
|
| 12 |
- name: question_generation_1.5B_model_v2
|
| 13 |
results: []
|
| 14 |
---
|
| 15 |
|
| 16 |
-
|
| 17 |
-
should probably proofread and complete it, then remove this comment. -->
|
| 18 |
|
| 19 |
-
|
| 20 |
|
| 21 |
-
|
| 22 |
-
It achieves the following results on the evaluation set:
|
| 23 |
-
- Loss: 1.4209
|
| 24 |
|
| 25 |
-
|
| 26 |
|
| 27 |
-
|
| 28 |
|
| 29 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
|
| 31 |
-
|
| 32 |
|
| 33 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
|
| 35 |
-
|
| 36 |
|
| 37 |
-
|
|
|
|
|
|
|
|
|
|
| 38 |
|
| 39 |
-
##
|
| 40 |
|
| 41 |
-
The
|
| 42 |
-
- learning_rate: 0.0005
|
| 43 |
-
- train_batch_size: 1
|
| 44 |
-
- eval_batch_size: 1
|
| 45 |
-
- seed: 42
|
| 46 |
-
- gradient_accumulation_steps: 8
|
| 47 |
-
- total_train_batch_size: 8
|
| 48 |
-
- optimizer: Use OptimizerNames.ADAMW_TORCH_FUSED with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
|
| 49 |
-
- lr_scheduler_type: cosine
|
| 50 |
-
- lr_scheduler_warmup_ratio: 0.1
|
| 51 |
-
- num_epochs: 10.0
|
| 52 |
-
- mixed_precision_training: Native AMP
|
| 53 |
|
| 54 |
-
##
|
| 55 |
|
| 56 |
-
|
| 57 |
-
|:-------------:|:------:|:----:|:---------------:|
|
| 58 |
-
| 0.6345 | 1.1371 | 100 | 0.6876 |
|
| 59 |
-
| 0.472 | 2.2743 | 200 | 0.7193 |
|
| 60 |
-
| 0.3499 | 3.4114 | 300 | 0.7964 |
|
| 61 |
-
| 0.2457 | 4.5486 | 400 | 0.9142 |
|
| 62 |
-
| 0.1229 | 5.6857 | 500 | 1.0490 |
|
| 63 |
-
| 0.0728 | 6.8229 | 600 | 1.1975 |
|
| 64 |
-
| 0.0398 | 7.96 | 700 | 1.3178 |
|
| 65 |
-
| 0.0213 | 9.0914 | 800 | 1.3991 |
|
| 66 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
|
| 68 |
-
###
|
| 69 |
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
-
|
| 74 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
- llama-factory
|
| 8 |
- lora
|
| 9 |
- transformers
|
| 10 |
+
- question-generation
|
| 11 |
+
- education
|
| 12 |
+
- secondary-school
|
| 13 |
pipeline_tag: text-generation
|
| 14 |
model-index:
|
| 15 |
- name: question_generation_1.5B_model_v2
|
| 16 |
results: []
|
| 17 |
---
|
| 18 |
|
| 19 |
+
# Question Generation 1.5B Model v2
|
|
|
|
| 20 |
|
| 21 |
+
A fine-tuned language model specifically designed to generate high-quality English comprehension and assessment questions for secondary school students. This model is optimized to create questions aligned with standard educational curricula and learning objectives.
|
| 22 |
|
| 23 |
+
## Model Description
|
|
|
|
|
|
|
| 24 |
|
| 25 |
+
This model is a LoRA (Low-Rank Adaptation) fine-tuned version of [Qwen/Qwen2.5-1.5B-Instruct](https://huggingface.co/Qwen/Qwen2.5-1.5B-Instruct). It has been trained specifically on educational question generation tasks to produce contextually relevant, pedagogically sound questions suitable for secondary school assessment.
|
| 26 |
|
| 27 |
+
### Key Features
|
| 28 |
|
| 29 |
+
- **Lightweight and Efficient**: 1.5B parameters with LoRA adaptation for fast inference
|
| 30 |
+
- **Education-Focused**: Trained on curated educational content
|
| 31 |
+
- **Curriculum-Aligned**: Questions follow standard secondary school curricula and learning outcomes
|
| 32 |
+
- **Question Variety**: Capable of generating multiple question types (multiple choice, short answer, essay prompts, etc.)
|
| 33 |
+
- **Context-Aware**: Generates questions based on provided text passages or topics
|
| 34 |
|
| 35 |
+
## Intended Use
|
| 36 |
|
| 37 |
+
This model is intended for:
|
| 38 |
+
- **Educational Content Creation**: Generating practice questions and assessments for secondary school students
|
| 39 |
+
- **Curriculum Support**: Creating supplementary learning materials aligned with educational standards
|
| 40 |
+
- **Assessment Design**: Assisting educators in developing comprehension questions and quiz content
|
| 41 |
+
- **Language Learning**: Generating English language proficiency assessment questions
|
| 42 |
|
| 43 |
+
### Limitations
|
| 44 |
|
| 45 |
+
- Designed for English language question generation
|
| 46 |
+
- Best performance on secondary school level content (ages 14-18)
|
| 47 |
+
- May require post-processing or human review for use in high-stakes assessments
|
| 48 |
+
- Performance may vary with non-English text inputs
|
| 49 |
|
| 50 |
+
## Training Data
|
| 51 |
|
| 52 |
+
The model was fine-tuned on a curated dataset of secondary school English curriculum materials and assessment question templates. Training data includes various question types aligned with standard educational frameworks.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
|
| 54 |
+
## Training Procedure
|
| 55 |
|
| 56 |
+
### Hyperparameters
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
|
| 58 |
+
| Parameter | Value |
|
| 59 |
+
|-----------|-------|
|
| 60 |
+
| Learning Rate | 0.0005 |
|
| 61 |
+
| Training Batch Size | 8 (gradient accumulation) |
|
| 62 |
+
| Epochs | 10 |
|
| 63 |
+
| Optimizer | AdamW (fused) |
|
| 64 |
+
| LR Scheduler | Cosine with 0.1 warmup ratio |
|
| 65 |
+
| Seed | 42 |
|
| 66 |
+
| Training Precision | Native AMP (Mixed Precision) |
|
| 67 |
|
| 68 |
+
### Training Performance
|
| 69 |
|
| 70 |
+
The model achieved strong convergence with decreasing training loss across epochs:
|
| 71 |
+
|
| 72 |
+
| Epoch | Step | Training Loss |
|
| 73 |
+
|-------|------|---------------|
|
| 74 |
+
| 1.1 | 100 | 0.6345 |
|
| 75 |
+
| 2.3 | 200 | 0.4720 |
|
| 76 |
+
| 3.4 | 300 | 0.3499 |
|
| 77 |
+
| 4.5 | 400 | 0.2457 |
|
| 78 |
+
| 5.7 | 500 | 0.1229 |
|
| 79 |
+
| 6.8 | 600 | 0.0728 |
|
| 80 |
+
| 8.0 | 700 | 0.0398 |
|
| 81 |
+
| 9.1 | 800 | 0.0213 |
|
| 82 |
+
|
| 83 |
+
The model demonstrates consistent improvement in question generation quality as training progresses, with training loss decreasing from 0.63 to 0.02.
|
| 84 |
+
|
| 85 |
+
## Framework Versions
|
| 86 |
+
|
| 87 |
+
- PEFT: 0.17.1
|
| 88 |
+
- Transformers: 4.57.1
|
| 89 |
+
- PyTorch: 2.9.0+cu126
|
| 90 |
+
- Datasets: 4.0.0
|
| 91 |
+
- Tokenizers: 0.22.1
|
| 92 |
+
|
| 93 |
+
## Usage
|
| 94 |
+
|
| 95 |
+
```python
|
| 96 |
+
from peft import AutoPeftModelForCausalLM
|
| 97 |
+
from transformers import AutoTokenizer
|
| 98 |
+
|
| 99 |
+
model_id = "tokhey/question_generation_1.5B_model_v2"
|
| 100 |
+
model = AutoPeftModelForCausalLM.from_pretrained(model_id)
|
| 101 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 102 |
+
|
| 103 |
+
# Generate questions from a passage
|
| 104 |
+
prompt = "Generate 3 comprehension questions about: [your text passage]"
|
| 105 |
+
inputs = tokenizer(prompt, return_tensors="pt")
|
| 106 |
+
outputs = model.generate(**inputs, max_length=512)
|
| 107 |
+
print(tokenizer.decode(outputs[0]))
|
| 108 |
+
```
|
| 109 |
+
|
| 110 |
+
## Recommendations for Use
|
| 111 |
+
|
| 112 |
+
- Test the model on sample content before deploying in production
|
| 113 |
+
- Review generated questions for accuracy and appropriateness
|
| 114 |
+
- Use as an assistive tool to reduce educator workload, not as a sole assessment creation method
|
| 115 |
+
- Provide context and learning materials with generated questions for optimal student engagement
|
| 116 |
+
|
| 117 |
+
## License
|
| 118 |
+
|
| 119 |
+
Apache License 2.0
|
| 120 |
+
|
| 121 |
+
---
|
| 122 |
+
|
| 123 |
+
*This model card was automatically generated and updated. For questions or contributions, please reach out to the model developers.*
|