Instructions to use lesserfield/gpt2-4chan-mini with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use lesserfield/gpt2-4chan-mini with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="lesserfield/gpt2-4chan-mini")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("lesserfield/gpt2-4chan-mini") model = AutoModelForCausalLM.from_pretrained("lesserfield/gpt2-4chan-mini") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use lesserfield/gpt2-4chan-mini with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "lesserfield/gpt2-4chan-mini" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "lesserfield/gpt2-4chan-mini", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/lesserfield/gpt2-4chan-mini
- SGLang
How to use lesserfield/gpt2-4chan-mini 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 "lesserfield/gpt2-4chan-mini" \ --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": "lesserfield/gpt2-4chan-mini", "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 "lesserfield/gpt2-4chan-mini" \ --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": "lesserfield/gpt2-4chan-mini", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use lesserfield/gpt2-4chan-mini with Docker Model Runner:
docker model run hf.co/lesserfield/gpt2-4chan-mini
niizam commited on
Commit Β·
f46f2c3
1
Parent(s): 5fb1b86
minor fix
Browse files- gpt2-4chan-mini/config.json β config.json +0 -0
- gpt2-4chan-mini/generation_config.json β generation_config.json +0 -0
- gpt2-4chan-mini/optimizer.pt β optimizer.pt +0 -0
- gpt2-4chan-mini/pytorch_model.bin β pytorch_model.bin +0 -0
- gpt2-4chan-mini/rng_state.pth β rng_state.pth +0 -0
- gpt2-4chan-mini/scheduler.pt β scheduler.pt +0 -0
- gpt2-4chan-mini/trainer_state.json β trainer_state.json +0 -0
- gpt2-4chan-mini/training_args.bin β training_args.bin +0 -0
gpt2-4chan-mini/config.json β config.json
RENAMED
|
File without changes
|
gpt2-4chan-mini/generation_config.json β generation_config.json
RENAMED
|
File without changes
|
gpt2-4chan-mini/optimizer.pt β optimizer.pt
RENAMED
|
File without changes
|
gpt2-4chan-mini/pytorch_model.bin β pytorch_model.bin
RENAMED
|
File without changes
|
gpt2-4chan-mini/rng_state.pth β rng_state.pth
RENAMED
|
File without changes
|
gpt2-4chan-mini/scheduler.pt β scheduler.pt
RENAMED
|
File without changes
|
gpt2-4chan-mini/trainer_state.json β trainer_state.json
RENAMED
|
File without changes
|
gpt2-4chan-mini/training_args.bin β training_args.bin
RENAMED
|
File without changes
|