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

  • Log In
  • Sign Up

Salesforce
/
CoDA-v0-Base

Text Generation
Transformers
Safetensors
English
CoDA
feature-extraction
text diffusion model
language model
code generation
conversational
custom_code
Model card Files Files and versions
xet
Community
4

Instructions to use Salesforce/CoDA-v0-Base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.

  • Libraries
  • Transformers

    How to use Salesforce/CoDA-v0-Base with Transformers:

    # Use a pipeline as a high-level helper
    from transformers import pipeline
    
    pipe = pipeline("text-generation", model="Salesforce/CoDA-v0-Base", trust_remote_code=True)
    messages = [
        {"role": "user", "content": "Who are you?"},
    ]
    pipe(messages)
    # Load model directly
    from transformers import AutoModel
    model = AutoModel.from_pretrained("Salesforce/CoDA-v0-Base", trust_remote_code=True, dtype="auto")
  • Notebooks
  • Google Colab
  • Kaggle
  • Local Apps
  • vLLM

    How to use Salesforce/CoDA-v0-Base with vLLM:

    Install from pip and serve model
    # Install vLLM from pip:
    pip install vllm
    # Start the vLLM server:
    vllm serve "Salesforce/CoDA-v0-Base"
    # Call the server using curl (OpenAI-compatible API):
    curl -X POST "http://localhost:8000/v1/chat/completions" \
    	-H "Content-Type: application/json" \
    	--data '{
    		"model": "Salesforce/CoDA-v0-Base",
    		"messages": [
    			{
    				"role": "user",
    				"content": "What is the capital of France?"
    			}
    		]
    	}'
    Use Docker
    docker model run hf.co/Salesforce/CoDA-v0-Base
  • SGLang

    How to use Salesforce/CoDA-v0-Base 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 "Salesforce/CoDA-v0-Base" \
        --host 0.0.0.0 \
        --port 30000
    # Call the server using curl (OpenAI-compatible API):
    curl -X POST "http://localhost:30000/v1/chat/completions" \
    	-H "Content-Type: application/json" \
    	--data '{
    		"model": "Salesforce/CoDA-v0-Base",
    		"messages": [
    			{
    				"role": "user",
    				"content": "What is the capital of France?"
    			}
    		]
    	}'
    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 "Salesforce/CoDA-v0-Base" \
            --host 0.0.0.0 \
            --port 30000
    # Call the server using curl (OpenAI-compatible API):
    curl -X POST "http://localhost:30000/v1/chat/completions" \
    	-H "Content-Type: application/json" \
    	--data '{
    		"model": "Salesforce/CoDA-v0-Base",
    		"messages": [
    			{
    				"role": "user",
    				"content": "What is the capital of France?"
    			}
    		]
    	}'
  • Docker Model Runner

    How to use Salesforce/CoDA-v0-Base with Docker Model Runner:

    docker model run hf.co/Salesforce/CoDA-v0-Base
CoDA-v0-Base
8.14 GB
Ctrl+K
Ctrl+K
  • 3 contributors
History: 9 commits
hlnchen's picture
hlnchen
nielsr's picture
nielsr HF Staff
Add `library_name` and update paper link (#3)
54d40e4 verified 7 months ago
  • .gitattributes
    1.57 kB
    update model 7 months ago
  • README.md
    7.83 kB
    Add `library_name` and update paper link (#3) 7 months ago
  • added_tokens.json
    729 Bytes
    update model 7 months ago
  • attention.py
    3.6 kB
    update model 7 months ago
  • config.json
    1.13 kB
    update model 7 months ago
  • generation_config.json
    220 Bytes
    update model 7 months ago
  • generation_utils.py
    23.7 kB
    update model 7 months ago
  • merges.txt
    1.67 MB
    update model 7 months ago
  • model-00001-of-00002.safetensors
    4.97 GB
    xet
    update model 7 months ago
  • model-00002-of-00002.safetensors
    3.16 GB
    xet
    update model 7 months ago
  • model.safetensors.index.json
    25.6 kB
    update model 7 months ago
  • model_config.py
    3.34 kB
    update model 7 months ago
  • modeling_coda.py
    21.8 kB
    update model 7 months ago
  • modeling_utils.py
    9.26 kB
    update model 7 months ago
  • special_tokens_map.json
    1.04 kB
    update model 7 months ago
  • tokenizer.json
    11.4 MB
    xet
    update model 7 months ago
  • tokenizer_config.json
    10 kB
    update model 7 months ago
  • vocab.json
    2.78 MB
    update model 7 months ago