Instructions to use cactode/gpt2_urbandict_textgen with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use cactode/gpt2_urbandict_textgen with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="cactode/gpt2_urbandict_textgen")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("cactode/gpt2_urbandict_textgen") model = AutoModelForCausalLM.from_pretrained("cactode/gpt2_urbandict_textgen", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use cactode/gpt2_urbandict_textgen with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "cactode/gpt2_urbandict_textgen" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cactode/gpt2_urbandict_textgen", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/cactode/gpt2_urbandict_textgen
- SGLang
How to use cactode/gpt2_urbandict_textgen 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 "cactode/gpt2_urbandict_textgen" \ --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": "cactode/gpt2_urbandict_textgen", "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 "cactode/gpt2_urbandict_textgen" \ --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": "cactode/gpt2_urbandict_textgen", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use cactode/gpt2_urbandict_textgen with Docker Model Runner:
docker model run hf.co/cactode/gpt2_urbandict_textgen
Commit History
-
add tokenizer
2523ac5 -
add model
c32ebd5 -
Delete merges.txt
c2034db -
Delete tokenizer.json
16d521c -
Delete vocab.json
cd483d8
-
Upload vocab.json
0d513e5 -
Upload tokenizer.json
a8f2217 -
Upload merges.txt
6240773 -
Update README.md
53749b0 -
Delete vocab.json
65d8931 -
Delete tokenizer_config.json
283dfaf -
Delete special_tokens_map.json
dbe2dec -
Delete merges.txt
e824399 -
Update tokenizer_config.json
10dce7f -
add tokenizer
a004960 -
Update tokenizer_config.json
c4a2e94 -
add tokenizer
0faa8e7 -
Create README.md
5e607a4
-
add model
06fd6d0
-
add model
10f5b3d -
initial commit
1a06bfb