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