Instructions to use Arjun-G-Ravi/GPT2-Alpaca with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Arjun-G-Ravi/GPT2-Alpaca with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Arjun-G-Ravi/GPT2-Alpaca")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Arjun-G-Ravi/GPT2-Alpaca") model = AutoModelForCausalLM.from_pretrained("Arjun-G-Ravi/GPT2-Alpaca", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Arjun-G-Ravi/GPT2-Alpaca with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Arjun-G-Ravi/GPT2-Alpaca" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Arjun-G-Ravi/GPT2-Alpaca", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Arjun-G-Ravi/GPT2-Alpaca
- SGLang
How to use Arjun-G-Ravi/GPT2-Alpaca 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 "Arjun-G-Ravi/GPT2-Alpaca" \ --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": "Arjun-G-Ravi/GPT2-Alpaca", "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 "Arjun-G-Ravi/GPT2-Alpaca" \ --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": "Arjun-G-Ravi/GPT2-Alpaca", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Arjun-G-Ravi/GPT2-Alpaca with Docker Model Runner:
docker model run hf.co/Arjun-G-Ravi/GPT2-Alpaca
Commit History
-
Adding `safetensors` variant of this model (#3)
- Adding `safetensors` variant of this model (0c4b5d27f8bb35d86f064d25ea0bb5572ec2a896) Co-authored-by: Safetensors convertbot <SFconvertbot@users.noreply.huggingface.co>64310d1 -
Adding `safetensors` variant of this model (#2)
- Adding `safetensors` variant of this model (eb74ba9c8651602856150a0b0dae02d5f9eb6023) Co-authored-by: Safetensors convertbot <SFconvertbot@users.noreply.huggingface.co>7de3719 -
Adding `safetensors` variant of this model (#1)
- Adding `safetensors` variant of this model (81c9992f447de4759080603d6f7fcd50b172f348) Co-authored-by: Safetensors convertbot <SFconvertbot@users.noreply.huggingface.co>5818988
-
Update README.md
2454b27 -
Update README.md
9db6d5f -
Update README.md
dbed1c8 -
Update README.md
eba086f -
Update README.md
957d99a -
Update README.md
7ed6be7 -
Update README.md
b0797b1 -
Update README.md
d778524 -
Update README.md
cee96fb -
Update README.md
901ea25 -
Update README.md
45db21f -
Update README.md
85f418b -
Update README.md
b1f00b0 -
Upload 9 files
65e31ce -
Update README.md
f27df4b -
Update README.md
6fc7ce0
-
Update README.md
23a79dc -
Update README.md
09fbe7a -
Update README.md
bbba376 -
Update README.md
b5ed3b2 -
Update README.md
7f58f4d -
Update README.md
5fa0108 -
Update README.md
b17924e -
Update README.md
0f4c55b -
Update README.md
be841c5 -
Update README.md
c5235ce -
Update README.md
c512bd2 -
Update README.md
797084e -
Upload 9 files
af65b2d -
Delete GPT2-Alpaca
d5e0a9e -
Upload 9 files
4581a3d -
Update README.md
6e925aa -
initial commit
f6f7ce1