Instructions to use CDHAI/codeparrot-ds with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use CDHAI/codeparrot-ds with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="CDHAI/codeparrot-ds")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("CDHAI/codeparrot-ds") model = AutoModelForCausalLM.from_pretrained("CDHAI/codeparrot-ds") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use CDHAI/codeparrot-ds with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "CDHAI/codeparrot-ds" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "CDHAI/codeparrot-ds", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/CDHAI/codeparrot-ds
- SGLang
How to use CDHAI/codeparrot-ds 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 "CDHAI/codeparrot-ds" \ --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": "CDHAI/codeparrot-ds", "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 "CDHAI/codeparrot-ds" \ --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": "CDHAI/codeparrot-ds", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use CDHAI/codeparrot-ds with Docker Model Runner:
docker model run hf.co/CDHAI/codeparrot-ds
Training in progress, step 2
Browse files- config.json +3 -3
- model.safetensors +1 -1
- training_args.bin +2 -2
config.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
| 1 |
{
|
|
|
|
| 2 |
"activation_function": "gelu_new",
|
| 3 |
"architectures": [
|
| 4 |
"GPT2LMHeadModel"
|
| 5 |
],
|
| 6 |
"attn_pdrop": 0.1,
|
| 7 |
"bos_token_id": 0,
|
| 8 |
-
"dtype": "float32",
|
| 9 |
"embd_pdrop": 0.1,
|
| 10 |
"eos_token_id": 0,
|
| 11 |
"initializer_range": 0.02,
|
|
@@ -17,7 +17,6 @@
|
|
| 17 |
"n_inner": null,
|
| 18 |
"n_layer": 12,
|
| 19 |
"n_positions": 1024,
|
| 20 |
-
"pad_token_id": 0,
|
| 21 |
"reorder_and_upcast_attn": false,
|
| 22 |
"resid_pdrop": 0.1,
|
| 23 |
"scale_attn_by_inverse_layer_idx": false,
|
|
@@ -33,7 +32,8 @@
|
|
| 33 |
"max_length": 50
|
| 34 |
}
|
| 35 |
},
|
| 36 |
-
"
|
|
|
|
| 37 |
"use_cache": true,
|
| 38 |
"vocab_size": 50000
|
| 39 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"_name_or_path": "gpt2",
|
| 3 |
"activation_function": "gelu_new",
|
| 4 |
"architectures": [
|
| 5 |
"GPT2LMHeadModel"
|
| 6 |
],
|
| 7 |
"attn_pdrop": 0.1,
|
| 8 |
"bos_token_id": 0,
|
|
|
|
| 9 |
"embd_pdrop": 0.1,
|
| 10 |
"eos_token_id": 0,
|
| 11 |
"initializer_range": 0.02,
|
|
|
|
| 17 |
"n_inner": null,
|
| 18 |
"n_layer": 12,
|
| 19 |
"n_positions": 1024,
|
|
|
|
| 20 |
"reorder_and_upcast_attn": false,
|
| 21 |
"resid_pdrop": 0.1,
|
| 22 |
"scale_attn_by_inverse_layer_idx": false,
|
|
|
|
| 32 |
"max_length": 50
|
| 33 |
}
|
| 34 |
},
|
| 35 |
+
"torch_dtype": "float32",
|
| 36 |
+
"transformers_version": "4.48.1",
|
| 37 |
"use_cache": true,
|
| 38 |
"vocab_size": 50000
|
| 39 |
}
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 496984704
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8120777888c74af794934853065e6a46218fdd7715dc67cbbada18b98344ff3b
|
| 3 |
size 496984704
|
training_args.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3b9ed5fb36b7166d42fe9edcd194bdb43f2cb7c62c7804693007b82710506b2e
|
| 3 |
+
size 5304
|