Text Generation
Transformers
Safetensors
PyTorch
English
gpt2
trained-from-scratch
text-completion
english
sangraha
text-generation-inference
Instructions to use sraivante/Custom-GPT-40M-Base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sraivante/Custom-GPT-40M-Base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="sraivante/Custom-GPT-40M-Base")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("sraivante/Custom-GPT-40M-Base") model = AutoModelForCausalLM.from_pretrained("sraivante/Custom-GPT-40M-Base", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use sraivante/Custom-GPT-40M-Base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "sraivante/Custom-GPT-40M-Base" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sraivante/Custom-GPT-40M-Base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/sraivante/Custom-GPT-40M-Base
- SGLang
How to use sraivante/Custom-GPT-40M-Base 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 "sraivante/Custom-GPT-40M-Base" \ --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": "sraivante/Custom-GPT-40M-Base", "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 "sraivante/Custom-GPT-40M-Base" \ --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": "sraivante/Custom-GPT-40M-Base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use sraivante/Custom-GPT-40M-Base with Docker Model Runner:
docker model run hf.co/sraivante/Custom-GPT-40M-Base
Download training_data/SHA256SUMS from sraivante/Custom-GPT-40M-Base: direct link, hf CLI and curl.
- Browser
- Download file 1.19 kB
-
https://huggingface.co/sraivante/Custom-GPT-40M-Base/resolve/main/training_data/SHA256SUMS
- Command line
-
hf download hf://sraivante/Custom-GPT-40M-Base/training_data/SHA256SUMS
-
curl -L -o SHA256SUMS https://huggingface.co/sraivante/Custom-GPT-40M-Base/resolve/main/training_data/SHA256SUMS
1.19 kB
| b8318ac40ad81eb21cc8f20261fc3242cba76119cac05cf5f717b7c6f16d497d .gitattributes | |
| 9fe9c519e898fa33a38f294604ff1a8057d7f5f2b853191893d0d81e5568911a artifact_integrity.json | |
| 54db7ec78aa51785651c913cdac0580ede00d574c2bf48727e95b9099824710e ATTRIBUTION.md | |
| 178a7ba7499dc94c3dbe3c52f1ba5e5db3c737018b9b361211ea8b6f28a7f60f bpe_tokenizer.json | |
| 9ba9550ad48438d0836ddab3da480b3b69ffa0aac7b7878b5a0039e7ab429411 LICENSE | |
| 3ddf9be5c28fe27dad143a5dc76eea25222ad1dd68934a047064e56ed2fa40c5 LICENSE-APACHE-2.0 | |
| 88663b3c4f85e0f0abb019f0cf456c30f7069ca990f56d6731441bc240b02816 NOTICE | |
| 59eb225e402099af329eb8fcbdea3316061b4d60af45dad0f98c68a31e0df103 provenance/data_audit.json | |
| 93803f5c71a78da1a22ddf1753f0e4114cb837b3ac8e789b4ec2a88a12ddb637 provenance/upstream_README.md | |
| 3c080ef54239f17351162353e9ee957f9fdd6d158570e27186480805231bdade raw/data-0.parquet | |
| 5fadacb535e8eeb17326cf909e86e54aa49d8ad189da73e5801a08e358f5375e raw/data-1.parquet | |
| dbff7dd854e5ec60d86902c83d895bfe76c699dcf83580126f85dc3a8900cf38 README.md | |
| 11268ecb2281adf1cdc6340df8f9517931afa2af166aa5099a114edb69e6210b tokens/train_ids.npy | |
| c9f6e7c13916ce8987a9caa80bfef4957e648ade97f30ffbb9ebacd943e736ee tokens/val_ids.npy | |