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
final model
Browse files- log/debug_0.log +2 -2
- 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:628a201465fe66403ddd3a5b52c202d0ad074eeaae3c119f54778441c0c5bc63
|
| 3 |
+
size 23048622
|
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:a2683a6099faae732d97c62643c0a00ac8d6a3ab523520e2dd49c5a0d3e52c97
|
| 3 |
+
size 27535087
|
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:6d0e115618e45341b3a741c48f719a1a8b83c8b0e3939493d7922d1fdecda6e1
|
| 3 |
+
size 23106120
|
wandb/run-20210830_131354-2654p8r7/files/wandb-summary.json
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
{"lr": 5.63230573291662e-14, "samples": 28800000, "steps": 149999, "loss/train": 0.5880433917045593, "_runtime":
|
|
|
|
| 1 |
+
{"lr": 5.63230573291662e-14, "samples": 28800000, "steps": 149999, "loss/train": 0.5880433917045593, "_runtime": 98857, "_timestamp": 1630428091, "_step": 150010, "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:0828ab2e50178fc103bc5b7abcbe2a9e97ea499e1052fff2e6057fe8aa1004d9
|
| 3 |
+
size 70263568
|
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:5a4632bf679f82366a00cc881559640e9aaa632a4173f582bffccac89c901e80
|
| 3 |
+
size 58390387
|