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 150000
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:a79eb1027045c0d9c89393cc117b8e5800ea542ca8eff3567e4d7409436c0905
|
| 3 |
+
size 23048419
|
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:19f360f95d1e1d6199592ac52167017c327daa81a0415cde440b5afed9ac310f
|
| 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:0cb88543348ffa056f3c7730c4d87776f8a0a01dd2164a604a9c7a6f4056f387
|
| 3 |
+
size 27534988
|
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:13528e05062782b213282145ef21c0a79409b153845a066324290f5e994054e7
|
| 3 |
+
size 23097946
|
wandb/run-20210830_131354-2654p8r7/files/wandb-summary.json
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
{"lr":
|
|
|
|
| 1 |
+
{"lr": 5.63230573291662e-14, "samples": 28800000, "steps": 149999, "loss/train": 0.5880433917045593, "_runtime": 98273, "_timestamp": 1630427507, "_step": 150009, "loss/eval": 0.9517361521720886, "perplexity": 2.590202808380127}
|
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:502abcbf89ce3730893e103ba9a86fbb106088519ef537342da27a79c2fb4fe7
|
| 3 |
+
size 70252161
|
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:14131ed0fdff93f4f2b3c44fa6330c1ec0a2ddf0258270c2a552fa3c2ed161c6
|
| 3 |
+
size 58342910
|