Text Generation
Transformers
PyTorch
Safetensors
gpt2
stable-diffusion
prompt-generator
distilgpt2
text-generation-inference
Instructions to use FredZhang7/distilgpt2-stable-diffusion with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use FredZhang7/distilgpt2-stable-diffusion with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="FredZhang7/distilgpt2-stable-diffusion")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("FredZhang7/distilgpt2-stable-diffusion") model = AutoModelForCausalLM.from_pretrained("FredZhang7/distilgpt2-stable-diffusion", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use FredZhang7/distilgpt2-stable-diffusion with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "FredZhang7/distilgpt2-stable-diffusion" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "FredZhang7/distilgpt2-stable-diffusion", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/FredZhang7/distilgpt2-stable-diffusion
- SGLang
How to use FredZhang7/distilgpt2-stable-diffusion 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 "FredZhang7/distilgpt2-stable-diffusion" \ --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": "FredZhang7/distilgpt2-stable-diffusion", "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 "FredZhang7/distilgpt2-stable-diffusion" \ --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": "FredZhang7/distilgpt2-stable-diffusion", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use FredZhang7/distilgpt2-stable-diffusion with Docker Model Runner:
docker model run hf.co/FredZhang7/distilgpt2-stable-diffusion
Commit History
-
Adding `safetensors` variant of this model (#3)
- Adding `safetensors` variant of this model (41c46ff18b2638aa53a4e30593dab8a3d3472c8d) Co-authored-by: Safetensors convertbot <SFconvertbot@users.noreply.huggingface.co>3470345
-
Update README.md
4273527 -
Update README.md
1477bd2 -
Update README.md
e974acd -
Update README.md
439443f
-
Update README.md
313ce0b -
Update README.md
553d127
-
Update README.md
f962e50
-
Update README.md
db69141 -
Update README.md
e1fca34 -
Update README.md
259f714
-
Update README.md
d446987 -
Update README.md
dc74dda
-
Upload training_args.bin
84173b5 -
Upload config.json
f5113e5 -
Delete config.json
0014ba9 -
Update config.json
984eebd -
Create vocab.json
f2be806 -
Create tokenizer.json
b2ebfa8 -
Upload config.json
2fa0426 -
Delete config.json
5e36ab5 -
Delete distil-sd-gpt2.pt
52d1658 -
Update README.md
c644647 -
Update README.md
7d8f63e -
Upload pytorch_model.bin
6f8b642 -
Upload config.json
c37456b
-
Update README.md
11038c0 -
Upload prompt-examples.png
b68bf81 -
Delete krea.ai.txt
3cf87f1 -
Update README.md
c5983e7 -
Update krea.ai.txt
a906af9 -
Update README.md
3496859 -
Fixed typo
b7d055a -
Fixed another typo
96f138d -
Fixed typo
b0df11a -
Update README.md
c4330c7 -
Update README.md
17b2af5 -
Update README.md
94e9bb0 -
Upload krea.ai.txt
458f530 -
Update README.md
ab114ee -
Upload distil-sd-gpt2.pt
0aabb74 -
initial commit
bb39318