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 ·
9db6d5f
1
Parent(s): dbed1c8
Update README.md
Browse files
README.md
CHANGED
|
@@ -58,19 +58,25 @@ Here are some tips to be healthy:
|
|
| 58 |
|
| 59 |
2. Write a poem on cows
|
| 60 |
```
|
| 61 |
-
Cows are
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 74 |
```
|
| 75 |
|
| 76 |
3. Which is the fastest animal in the world
|
|
|
|
| 58 |
|
| 59 |
2. Write a poem on cows
|
| 60 |
```
|
| 61 |
+
Cows are beloved creatures,
|
| 62 |
+
Families who love to cuddle,
|
| 63 |
+
In their humble homes they rest.
|
| 64 |
+
|
| 65 |
+
Cows are the bread and butter of life,
|
| 66 |
+
They can be found in the fields and gardens,
|
| 67 |
+
Birds and insects to feed us.
|
| 68 |
+
|
| 69 |
+
Cows are the sweet smell of life,
|
| 70 |
+
A source of joy and happiness,
|
| 71 |
+
Providing shelter and a home to rest.
|
| 72 |
+
|
| 73 |
+
Cows are the faithful guardians of the land,
|
| 74 |
+
They will protect our spirits from strife,
|
| 75 |
+
In their care they will ensure that our food and shelter will be nourished.
|
| 76 |
+
|
| 77 |
+
Cows are the beloved petals of life,
|
| 78 |
+
They are loyal companions and faithful stewards,
|
| 79 |
+
Their presence will always be seen.
|
| 80 |
```
|
| 81 |
|
| 82 |
3. Which is the fastest animal in the world
|