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

  • Log In
  • Sign Up

stabilityai
/
stablecode-instruct-alpha-3b

Text Generation
Transformers
PyTorch
Safetensors
code
gpt_neox
causal-lm
Eval Results (legacy)
text-generation-inference
Model card Files Files and versions
xet
Community
13

Instructions to use stabilityai/stablecode-instruct-alpha-3b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.

  • Libraries
  • Transformers

    How to use stabilityai/stablecode-instruct-alpha-3b with Transformers:

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

    How to use stabilityai/stablecode-instruct-alpha-3b with vLLM:

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

    How to use stabilityai/stablecode-instruct-alpha-3b 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 "stabilityai/stablecode-instruct-alpha-3b" \
        --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": "stabilityai/stablecode-instruct-alpha-3b",
    		"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 "stabilityai/stablecode-instruct-alpha-3b" \
            --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": "stabilityai/stablecode-instruct-alpha-3b",
    		"prompt": "Once upon a time,",
    		"max_tokens": 512,
    		"temperature": 0.5
    	}'
  • Docker Model Runner

    How to use stabilityai/stablecode-instruct-alpha-3b with Docker Model Runner:

    docker model run hf.co/stabilityai/stablecode-instruct-alpha-3b
New discussion
Resources
  • PR & discussions documentation
  • Code of Conduct
  • Hub documentation

Is this model available for the commercial use?

#13 opened over 2 years ago by
AayushShah

Can you share the gpt-neox format checkpoints and the gpt-neox config of stablecode-completion-alpha-3b?

#12 opened over 2 years ago by
LemonTTT

UserWarning: You have modified the pretrained model configuration to control generation

1
#11 opened over 2 years ago by
jy395

Example code does not work

1
#10 opened over 2 years ago by
Tylersuard

Debug shared code?

#8 opened over 2 years ago by
AIML434

ValueError: `model_kwargs` are not used by the model

7
#7 opened over 2 years ago by
axiopaladin

Compatibility with mps/Mac M1?

7
#6 opened over 2 years ago by
ymgenesis

how to access gated model

1
#5 opened over 2 years ago by
dk28

Add `return_token_type_ids=False` to tokenizer

👍 1
1
#3 opened over 2 years ago by
victorbjelkholm

Fix code sample to resolve ValueError

👍 4
10
#2 opened over 2 years ago by
mendhak
Company
TOS Privacy About Careers
Website
Models Datasets Spaces Pricing Docs