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")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("cactode/gpt2_urbandict_textgen") model = AutoModelForCausalLM.from_pretrained("cactode/gpt2_urbandict_textgen") - 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
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,2 +1,12 @@
|
|
| 1 |
# GPT2 Fine Tuned on UrbanDictionary
|
| 2 |
-
Honestly a little horrifying, but still funny.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
# GPT2 Fine Tuned on UrbanDictionary
|
| 2 |
+
Honestly a little horrifying, but still funny.
|
| 3 |
+
|
| 4 |
+
## Usage
|
| 5 |
+
Use with GPT2Tokenizer. Pad token should be set to the EOS token.
|
| 6 |
+
Inputs should be of the form "define <your word>: ".
|
| 7 |
+
|
| 8 |
+
## Training Data
|
| 9 |
+
All training data was obtained from [Urban Dictionary Words And Definitions on Kaggle](https://www.kaggle.com/therohk/urban-dictionary-words-dataset). Data was additionally filtered, normalized, and spell-checked.
|
| 10 |
+
|
| 11 |
+
## Bias
|
| 12 |
+
This model was trained on public internet data and will almost definitely produce offensive results. Some efforts were made to reduce this (i.e definitions with ethnic / gender-based slurs were removed), but the final model should not be trusted to produce non-offensive definitions.
|