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 ·
08b5dcf
1
Parent(s): b1695d9
greentext dataset
Browse files- config.json +1 -1
- optimizer.pt +0 -3
- pytorch_model.bin +1 -1
- rng_state.pth +1 -1
- scheduler.pt +1 -1
- trainer_state.json +0 -0
- training_args.bin +1 -1
config.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
{
|
| 2 |
-
"_name_or_path": "output/checkpoint-
|
| 3 |
"activation_function": "gelu_new",
|
| 4 |
"architectures": [
|
| 5 |
"GPT2LMHeadModel"
|
|
|
|
| 1 |
{
|
| 2 |
+
"_name_or_path": "/home/nizam/Downloads/4chan/output/checkpoint-550000",
|
| 3 |
"activation_function": "gelu_new",
|
| 4 |
"architectures": [
|
| 5 |
"GPT2LMHeadModel"
|
optimizer.pt
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:b360d9c2b1c6e8cf2afffcfc04a5dd1950b3acb7561b4171910d241e75f53639
|
| 3 |
-
size 1006314437
|
|
|
|
|
|
|
|
|
|
|
|
pytorch_model.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 515752509
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cabaaf61433526282d06b882db0f2111cccd7206025cafec2a9abc3cf0575b7d
|
| 3 |
size 515752509
|
rng_state.pth
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 14575
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fbe62c226b96cbbc996382133aaf497cc1967337f625e6a84c812b2e35ff8ac9
|
| 3 |
size 14575
|
scheduler.pt
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 627
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:118105cadb0bd8b1b0bc35d9e2eb98347897b664ca061659b977df90c5ef3e82
|
| 3 |
size 627
|
trainer_state.json
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
training_args.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 3579
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ca355011e271bc259c8106acedbe45a6004ff741432ce764fb5d9187277d7cd7
|
| 3 |
size 3579
|