pszemraj/HC3-textgen-qa
Viewer • Updated • 23.9k • 54
How to use pszemraj/distilgpt2-HC3 with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="pszemraj/distilgpt2-HC3") # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("pszemraj/distilgpt2-HC3")
model = AutoModelForCausalLM.from_pretrained("pszemraj/distilgpt2-HC3")How to use pszemraj/distilgpt2-HC3 with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "pszemraj/distilgpt2-HC3"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "pszemraj/distilgpt2-HC3",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/pszemraj/distilgpt2-HC3
How to use pszemraj/distilgpt2-HC3 with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "pszemraj/distilgpt2-HC3" \
--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": "pszemraj/distilgpt2-HC3",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'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 "pszemraj/distilgpt2-HC3" \
--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": "pszemraj/distilgpt2-HC3",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use pszemraj/distilgpt2-HC3 with Docker Model Runner:
docker model run hf.co/pszemraj/distilgpt2-HC3
what happens if you train a smaller model on a dataset of chatGPT responses?
This happens.
This model is a fine-tuned version of distilgpt2 on the "chatgpt answers" column of the Hello-SimpleAI/HC3 dataset.
It achieves the following results on the evaluation set:
Despite how it sounds, this model only has 80m parameters and will likely not be factually accurate most of the time.
Modifications made w.r.t. original dataset:
QUESTION_TEXT <answer> CHATGPT_ANSWER_TEXT <end_answer><answer> and <end_answer> serve as added tokens to help the model learn "turns" in the conversationThe following hyperparameters were used during training:
| Training Loss | Epoch | Step | Validation Loss | Accuracy |
|---|---|---|---|---|
| 2.2485 | 0.98 | 41 | 2.1457 | 0.5158 |
| 2.0757 | 1.98 | 82 | 2.0584 | 0.5304 |
| 1.966 | 2.98 | 123 | 2.0210 | 0.5376 |
| 1.8602 | 3.98 | 164 | 2.0012 | 0.5422 |
| 1.8089 | 4.98 | 205 | 1.9977 | 0.5436 |
| 1.7698 | 5.98 | 246 | 1.9983 | 0.5441 |
Detailed results can be found here
| Metric | Value |
|---|---|
| Avg. | 28.18 |
| AI2 Reasoning Challenge (25-Shot) | 24.66 |
| HellaSwag (10-Shot) | 27.99 |
| MMLU (5-Shot) | 23.95 |
| TruthfulQA (0-shot) | 42.10 |
| Winogrande (5-shot) | 50.36 |
| GSM8k (5-shot) | 0.00 |