Instructions to use PixelistStudio/prompt-extend with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use PixelistStudio/prompt-extend with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="PixelistStudio/prompt-extend")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("PixelistStudio/prompt-extend") model = AutoModelForCausalLM.from_pretrained("PixelistStudio/prompt-extend") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use PixelistStudio/prompt-extend with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "PixelistStudio/prompt-extend" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "PixelistStudio/prompt-extend", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/PixelistStudio/prompt-extend
- SGLang
How to use PixelistStudio/prompt-extend 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 "PixelistStudio/prompt-extend" \ --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": "PixelistStudio/prompt-extend", "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 "PixelistStudio/prompt-extend" \ --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": "PixelistStudio/prompt-extend", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use PixelistStudio/prompt-extend with Docker Model Runner:
docker model run hf.co/PixelistStudio/prompt-extend
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="PixelistStudio/prompt-extend")# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("PixelistStudio/prompt-extend")
model = AutoModelForCausalLM.from_pretrained("PixelistStudio/prompt-extend")Quick Links
Prompt Extend
Text generation model for generating suitable style cues given the main idea for a prompt.
It is a GPT-2 model trained on dataset of stable diffusion prompts.
Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 0.0001
- train_batch_size: 128
- eval_batch_size: 256
- seed: 42
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: cosine
- lr_scheduler_warmup_ratio: 0.1
- num_epochs: 5
- mixed_precision_training: Native AMP
Training results
| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| 3.7436 | 1.0 | 12796 | 2.5429 |
| 2.3292 | 2.0 | 25592 | 2.0711 |
| 1.9439 | 3.0 | 38388 | 1.8447 |
| 1.7059 | 4.0 | 51184 | 1.7325 |
| 1.5775 | 5.0 | 63980 | 1.7110 |
Framework versions
- Transformers 4.24.0
- Pytorch 1.13.0+cu117
- Datasets 2.7.1
- Tokenizers 0.13.2
- Downloads last month
- -
# Gated model: Login with a HF token with gated access permission hf auth login