Text Generation
Transformers
PyTorch
code
mpt
instruct
self instruct
custom_code
text-generation-inference
Instructions to use teknium/Replit-v1-CodeInstruct-3B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use teknium/Replit-v1-CodeInstruct-3B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="teknium/Replit-v1-CodeInstruct-3B", trust_remote_code=True)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("teknium/Replit-v1-CodeInstruct-3B", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("teknium/Replit-v1-CodeInstruct-3B", trust_remote_code=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use teknium/Replit-v1-CodeInstruct-3B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "teknium/Replit-v1-CodeInstruct-3B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "teknium/Replit-v1-CodeInstruct-3B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/teknium/Replit-v1-CodeInstruct-3B
- SGLang
How to use teknium/Replit-v1-CodeInstruct-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 "teknium/Replit-v1-CodeInstruct-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": "teknium/Replit-v1-CodeInstruct-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 "teknium/Replit-v1-CodeInstruct-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": "teknium/Replit-v1-CodeInstruct-3B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use teknium/Replit-v1-CodeInstruct-3B with Docker Model Runner:
docker model run hf.co/teknium/Replit-v1-CodeInstruct-3B
Commit ·
ad718ea
1
Parent(s): d52816e
Fixing path issues to fix loading of models with Auto* classes (#3)
Browse files- Fixing path issues to fix loading of models with Auto* classes (841b17c0e21834418cf90a5c4b35f9234115a0e8)
Co-authored-by: Madhav <madhavatreplit@users.noreply.huggingface.co>
- config.json +2 -3
config.json
CHANGED
|
@@ -1,5 +1,4 @@
|
|
| 1 |
{
|
| 2 |
-
"_name_or_path": "replit/replit-code-v1-3b",
|
| 3 |
"architectures": [
|
| 4 |
"MPTForCausalLM"
|
| 5 |
],
|
|
@@ -16,8 +15,8 @@
|
|
| 16 |
"softmax_scale": null
|
| 17 |
},
|
| 18 |
"auto_map": {
|
| 19 |
-
"AutoConfig": "
|
| 20 |
-
"AutoModelForCausalLM": "
|
| 21 |
},
|
| 22 |
"d_model": 2560,
|
| 23 |
"emb_pdrop": 0,
|
|
|
|
| 1 |
{
|
|
|
|
| 2 |
"architectures": [
|
| 3 |
"MPTForCausalLM"
|
| 4 |
],
|
|
|
|
| 15 |
"softmax_scale": null
|
| 16 |
},
|
| 17 |
"auto_map": {
|
| 18 |
+
"AutoConfig": "configuration_mpt.MPTConfig",
|
| 19 |
+
"AutoModelForCausalLM": "modeling_mpt.MPTForCausalLM"
|
| 20 |
},
|
| 21 |
"d_model": 2560,
|
| 22 |
"emb_pdrop": 0,
|