Text Generation
Transformers
Safetensors
English
CoDA
feature-extraction
text diffusion model
language model
code generation
conversational
custom_code
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
Add `library_name` and update paper link (#3)
Browse files- Add `library_name` and update paper link (7458eb81916d36acc53bee3e6ab493b8b4539004)
Co-authored-by: Niels Rogge <nielsr@users.noreply.huggingface.co>
README.md
CHANGED
|
@@ -1,8 +1,9 @@
|
|
| 1 |
---
|
| 2 |
-
license: cc-by-nc-4.0
|
| 3 |
language:
|
| 4 |
- en
|
|
|
|
| 5 |
pipeline_tag: text-generation
|
|
|
|
| 6 |
tags:
|
| 7 |
- text diffusion model
|
| 8 |
- language model
|
|
@@ -15,7 +16,7 @@ tags:
|
|
| 15 |
|
| 16 |
<p align="center">
|
| 17 |
<a href="https://github.com/SalesforceAIResearch/CoDA"><strong>Try CoDA</strong></a> 路
|
| 18 |
-
<a href="https://
|
| 19 |
<a href="https://huggingface.co/collections/Salesforce/coda-68d627d87921c0e28a69e340"><strong>Model Collection</strong></a> 路
|
| 20 |
<a href="https://github.com/SalesforceAIResearch/CoDA/blob/main/README.md"><strong>GitHub Repository</strong></a>
|
| 21 |
</p>
|
|
@@ -197,7 +198,8 @@ Technical report coming soon. For now, please cite:
|
|
| 197 |
title={CoDA: Coding LM via Diffusion Adaptation},
|
| 198 |
author={Chen, Haolin and Wang, Shiyu and Qin, Can and Pang, Bo and Liu, Zuxin and Qiu, Jielin and Zhang, Jianguo and Zhou, Yingbo and Chen, Zeyuan and Xu, Ran and Heinecke, Shelby and Savarese, Silvio and Xiong, Caiming and Wang, Huan and Yao, Weiran},
|
| 199 |
year={2025},
|
| 200 |
-
publisher={Salesforce AI Research}
|
|
|
|
| 201 |
}
|
| 202 |
```
|
| 203 |
|
|
|
|
| 1 |
---
|
|
|
|
| 2 |
language:
|
| 3 |
- en
|
| 4 |
+
license: cc-by-nc-4.0
|
| 5 |
pipeline_tag: text-generation
|
| 6 |
+
library_name: transformers
|
| 7 |
tags:
|
| 8 |
- text diffusion model
|
| 9 |
- language model
|
|
|
|
| 16 |
|
| 17 |
<p align="center">
|
| 18 |
<a href="https://github.com/SalesforceAIResearch/CoDA"><strong>Try CoDA</strong></a> 路
|
| 19 |
+
<a href="https://huggingface.co/papers/2510.03270"><strong>Paper</strong></a> 路
|
| 20 |
<a href="https://huggingface.co/collections/Salesforce/coda-68d627d87921c0e28a69e340"><strong>Model Collection</strong></a> 路
|
| 21 |
<a href="https://github.com/SalesforceAIResearch/CoDA/blob/main/README.md"><strong>GitHub Repository</strong></a>
|
| 22 |
</p>
|
|
|
|
| 198 |
title={CoDA: Coding LM via Diffusion Adaptation},
|
| 199 |
author={Chen, Haolin and Wang, Shiyu and Qin, Can and Pang, Bo and Liu, Zuxin and Qiu, Jielin and Zhang, Jianguo and Zhou, Yingbo and Chen, Zeyuan and Xu, Ran and Heinecke, Shelby and Savarese, Silvio and Xiong, Caiming and Wang, Huan and Yao, Weiran},
|
| 200 |
year={2025},
|
| 201 |
+
publisher={Salesforce AI Research},
|
| 202 |
+
url={https://huggingface.co/papers/2510.03270}
|
| 203 |
}
|
| 204 |
```
|
| 205 |
|