Instructions to use Masdfasdg/GPT2-Prompt with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Masdfasdg/GPT2-Prompt with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Masdfasdg/GPT2-Prompt")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Masdfasdg/GPT2-Prompt") model = AutoModelForCausalLM.from_pretrained("Masdfasdg/GPT2-Prompt") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use Masdfasdg/GPT2-Prompt with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Masdfasdg/GPT2-Prompt" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Masdfasdg/GPT2-Prompt", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Masdfasdg/GPT2-Prompt
- SGLang
How to use Masdfasdg/GPT2-Prompt 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 "Masdfasdg/GPT2-Prompt" \ --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": "Masdfasdg/GPT2-Prompt", "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 "Masdfasdg/GPT2-Prompt" \ --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": "Masdfasdg/GPT2-Prompt", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Masdfasdg/GPT2-Prompt with Docker Model Runner:
docker model run hf.co/Masdfasdg/GPT2-Prompt
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("Masdfasdg/GPT2-Prompt")
model = AutoModelForCausalLM.from_pretrained("Masdfasdg/GPT2-Prompt")Quick Links
GPT-2 Story Generator
Model description
Generate a short story from an input prompt.
Put the vocab [endprompt] after your input.
Example of an input:
A person with a high school education gets sent back into the 1600s and tries to explain science and technology to the people. [endprompt]
Limitations and bias
The data we used to train was collected from reddit, so it could be very biased towards young, white, male demographic.
Training data
The data was collected from scraping reddit.
- Downloads last month
- 2,462
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Masdfasdg/GPT2-Prompt")