Salesforce/wikitext
Viewer โข Updated โข 3.71M โข 2.18M โข 859
How to use yasutoshi-lab/gpt2-verification with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="yasutoshi-lab/gpt2-verification") # pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("yasutoshi-lab/gpt2-verification")
model = AutoModelForCausalLM.from_pretrained("yasutoshi-lab/gpt2-verification", device_map="auto")How to use yasutoshi-lab/gpt2-verification with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "yasutoshi-lab/gpt2-verification"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "yasutoshi-lab/gpt2-verification",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/yasutoshi-lab/gpt2-verification
How to use yasutoshi-lab/gpt2-verification with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "yasutoshi-lab/gpt2-verification" \
--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": "yasutoshi-lab/gpt2-verification",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'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 "yasutoshi-lab/gpt2-verification" \
--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": "yasutoshi-lab/gpt2-verification",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use yasutoshi-lab/gpt2-verification with Docker Model Runner:
docker model run hf.co/yasutoshi-lab/gpt2-verification
This model utilizes the GPT2 architecture and GPT2 tokenizer, and was trained from scratch using wikitext-2-raw-v1.
It achieves the following results on the evaluation set:
CUDA_VISIBLE_DEVICES=0 uv run python examples/pytorch/language-modeling/run_clm.py \
--model_type gpt2 \
--tokenizer_name gpt2 \
--dataset_name wikitext \
--dataset_config_name wikitext-2-raw-v1 \
--per_device_train_batch_size 2 \
--per_device_eval_batch_size 2 \
--num_train_epochs 3 \
--do_train \
--do_eval \
--output_dir ./output/gpt2-test \
--save_steps 500 \
--logging_steps 100 \
--push_to_hub \
--hub_model_id "yasutoshi-lab/gpt2-verification"
--hub_private_repo true \
--hub_strategy "end"
More information needed
More information needed
More information needed
The following hyperparameters were used during training: