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 650000
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:ee220760c5f375e0c80acf1d7576597dae2d3d4738c9f9e33271b2aeb0b8e6c9
|
| 3 |
+
size 99896492
|
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:2326bdc79ceab6fc8c948ad37ae9f6dd8d52d7118b67952d34a150ed5caa32bb
|
| 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:1069c0665b89660094cbced31870a5e19295a29bb8f21d16bc1b1823eb755aa8
|
| 3 |
+
size 119535287
|
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:09a49644213bc3c8a8a9465142d66e738fd003aa9aa0fc671d3c25fa385b99e2
|
| 3 |
+
size 120281602
|
wandb/run-20210920_142810-36cw69uv/files/wandb-summary.json
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
{"lr":
|
|
|
|
| 1 |
+
{"lr": 1.7358331080729474e-05, "samples": 20800000, "steps": 40624, "loss/train": 0.821692943572998, "_runtime": 531326, "_timestamp": 1632679416, "_step": 650012, "loss/eval": 0.5877718925476074, "perplexity": 1.799973487854004}
|
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:dd50fb384dfc5b0a29bba17aad652a0c705a1e50ceada00a99c3569a26620905
|
| 3 |
+
size 346779425
|
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:b90a5cf5e9e18b5b6667676d66ac11bbf42426fe0583f37aac340aae04617e24
|
| 3 |
+
size 288297860
|