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

  • Log In
  • Sign Up

sshleifer
/
tiny-ctrl

Text Generation
Transformers
PyTorch
google-tensorflow TensorFlow
ctrl
Model card Files Files and versions
xet
Community
1

Instructions to use sshleifer/tiny-ctrl with libraries, inference providers, notebooks, and local apps. Follow these links to get started.

  • Libraries
  • Transformers

    How to use sshleifer/tiny-ctrl with Transformers:

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

    How to use sshleifer/tiny-ctrl with vLLM:

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

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

    How to use sshleifer/tiny-ctrl with Docker Model Runner:

    docker model run hf.co/sshleifer/tiny-ctrl
tiny-ctrl
72.9 MB
Ctrl+K
Ctrl+K
History: 9 commits
SFconvertbot's picture
SFconvertbot
Adding `safetensors` variant of this model
09de267 about 3 years ago
  • .gitattributes
    399 Bytes
    Adding `safetensors` variant of this model about 3 years ago
  • config.json
    575 Bytes
    Update config.json almost 6 years ago
  • merges.txt
    2.26 MB
    Update merges.txt almost 6 years ago
  • model.safetensors
    16.8 MB
    xet
    Adding `safetensors` variant of this model about 3 years ago
  • pytorch_model.bin
    16.8 MB
    xet
    Update pytorch_model.bin almost 6 years ago
  • special_tokens_map.json
    22 Bytes
    Update special_tokens_map.json almost 6 years ago
  • tf_model.h5
    32.6 MB
    xet
    Update tf_model.h5 almost 6 years ago
  • tokenizer_config.json
    25 Bytes
    Update tokenizer_config.json almost 6 years ago
  • vocab.json
    4.43 MB
    Update vocab.json almost 6 years ago