Text Generation
Transformers
PyTorch
Safetensors
gpt2
text generation
stable diffusion
midjourney
text2image
text to image
prompt augment
prompt engineering
text-generation-inference
Instructions to use pszemraj/distilgpt2-multiprompt with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use pszemraj/distilgpt2-multiprompt with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="pszemraj/distilgpt2-multiprompt")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("pszemraj/distilgpt2-multiprompt") model = AutoModelForCausalLM.from_pretrained("pszemraj/distilgpt2-multiprompt", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use pszemraj/distilgpt2-multiprompt with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "pszemraj/distilgpt2-multiprompt" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "pszemraj/distilgpt2-multiprompt", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/pszemraj/distilgpt2-multiprompt
- SGLang
How to use pszemraj/distilgpt2-multiprompt 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 "pszemraj/distilgpt2-multiprompt" \ --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": "pszemraj/distilgpt2-multiprompt", "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 "pszemraj/distilgpt2-multiprompt" \ --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": "pszemraj/distilgpt2-multiprompt", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use pszemraj/distilgpt2-multiprompt with Docker Model Runner:
docker model run hf.co/pszemraj/distilgpt2-multiprompt
Librarian Bot: Add base_model information to model
#2
by librarian-bot - opened
README.md
CHANGED
|
@@ -10,27 +10,28 @@ tags:
|
|
| 10 |
- prompt engineering
|
| 11 |
datasets:
|
| 12 |
- pszemraj/text2image-multi-prompt
|
| 13 |
-
model-index:
|
| 14 |
-
- name: distilgpt2-multiprompt-v2-fp
|
| 15 |
-
results: []
|
| 16 |
widget:
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
parameters:
|
| 30 |
min_length: 16
|
| 31 |
max_length: 96
|
| 32 |
no_repeat_ngram_size: 1
|
| 33 |
-
do_sample:
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
---
|
| 35 |
|
| 36 |
# distilgpt2-multiprompt
|
|
|
|
| 10 |
- prompt engineering
|
| 11 |
datasets:
|
| 12 |
- pszemraj/text2image-multi-prompt
|
|
|
|
|
|
|
|
|
|
| 13 |
widget:
|
| 14 |
+
- text: morning sun over Jakarta
|
| 15 |
+
example_title: morning sun
|
| 16 |
+
- text: 'WARNING: pip is'
|
| 17 |
+
example_title: pip
|
| 18 |
+
- text: sentient cheese
|
| 19 |
+
example_title: sentient cheese
|
| 20 |
+
- text: cheeps are
|
| 21 |
+
example_title: cheeps
|
| 22 |
+
- text: avocado armchair
|
| 23 |
+
example_title: creative prompt
|
| 24 |
+
- text: Landscape of
|
| 25 |
+
example_title: landscape
|
| 26 |
parameters:
|
| 27 |
min_length: 16
|
| 28 |
max_length: 96
|
| 29 |
no_repeat_ngram_size: 1
|
| 30 |
+
do_sample: true
|
| 31 |
+
base_model: distilgpt2
|
| 32 |
+
model-index:
|
| 33 |
+
- name: distilgpt2-multiprompt-v2-fp
|
| 34 |
+
results: []
|
| 35 |
---
|
| 36 |
|
| 37 |
# distilgpt2-multiprompt
|