Instructions to use transformersbook/codeparrot-small with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use transformersbook/codeparrot-small with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="transformersbook/codeparrot-small")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("transformersbook/codeparrot-small") model = AutoModelForCausalLM.from_pretrained("transformersbook/codeparrot-small") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use transformersbook/codeparrot-small with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "transformersbook/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": "transformersbook/codeparrot-small", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/transformersbook/codeparrot-small
- SGLang
How to use transformersbook/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 "transformersbook/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": "transformersbook/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 "transformersbook/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": "transformersbook/codeparrot-small", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use transformersbook/codeparrot-small with Docker Model Runner:
docker model run hf.co/transformersbook/codeparrot-small
step 135000
Browse files- log/debug_0.log +2 -2
- pytorch_model.bin +1 -1
- runs/Aug30_13-13-56_leandro-16x-a100-v3/events.out.tfevents.1630329236.leandro-16x-a100-v3.9739.0 +2 -2
- wandb/run-20210830_131354-2654p8r7/files/output.log +2 -2
- wandb/run-20210830_131354-2654p8r7/files/wandb-summary.json +1 -1
- wandb/run-20210830_131354-2654p8r7/logs/debug-internal.log +2 -2
- wandb/run-20210830_131354-2654p8r7/run-2654p8r7.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:e5fd85433be8ed9306565e293395f0f0d008793b8d1aeacc863ba42f6506f8e1
|
| 3 |
+
size 20719421
|
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:4e393f6ba618a02a3f044ae969fc81a48e6525703369549025095096b793363a
|
| 3 |
size 456677609
|
runs/Aug30_13-13-56_leandro-16x-a100-v3/events.out.tfevents.1630329236.leandro-16x-a100-v3.9739.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:bc4f14b25beb997f35bfb9b0e57bcac3fddaca0f1275315bfcf0785d89796d66
|
| 3 |
+
size 24774889
|
wandb/run-20210830_131354-2654p8r7/files/output.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:a79c2d4dd7e20edc3442680c206f474c4becf3beef2cfc149010eab4bb6ad3fa
|
| 3 |
+
size 20762963
|
wandb/run-20210830_131354-2654p8r7/files/wandb-summary.json
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
{"lr":
|
|
|
|
| 1 |
+
{"lr": 1.2567648771774215e-05, "samples": 25920000, "steps": 134999, "loss/train": 0.10141287744045258, "_runtime": 88402, "_timestamp": 1630417636, "_step": 135008, "loss/eval": 0.95810866355896, "perplexity": 2.6067614555358887}
|
wandb/run-20210830_131354-2654p8r7/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:d81426a542f0f45b8adaa24bdbf20a53b4a30c234e72423ab8d9348db85962eb
|
| 3 |
+
size 63239408
|
wandb/run-20210830_131354-2654p8r7/run-2654p8r7.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:c2012cf122bfb8e6cfc0b0904ffbe9baf9ea30459f9055ce4a79a2269f4e92df
|
| 3 |
+
size 52448023
|