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

  • Log In
  • Sign Up

S-Dreamer
/
PyCodeT5

Text Generation
Transformers
English
CodeT5
text2text-generation
code
Model card Files Files and versions
xet
Community

Instructions to use S-Dreamer/PyCodeT5 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.

  • Libraries
  • Transformers

    How to use S-Dreamer/PyCodeT5 with Transformers:

    # Use a pipeline as a high-level helper
    from transformers import pipeline
    
    pipe = pipeline("text-generation", model="S-Dreamer/PyCodeT5")
    # Load model directly
    from transformers import AutoModelForSeq2SeqLM
    model = AutoModelForSeq2SeqLM.from_pretrained("S-Dreamer/PyCodeT5", dtype="auto")
  • Notebooks
  • Google Colab
  • Kaggle
  • Local Apps
  • vLLM

    How to use S-Dreamer/PyCodeT5 with vLLM:

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

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

    How to use S-Dreamer/PyCodeT5 with Docker Model Runner:

    docker model run hf.co/S-Dreamer/PyCodeT5

You need to agree to share your contact information to access this model

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

Log in or Sign Up to review the conditions and access this model content.

Gated model
You can list files but not access them

Preview of files found in this repository
  • .gitattributes
    1.57 kB
    Upload PyCodeT5.png about 1 year ago
  • LICENSE
    0 Bytes
    Create LICENSE about 1 year ago
  • PyCodeT5.png
    739 kB
    xet
    Upload PyCodeT5.png about 1 year ago
  • README.md
    7.73 kB
    Update README.md about 1 year ago
  • config.json
    365 Bytes
    Update config.json about 1 year ago
  • evaluator.py
    1.68 kB
    Update evaluator.py about 1 year ago
  • example.py
    441 Bytes
    Create example.py about 1 year ago
  • generation_fast.py
    1.55 kB
    Update generation_fast.py about 1 year ago
  • merges.txt
    294 kB
    Added config files about 1 year ago
  • preprocessor_config.json
    230 Bytes
    Create preprocessor_config.json about 1 year ago
  • requirements.txt
    50 Bytes
    Create requirements.txt about 1 year ago
  • special_tokens_map.json
    15.5 kB
    Added config files about 1 year ago
  • tokenizer.json
    2.29 MB
    Added config files about 1 year ago
  • tokenizer_config.json
    21.1 kB
    Added config files about 1 year ago
  • training_args.json
    573 Bytes
    Create training_args.json about 1 year ago
  • vocab.json
    511 kB
    Added config files about 1 year ago