Instructions to use NasimB/gpt2-cl-length-sampling-3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use NasimB/gpt2-cl-length-sampling-3 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="NasimB/gpt2-cl-length-sampling-3")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("NasimB/gpt2-cl-length-sampling-3") model = AutoModelForCausalLM.from_pretrained("NasimB/gpt2-cl-length-sampling-3") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use NasimB/gpt2-cl-length-sampling-3 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "NasimB/gpt2-cl-length-sampling-3" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "NasimB/gpt2-cl-length-sampling-3", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/NasimB/gpt2-cl-length-sampling-3
- SGLang
How to use NasimB/gpt2-cl-length-sampling-3 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 "NasimB/gpt2-cl-length-sampling-3" \ --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": "NasimB/gpt2-cl-length-sampling-3", "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 "NasimB/gpt2-cl-length-sampling-3" \ --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": "NasimB/gpt2-cl-length-sampling-3", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use NasimB/gpt2-cl-length-sampling-3 with Docker Model Runner:
docker model run hf.co/NasimB/gpt2-cl-length-sampling-3
Update README.md
#2
by cherry0328 - opened
README.md
CHANGED
|
@@ -7,6 +7,8 @@ datasets:
|
|
| 7 |
model-index:
|
| 8 |
- name: gpt2-cl-length-sampling-3
|
| 9 |
results: []
|
|
|
|
|
|
|
| 10 |
---
|
| 11 |
|
| 12 |
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
|
@@ -79,4 +81,4 @@ The following hyperparameters were used during training:
|
|
| 79 |
- Transformers 4.26.1
|
| 80 |
- Pytorch 1.11.0+cu113
|
| 81 |
- Datasets 2.13.0
|
| 82 |
-
- Tokenizers 0.13.3
|
|
|
|
| 7 |
model-index:
|
| 8 |
- name: gpt2-cl-length-sampling-3
|
| 9 |
results: []
|
| 10 |
+
base_model:
|
| 11 |
+
- openai-community/gpt2
|
| 12 |
---
|
| 13 |
|
| 14 |
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
|
|
|
| 81 |
- Transformers 4.26.1
|
| 82 |
- Pytorch 1.11.0+cu113
|
| 83 |
- Datasets 2.13.0
|
| 84 |
+
- Tokenizers 0.13.3
|