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 135000
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:3985f373c9fe3e04c7a5bb69a431c47dbc500db77d2c6dacb0e55b0bc2a6cc6e
|
| 3 |
+
size 20664714
|
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:623eca7922e78d2ba9bd1777a2612608a26cddaba88f5107707ac77b767f5920
|
| 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:7c5d2f64d07fd0eb7f2feb7e1fd952d8c66d69e3acb200a1de2f78c1a429c6bc
|
| 3 |
+
size 24774889
|
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": 1.2567648771774215e-05, "samples": 25920000, "steps": 134999, "loss/train": 1.248957633972168, "_runtime": 68378, "_timestamp": 1636301748, "_step": 135008, "loss/eval": 1.2335491180419922, "perplexity": 3.4333934783935547}
|
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:864b05961e10b41c85540d88ab249497b08429393f8a0906c188fccc7940a840
|
| 3 |
+
size 60663376
|
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:854aab1e842d7cad61d6b782b3aee5b17501ab4f30d7c291c4de9c7f8dbc0624
|
| 3 |
+
size 44960275
|