Instructions to use transformersbook/codeparrot with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use transformersbook/codeparrot with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="transformersbook/codeparrot")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("transformersbook/codeparrot") model = AutoModelForCausalLM.from_pretrained("transformersbook/codeparrot") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use transformersbook/codeparrot with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "transformersbook/codeparrot" # 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", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/transformersbook/codeparrot
- SGLang
How to use transformersbook/codeparrot 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" \ --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", "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" \ --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", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use transformersbook/codeparrot with Docker Model Runner:
docker model run hf.co/transformersbook/codeparrot
step 500000
Browse files- log/debug_0.log +2 -2
- pytorch_model.bin +1 -1
- runs/Sep20_14-28-12_leandro-16x-v100/events.out.tfevents.1632148092.leandro-16x-v100.8660.0 +2 -2
- wandb/run-20210920_142810-36cw69uv/files/output.log +2 -2
- wandb/run-20210920_142810-36cw69uv/files/wandb-summary.json +1 -1
- wandb/run-20210920_142810-36cw69uv/logs/debug-internal.log +2 -2
- wandb/run-20210920_142810-36cw69uv/run-36cw69uv.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:8f2fc2c4291f8f172d694bf33918665a16494cabff4819f98dbdb9244a12c09c
|
| 3 |
+
size 76690306
|
pytorch_model.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 6169094681
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:68d1ef5c7a9dca04cdd6b9cdb5d3607abe01927d9be6b0985a52e5631bc01d7c
|
| 3 |
size 6169094681
|
runs/Sep20_14-28-12_leandro-16x-v100/events.out.tfevents.1632148092.leandro-16x-v100.8660.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:368886bb0710ed139028dfcae40161ff3d6ee819ea01f83be38497f8d5ff4d04
|
| 3 |
+
size 91934990
|
wandb/run-20210920_142810-36cw69uv/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:22886a1f546cb031521328aace7120990f83e80e19369a3841d400182055bfa3
|
| 3 |
+
size 92168563
|
wandb/run-20210920_142810-36cw69uv/files/wandb-summary.json
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
{"lr":
|
|
|
|
| 1 |
+
{"lr": 6.340115479172775e-05, "samples": 16000000, "steps": 31249, "loss/train": 0.2803763449192047, "_runtime": 408636, "_timestamp": 1632556726, "_step": 500009, "loss/eval": 0.6390151977539062, "perplexity": 1.8946141004562378}
|
wandb/run-20210920_142810-36cw69uv/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:53309a4c68ecb6e41be01ef3ce269e7d522f289d4c91196836d66fece0973840
|
| 3 |
+
size 266752402
|
wandb/run-20210920_142810-36cw69uv/run-36cw69uv.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:216d628fc5c657de6fb1d9cddf6b84416fa23d2ab287b3584c73fc25cb9c3386
|
| 3 |
+
size 221188724
|