Text Generation
Transformers
PyTorch
Safetensors
English
gpt2
Generated from Trainer
text-generation-inference
Instructions to use Isotonic/gpt2-context_generator with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Isotonic/gpt2-context_generator with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Isotonic/gpt2-context_generator")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Isotonic/gpt2-context_generator") model = AutoModelForCausalLM.from_pretrained("Isotonic/gpt2-context_generator") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use Isotonic/gpt2-context_generator with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Isotonic/gpt2-context_generator" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Isotonic/gpt2-context_generator", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Isotonic/gpt2-context_generator
- SGLang
How to use Isotonic/gpt2-context_generator 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 "Isotonic/gpt2-context_generator" \ --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": "Isotonic/gpt2-context_generator", "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 "Isotonic/gpt2-context_generator" \ --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": "Isotonic/gpt2-context_generator", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Isotonic/gpt2-context_generator with Docker Model Runner:
docker model run hf.co/Isotonic/gpt2-context_generator
Librarian Bot: Add base_model information to model (#2)
Browse files- Librarian Bot: Add base_model information to model (a2b7350b80a0fc5d9c7224877677897e1d6bc39b)
Co-authored-by: Librarian Bot (Bot) <librarian-bot@users.noreply.huggingface.co>
README.md
CHANGED
|
@@ -1,16 +1,17 @@
|
|
| 1 |
---
|
|
|
|
|
|
|
|
|
|
| 2 |
tags:
|
| 3 |
- generated_from_trainer
|
| 4 |
- text-generation-inference
|
| 5 |
-
model-index:
|
| 6 |
-
- name: gpt2-commongen-finetuned
|
| 7 |
-
results: []
|
| 8 |
-
license: cc-by-sa-4.0
|
| 9 |
datasets:
|
| 10 |
- Non-Residual-Prompting/C2Gen
|
| 11 |
-
language:
|
| 12 |
-
- en
|
| 13 |
pipeline_tag: text-generation
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
---
|
| 15 |
|
| 16 |
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
|
|
|
| 1 |
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
license: cc-by-sa-4.0
|
| 5 |
tags:
|
| 6 |
- generated_from_trainer
|
| 7 |
- text-generation-inference
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
datasets:
|
| 9 |
- Non-Residual-Prompting/C2Gen
|
|
|
|
|
|
|
| 10 |
pipeline_tag: text-generation
|
| 11 |
+
base_model: gpt2
|
| 12 |
+
model-index:
|
| 13 |
+
- name: gpt2-commongen-finetuned
|
| 14 |
+
results: []
|
| 15 |
---
|
| 16 |
|
| 17 |
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|