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 60000
Browse files- log/debug_0.log +0 -0
- 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 +0 -0
- 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
|
The diff for this file is too large to render.
See raw diff
|
|
|
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:c7e5af4164627f1ac097ac81d716b67798d710b0c34213566fdb57b66ba4cccd
|
| 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:c23a836b2820cb520d745d3f69b95550c72bda821ba08aff023f4eb8d4903c07
|
| 3 |
+
size 10974394
|
wandb/run-20210830_131354-2654p8r7/files/output.log
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
wandb/run-20210830_131354-2654p8r7/files/wandb-summary.json
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
{"lr": 0.
|
|
|
|
| 1 |
+
{"lr": 0.0003332899522763045, "samples": 11520000, "steps": 59999, "loss/train": 1.3309777975082397, "_runtime": 39204, "_timestamp": 1630368438, "_step": 60003, "loss/eval": 1.1882071495056152, "perplexity": 3.281193256378174}
|
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:9fad390f72cd94675b6904ad0fedf9dde741e6837549a38080de8005d8d7277f
|
| 3 |
+
size 28108721
|
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:73dc46408ad382f9bf9bc6e228c5737c306f2989268ec5a3185931587ac1169d
|
| 3 |
+
size 23124498
|