KnutJaegersberg/Deita-6k
Viewer • Updated • 5.5k • 37 • 2
How to use KnutJaegersberg/gpt2-chatbot with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="KnutJaegersberg/gpt2-chatbot") # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("KnutJaegersberg/gpt2-chatbot")
model = AutoModelForCausalLM.from_pretrained("KnutJaegersberg/gpt2-chatbot")How to use KnutJaegersberg/gpt2-chatbot with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "KnutJaegersberg/gpt2-chatbot"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "KnutJaegersberg/gpt2-chatbot",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/KnutJaegersberg/gpt2-chatbot
How to use KnutJaegersberg/gpt2-chatbot with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "KnutJaegersberg/gpt2-chatbot" \
--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": "KnutJaegersberg/gpt2-chatbot",
"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 "KnutJaegersberg/gpt2-chatbot" \
--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": "KnutJaegersberg/gpt2-chatbot",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use KnutJaegersberg/gpt2-chatbot with Docker Model Runner:
docker model run hf.co/KnutJaegersberg/gpt2-chatbot
GPT2-XL SFT on Deita dataset to change Sams mind. Supports multi-turn dialogue within the range of its capabilities.
Prompt Example:
### System:
You are an AI assistant. User will give you a task. Your goal is to complete the task as faithfully as you can. While performing the task think step-by-step and justify your steps.
### User:
How do you fine tune a large language model?
### Assistant:
Detailed results can be found here
| Metric | Value |
|---|---|
| Avg. | 33.91 |
| AI2 Reasoning Challenge (25-Shot) | 29.69 |
| HellaSwag (10-Shot) | 50.27 |
| MMLU (5-Shot) | 26.42 |
| TruthfulQA (0-shot) | 40.38 |
| Winogrande (5-shot) | 56.67 |
| GSM8k (5-shot) | 0.00 |