Text Generation
Transformers
PyTorch
English
code
gpt2
code completion
code generation
text-generation-inference
Instructions to use Nokia/nlgp-docstring with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Nokia/nlgp-docstring with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Nokia/nlgp-docstring")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Nokia/nlgp-docstring") model = AutoModelForCausalLM.from_pretrained("Nokia/nlgp-docstring") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use Nokia/nlgp-docstring with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Nokia/nlgp-docstring" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Nokia/nlgp-docstring", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Nokia/nlgp-docstring
- SGLang
How to use Nokia/nlgp-docstring 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 "Nokia/nlgp-docstring" \ --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": "Nokia/nlgp-docstring", "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 "Nokia/nlgp-docstring" \ --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": "Nokia/nlgp-docstring", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Nokia/nlgp-docstring with Docker Model Runner:
docker model run hf.co/Nokia/nlgp-docstring
Add multilingual to the language tag
Browse filesHi! A PR to add multilingual to the language tag to improve the referencing.
README.md
CHANGED
|
@@ -1,11 +1,12 @@
|
|
| 1 |
---
|
| 2 |
-
language:
|
| 3 |
-
|
| 4 |
-
|
|
|
|
|
|
|
| 5 |
tags:
|
| 6 |
- code completion
|
| 7 |
- code generation
|
| 8 |
-
license: "apache-2.0"
|
| 9 |
---
|
| 10 |
|
| 11 |
# NLGP docstring model
|
|
|
|
| 1 |
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
- code
|
| 5 |
+
- multilingual
|
| 6 |
+
license: apache-2.0
|
| 7 |
tags:
|
| 8 |
- code completion
|
| 9 |
- code generation
|
|
|
|
| 10 |
---
|
| 11 |
|
| 12 |
# NLGP docstring model
|