Text Generation
Transformers
PyTorch
Safetensors
English
gpt2
Eval Results (legacy)
text-generation-inference
Instructions to use robowaifudev/megatron-gpt2-345m with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use robowaifudev/megatron-gpt2-345m with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="robowaifudev/megatron-gpt2-345m")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("robowaifudev/megatron-gpt2-345m") model = AutoModelForCausalLM.from_pretrained("robowaifudev/megatron-gpt2-345m") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use robowaifudev/megatron-gpt2-345m with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "robowaifudev/megatron-gpt2-345m" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "robowaifudev/megatron-gpt2-345m", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/robowaifudev/megatron-gpt2-345m
- SGLang
How to use robowaifudev/megatron-gpt2-345m 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 "robowaifudev/megatron-gpt2-345m" \ --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": "robowaifudev/megatron-gpt2-345m", "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 "robowaifudev/megatron-gpt2-345m" \ --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": "robowaifudev/megatron-gpt2-345m", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use robowaifudev/megatron-gpt2-345m with Docker Model Runner:
docker model run hf.co/robowaifudev/megatron-gpt2-345m
Commit ·
ce7f130
1
Parent(s): f803395
Update README.md
Browse files
README.md
CHANGED
|
@@ -23,6 +23,16 @@ model-index:
|
|
| 23 |
- type: wikitext
|
| 24 |
value: 19.31
|
| 25 |
name: Perplexity
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
---
|
| 27 |
|
| 28 |
<!---
|
|
|
|
| 23 |
- type: wikitext
|
| 24 |
value: 19.31
|
| 25 |
name: Perplexity
|
| 26 |
+
- task:
|
| 27 |
+
type: text-generation
|
| 28 |
+
name: Text generation
|
| 29 |
+
dataset:
|
| 30 |
+
name: WikiText-2
|
| 31 |
+
type: wikitext
|
| 32 |
+
metrics:
|
| 33 |
+
- type: wikitext
|
| 34 |
+
value: 17.151
|
| 35 |
+
name: Perplexity
|
| 36 |
---
|
| 37 |
|
| 38 |
<!---
|