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 800000
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:9da2e30f71d1327e6fc541a330a7c0cb9aea9b1f9c46c1707e9a826966b667aa
|
| 3 |
+
size 123113194
|
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:3d702c81fb5bf32236d7359a16fe6a59f68565cc551405b544bb009c18fc72af
|
| 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:90d50ffc1c30d613505c6012bee5157137c9276989532246f15e0694c99a71f5
|
| 3 |
+
size 147135584
|
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:6f990cc3cb2b65e7054638caa4b80b6691432be73475ee62607f4cf13b8191be
|
| 3 |
+
size 148520861
|
wandb/run-20210920_142810-36cw69uv/files/wandb-summary.json
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
{"lr":
|
|
|
|
| 1 |
+
{"lr": 2.0344980145026172e-13, "samples": 25600000, "steps": 49999, "loss/train": 0.08042354136705399, "_runtime": 654062, "_timestamp": 1632802152, "_step": 800015, "loss/eval": 0.5735794305801392, "perplexity": 1.7746076583862305}
|
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:02726a7d578361f845d4bfd2cdfdfe319b3057ea5e5f654a286bd0a33a3f13d7
|
| 3 |
+
size 426793506
|
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:b492ff3894dd1cd7662b82e822f0026cec678688dc91af5c1df6f882f1df80ae
|
| 3 |
+
size 355545677
|