defunct-datasets/eli5
Updated • 35.8k • 52
How to use pranjal0198/fine_tuned_gpt2_clm-model with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="pranjal0198/fine_tuned_gpt2_clm-model") # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("pranjal0198/fine_tuned_gpt2_clm-model")
model = AutoModelForCausalLM.from_pretrained("pranjal0198/fine_tuned_gpt2_clm-model")How to use pranjal0198/fine_tuned_gpt2_clm-model with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "pranjal0198/fine_tuned_gpt2_clm-model"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "pranjal0198/fine_tuned_gpt2_clm-model",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/pranjal0198/fine_tuned_gpt2_clm-model
How to use pranjal0198/fine_tuned_gpt2_clm-model with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "pranjal0198/fine_tuned_gpt2_clm-model" \
--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": "pranjal0198/fine_tuned_gpt2_clm-model",
"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 "pranjal0198/fine_tuned_gpt2_clm-model" \
--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": "pranjal0198/fine_tuned_gpt2_clm-model",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use pranjal0198/fine_tuned_gpt2_clm-model with Docker Model Runner:
docker model run hf.co/pranjal0198/fine_tuned_gpt2_clm-model
This model is a fine-tuned version of gpt2 on the None dataset. It achieves the following results on the evaluation set:
More information needed
More information needed
More information needed
The following hyperparameters were used during training:
| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| 3.5982 | 1.0 | 555 | 3.6067 |
| 3.5546 | 2.0 | 1110 | 3.6103 |
| 3.5102 | 3.0 | 1665 | 3.6054 |
| 3.4797 | 4.0 | 2220 | 3.6033 |
| 3.4634 | 5.0 | 2775 | 3.6053 |
| 3.4315 | 6.0 | 3330 | 3.6046 |
| 3.4116 | 7.0 | 3885 | 3.6077 |
| 3.3934 | 8.0 | 4440 | 3.6121 |
| 3.3741 | 9.0 | 4995 | 3.6158 |
| 3.3443 | 10.0 | 5550 | 3.6175 |
| 3.335 | 11.0 | 6105 | 3.6219 |
| 3.3203 | 12.0 | 6660 | 3.6227 |
| 3.3123 | 13.0 | 7215 | 3.6206 |
| 3.3154 | 14.0 | 7770 | 3.6220 |
| 3.3057 | 15.0 | 8325 | 3.6233 |
Base model
openai-community/gpt2