Text Generation
Transformers
PyTorch
TensorBoard
gpt2
Generated from Trainer
text-generation-inference
Instructions to use gagan3012/model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use gagan3012/model with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="gagan3012/model")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("gagan3012/model") model = AutoModelForCausalLM.from_pretrained("gagan3012/model", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use gagan3012/model with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "gagan3012/model" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "gagan3012/model", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/gagan3012/model
- SGLang
How to use gagan3012/model 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 "gagan3012/model" \ --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": "gagan3012/model", "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 "gagan3012/model" \ --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": "gagan3012/model", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use gagan3012/model with Docker Model Runner:
docker model run hf.co/gagan3012/model
Download eval_results.json from gagan3012/model: direct link, hf CLI and curl.
- Browser
- Download file 219 Bytes
-
https://huggingface.co/gagan3012/model/resolve/main/eval_results.json
- Command line
-
hf download hf://gagan3012/model/eval_results.json
-
curl -L -o eval_results.json https://huggingface.co/gagan3012/model/resolve/main/eval_results.json
219 Bytes
| { | |
| "epoch": 3.0, | |
| "eval_loss": 3.6250336170196533, | |
| "eval_runtime": 0.6213, | |
| "eval_samples": 5, | |
| "eval_samples_per_second": 8.048, | |
| "eval_steps_per_second": 1.61, | |
| "perplexity": 37.525984650160595 | |
| } |