Instructions to use codeparrot/codeparrot-small with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use codeparrot/codeparrot-small with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="codeparrot/codeparrot-small")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("codeparrot/codeparrot-small") model = AutoModelForCausalLM.from_pretrained("codeparrot/codeparrot-small") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use codeparrot/codeparrot-small with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "codeparrot/codeparrot-small" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "codeparrot/codeparrot-small", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/codeparrot/codeparrot-small
- SGLang
How to use codeparrot/codeparrot-small 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 "codeparrot/codeparrot-small" \ --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": "codeparrot/codeparrot-small", "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 "codeparrot/codeparrot-small" \ --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": "codeparrot/codeparrot-small", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use codeparrot/codeparrot-small with Docker Model Runner:
docker model run hf.co/codeparrot/codeparrot-small
step 150000
Browse files- log/debug_0.log +2 -2
- pytorch_model.bin +1 -1
- runs/Nov06_21-16-12_leandro-16x-v100/events.out.tfevents.1636233372.leandro-16x-v100.4368.0 +2 -2
- wandb/run-20211106_211610-dtkf2u0m/files/output.log +0 -0
- wandb/run-20211106_211610-dtkf2u0m/files/wandb-summary.json +1 -1
- wandb/run-20211106_211610-dtkf2u0m/logs/debug-internal.log +2 -2
- wandb/run-20211106_211610-dtkf2u0m/run-dtkf2u0m.wandb +2 -2
log/debug_0.log
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:d657e9c798fde57f1fef69fbedf64503cd82a9810aef7a412c729a79f44fe514
|
| 3 |
+
size 22992153
|
pytorch_model.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 456677609
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c7fc3b2bc56bf6ef0fcabf1d529fd6aefd48a69fbeb70a5efb88b1a909d25b06
|
| 3 |
size 456677609
|
runs/Nov06_21-16-12_leandro-16x-v100/events.out.tfevents.1636233372.leandro-16x-v100.4368.0
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:dd2da3133b96068e4a12ef87687b875abc56e9140a4cd32b820111537cbdb872
|
| 3 |
+
size 27534988
|
wandb/run-20211106_211610-dtkf2u0m/files/output.log
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
wandb/run-20211106_211610-dtkf2u0m/files/wandb-summary.json
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
{"lr":
|
|
|
|
| 1 |
+
{"lr": 5.63230573291662e-14, "samples": 28800000, "steps": 149999, "loss/train": 1.469771146774292, "_runtime": 76030, "_timestamp": 1636309400, "_step": 150009, "loss/eval": 1.2280396223068237, "perplexity": 3.414529323577881}
|
wandb/run-20211106_211610-dtkf2u0m/logs/debug-internal.log
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:fc35461595e40ec481bdea871164294be3bb20552c28c1e92d57834c8091c201
|
| 3 |
+
size 67412844
|
wandb/run-20211106_211610-dtkf2u0m/run-dtkf2u0m.wandb
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:b19419e59b05006f6381c513ec0f2b32c80e38dfbfb1571aa3672553faec0dbe
|
| 3 |
+
size 51160299
|