Hugging Face's logo Hugging Face
  • Models
  • Datasets
  • Spaces
  • Buckets new
  • Docs
  • Enterprise
  • Pricing

  • Log In
  • Sign Up

royal42
/
gpt2chess_scratch

Text Generation
Transformers
PyTorch
gpt2
Generated from Trainer
text-generation-inference
Model card Files Files and versions
xet
Community
1

Instructions to use royal42/gpt2chess_scratch with libraries, inference providers, notebooks, and local apps. Follow these links to get started.

  • Libraries
  • Transformers

    How to use royal42/gpt2chess_scratch with Transformers:

    # Use a pipeline as a high-level helper
    from transformers import pipeline
    
    pipe = pipeline("text-generation", model="royal42/gpt2chess_scratch")
    # Load model directly
    from transformers import AutoTokenizer, AutoModelForCausalLM
    
    tokenizer = AutoTokenizer.from_pretrained("royal42/gpt2chess_scratch")
    model = AutoModelForCausalLM.from_pretrained("royal42/gpt2chess_scratch")
  • Notebooks
  • Google Colab
  • Kaggle
  • Local Apps
  • vLLM

    How to use royal42/gpt2chess_scratch with vLLM:

    Install from pip and serve model
    # Install vLLM from pip:
    pip install vllm
    # Start the vLLM server:
    vllm serve "royal42/gpt2chess_scratch"
    # Call the server using curl (OpenAI-compatible API):
    curl -X POST "http://localhost:8000/v1/completions" \
    	-H "Content-Type: application/json" \
    	--data '{
    		"model": "royal42/gpt2chess_scratch",
    		"prompt": "Once upon a time,",
    		"max_tokens": 512,
    		"temperature": 0.5
    	}'
    Use Docker
    docker model run hf.co/royal42/gpt2chess_scratch
  • SGLang

    How to use royal42/gpt2chess_scratch 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 "royal42/gpt2chess_scratch" \
        --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": "royal42/gpt2chess_scratch",
    		"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 "royal42/gpt2chess_scratch" \
            --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": "royal42/gpt2chess_scratch",
    		"prompt": "Once upon a time,",
    		"max_tokens": 512,
    		"temperature": 0.5
    	}'
  • Docker Model Runner

    How to use royal42/gpt2chess_scratch with Docker Model Runner:

    docker model run hf.co/royal42/gpt2chess_scratch
gpt2chess_scratch
358 MB
Ctrl+K
Ctrl+K
  • 1 contributor
History: 10 commits
royal42's picture
royal42
update model card README.md
3252e30 about 3 years ago
  • .gitattributes
    1.48 kB
    initial commit about 3 years ago
  • .gitignore
    13 Bytes
    Training in progress, step 5000 about 3 years ago
  • README.md
    1.67 kB
    update model card README.md about 3 years ago
  • config.json
    896 Bytes
    Training in progress, step 5000 about 3 years ago
  • generation_config.json
    111 Bytes
    Model save about 3 years ago
  • merges.txt
    3.28 kB
    Training in progress, step 5000 about 3 years ago
  • pytorch_model.bin

    Detected Pickle imports (4)

    • "torch._utils._rebuild_tensor_v2",
    • "torch.FloatStorage",
    • "collections.OrderedDict",
    • "torch.BoolStorage"

    What is a pickle import?

    358 MB
    xet
    Model save about 3 years ago
  • special_tokens_map.json
    131 Bytes
    Training in progress, step 5000 about 3 years ago
  • tokenizer.json
    21.7 kB
    Training in progress, step 5000 about 3 years ago
  • tokenizer_config.json
    234 Bytes
    Training in progress, step 5000 about 3 years ago
  • training_args.bin

    Detected Pickle imports (6)

    • "transformers.trainer_utils.IntervalStrategy",
    • "transformers.training_args.TrainingArguments",
    • "transformers.training_args.OptimizerNames",
    • "transformers.trainer_utils.HubStrategy",
    • "transformers.trainer_utils.SchedulerType",
    • "torch.device"

    How to fix it?

    3.58 kB
    xet
    Training in progress, step 5000 about 3 years ago
  • vocab.json
    7.68 kB
    Training in progress, step 5000 about 3 years ago