Gustavosta/Stable-Diffusion-Prompts
Viewer • Updated • 81.9k • 13.7k • 523
How to use RamAnanth1/distilgpt2-sd-prompts with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="RamAnanth1/distilgpt2-sd-prompts") # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("RamAnanth1/distilgpt2-sd-prompts")
model = AutoModelForCausalLM.from_pretrained("RamAnanth1/distilgpt2-sd-prompts")How to use RamAnanth1/distilgpt2-sd-prompts with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "RamAnanth1/distilgpt2-sd-prompts"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "RamAnanth1/distilgpt2-sd-prompts",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/RamAnanth1/distilgpt2-sd-prompts
How to use RamAnanth1/distilgpt2-sd-prompts with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "RamAnanth1/distilgpt2-sd-prompts" \
--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": "RamAnanth1/distilgpt2-sd-prompts",
"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 "RamAnanth1/distilgpt2-sd-prompts" \
--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": "RamAnanth1/distilgpt2-sd-prompts",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use RamAnanth1/distilgpt2-sd-prompts with Docker Model Runner:
docker model run hf.co/RamAnanth1/distilgpt2-sd-prompts
This model is a fine-tuned version of distilgpt2 on Stable-Diffusion-Prompts. 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 |
|---|---|---|---|
| 2.5122 | 1.93 | 500 | 1.5211 |
| 1.2912 | 3.86 | 1000 | 1.1045 |
| 0.9313 | 5.79 | 1500 | 0.9704 |
| 0.7744 | 7.72 | 2000 | 0.9450 |