Text Generation
Transformers
PyTorch
code
mpt
Composer
MosaicML
llm-foundry
StreamingDatasets
custom_code
text-generation-inference
Instructions to use replit/replit-code-v1_5-3b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use replit/replit-code-v1_5-3b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="replit/replit-code-v1_5-3b", trust_remote_code=True)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("replit/replit-code-v1_5-3b", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("replit/replit-code-v1_5-3b", trust_remote_code=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use replit/replit-code-v1_5-3b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "replit/replit-code-v1_5-3b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "replit/replit-code-v1_5-3b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/replit/replit-code-v1_5-3b
- SGLang
How to use replit/replit-code-v1_5-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 "replit/replit-code-v1_5-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": "replit/replit-code-v1_5-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 "replit/replit-code-v1_5-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": "replit/replit-code-v1_5-3b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use replit/replit-code-v1_5-3b with Docker Model Runner:
docker model run hf.co/replit/replit-code-v1_5-3b
Update README
#2
by madhavatreplit - opened
README.md
CHANGED
|
@@ -6,4 +6,35 @@ license: cc-by-sa-4.0
|
|
| 6 |
|
| 7 |
Developed by: Replit, Inc.
|
| 8 |
|
| 9 |
-
##
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
Developed by: Replit, Inc.
|
| 8 |
|
| 9 |
+
## Model Description
|
| 10 |
+
|
| 11 |
+
Replit Code v1.5 is a 3.3B parameter Causal Language Model focused on **Code Completion**.
|
| 12 |
+
|
| 13 |
+
The model is trained on 1T tokens of code (~200B tokens over 5 epochs, including linear cooldown) for 30 programming languages from a subset of permissively licensed code from Bigcode's [Stack Dedup V2 dataset](https://huggingface.co/datasets/bigcode/the-stack-dedup).
|
| 14 |
+
|
| 15 |
+
We use the GPTNeoX tokenizer with a custom trained and optimized vocabulary of 32768 tokens that led to single-digit % points on compression while maintaining or improving coverage on our training corpus.
|
| 16 |
+
|
| 17 |
+
The model has been trained on the [MosaicML](https://www.mosaicml.com/) platform on 128 H100-80GB GPUs.
|
| 18 |
+
|
| 19 |
+
The model has a context window size of 4096 tokens.
|
| 20 |
+
|
| 21 |
+
## Dependancies
|
| 22 |
+
You will need to install the latest versions of the following dependencies:
|
| 23 |
+
```
|
| 24 |
+
einops
|
| 25 |
+
torch
|
| 26 |
+
transformers
|
| 27 |
+
```
|
| 28 |
+
|
| 29 |
+
## How to Use (Coming Soon!)
|
| 30 |
+
|
| 31 |
+
(Details and code examples coming soon!)
|
| 32 |
+
|
| 33 |
+
## Intended Use
|
| 34 |
+
|
| 35 |
+
Replit intends this model be used by anyone as a foundational model for application-specific fine-tuning without strict limitations on commercial use.
|
| 36 |
+
|
| 37 |
+
The model is trained specifically for code completion tasks.
|
| 38 |
+
|
| 39 |
+
## Limitations
|
| 40 |
+
The pre-training dataset may have contained offensive or inappropriate content even after applying data cleansing filters, and such content may be reflected in model generated text. We recommend that users exercise reasonable caution when using in production systems. Do not use for any applications that may cause harm or distress to individuals or groups.
|