Text Generation
Transformers
PyTorch
TensorBoard
Safetensors
gpt2
Generated from Trainer
text-generation-inference
Instructions to use aabidk/distilgpt2-sd with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use aabidk/distilgpt2-sd with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="aabidk/distilgpt2-sd")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("aabidk/distilgpt2-sd") model = AutoModelForCausalLM.from_pretrained("aabidk/distilgpt2-sd") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use aabidk/distilgpt2-sd with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "aabidk/distilgpt2-sd" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "aabidk/distilgpt2-sd", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/aabidk/distilgpt2-sd
- SGLang
How to use aabidk/distilgpt2-sd 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 "aabidk/distilgpt2-sd" \ --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": "aabidk/distilgpt2-sd", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "aabidk/distilgpt2-sd" \ --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": "aabidk/distilgpt2-sd", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use aabidk/distilgpt2-sd with Docker Model Runner:
docker model run hf.co/aabidk/distilgpt2-sd
Update README.md
Browse files
README.md
CHANGED
|
@@ -6,6 +6,8 @@ tags:
|
|
| 6 |
model-index:
|
| 7 |
- name: distilgpt2-sd
|
| 8 |
results: []
|
|
|
|
|
|
|
| 9 |
---
|
| 10 |
|
| 11 |
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
|
@@ -13,7 +15,7 @@ should probably proofread and complete it, then remove this comment. -->
|
|
| 13 |
|
| 14 |
# distilgpt2-sd
|
| 15 |
|
| 16 |
-
This model is a fine-tuned version of [distilgpt2](https://huggingface.co/distilgpt2) on
|
| 17 |
It achieves the following results on the evaluation set:
|
| 18 |
- Loss: 1.4481
|
| 19 |
|
|
@@ -108,4 +110,4 @@ The following hyperparameters were used during training:
|
|
| 108 |
- Transformers 4.31.0
|
| 109 |
- Pytorch 2.0.1+cu118
|
| 110 |
- Datasets 2.13.1
|
| 111 |
-
- Tokenizers 0.13.3
|
|
|
|
| 6 |
model-index:
|
| 7 |
- name: distilgpt2-sd
|
| 8 |
results: []
|
| 9 |
+
datasets:
|
| 10 |
+
- Gustavosta/Stable-Diffusion-Prompts
|
| 11 |
---
|
| 12 |
|
| 13 |
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
|
|
|
| 15 |
|
| 16 |
# distilgpt2-sd
|
| 17 |
|
| 18 |
+
This model is a fine-tuned version of [distilgpt2](https://huggingface.co/distilgpt2) on [Stable-Diffusion-Prompt](https://huggingface.co/datasets/Gustavosta/Stable-Diffusion-Prompts) dataset.
|
| 19 |
It achieves the following results on the evaluation set:
|
| 20 |
- Loss: 1.4481
|
| 21 |
|
|
|
|
| 110 |
- Transformers 4.31.0
|
| 111 |
- Pytorch 2.0.1+cu118
|
| 112 |
- Datasets 2.13.1
|
| 113 |
+
- Tokenizers 0.13.3
|