Text Generation
Transformers
PyTorch
Safetensors
English
gpt2
chemistry
biology
text-generation-inference
Instructions to use Arjun-G-Ravi/chat-GPT2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Arjun-G-Ravi/chat-GPT2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Arjun-G-Ravi/chat-GPT2")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Arjun-G-Ravi/chat-GPT2") model = AutoModelForCausalLM.from_pretrained("Arjun-G-Ravi/chat-GPT2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Arjun-G-Ravi/chat-GPT2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Arjun-G-Ravi/chat-GPT2" # 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/chat-GPT2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Arjun-G-Ravi/chat-GPT2
- SGLang
How to use Arjun-G-Ravi/chat-GPT2 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/chat-GPT2" \ --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/chat-GPT2", "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/chat-GPT2" \ --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/chat-GPT2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Arjun-G-Ravi/chat-GPT2 with Docker Model Runner:
docker model run hf.co/Arjun-G-Ravi/chat-GPT2
Commit ·
b6db9ae
1
Parent(s): a3fe400
Update README.md
Browse files
README.md
CHANGED
|
@@ -14,40 +14,22 @@ widget:
|
|
| 14 |
Question: Who is the king of the jungle?'\n
|
| 15 |
Answer:
|
| 16 |
|
| 17 |
-
example_title: Knowledge-
|
| 18 |
|
| 19 |
- text: >-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
Instruction: Write a poem on cows
|
| 24 |
|
| 25 |
-
|
| 26 |
-
example_title: Poem Generation
|
| 27 |
- text: >-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
Instruction: What is the meaning of life?
|
| 32 |
|
| 33 |
Response:
|
| 34 |
example_title: Philosophy
|
| 35 |
-
- text: >-
|
| 36 |
-
Below is an instruction that describes a task. Write a response that
|
| 37 |
-
appropriately completes the request.
|
| 38 |
|
| 39 |
-
Instruction: Why is the sky blue?
|
| 40 |
-
|
| 41 |
-
Response:
|
| 42 |
-
example_title: Knowledge-sky
|
| 43 |
-
- text: >-
|
| 44 |
-
Below is an instruction that describes a task. Write a response that
|
| 45 |
-
appropriately completes the request.
|
| 46 |
-
|
| 47 |
-
Instruction: Define the term torque.
|
| 48 |
-
|
| 49 |
-
Response:
|
| 50 |
-
example_title: Knowledge-torque
|
| 51 |
inference:
|
| 52 |
parameters:
|
| 53 |
temperature: 0.7
|
|
@@ -172,9 +154,9 @@ The prompt format was inspired from both Alpaca dataset (tatsu-lab/alpaca) and L
|
|
| 172 |
|
| 173 |
The parameters I used for inference are:
|
| 174 |
```
|
| 175 |
-
top_k=
|
| 176 |
-
top_p=.9
|
| 177 |
-
temperature = .7
|
| 178 |
```
|
| 179 |
|
| 180 |
|
|
|
|
| 14 |
Question: Who is the king of the jungle?'\n
|
| 15 |
Answer:
|
| 16 |
|
| 17 |
+
example_title: Knowledge - Animal kingdom
|
| 18 |
|
| 19 |
- text: >-
|
| 20 |
+
Read the question and give an honest answer. Your answers should not include any unethical, racist, sexist, dangerous, or illegal content. If the question is wrong, or does not make sense, accept it instead of giving the wrong answer.\n
|
| 21 |
+
Question: Who is Kobe Bryant?
|
| 22 |
+
Answer:
|
|
|
|
| 23 |
|
| 24 |
+
example_title: Knowledge - Sports
|
|
|
|
| 25 |
- text: >-
|
| 26 |
+
Read the question and give an honest answer. Your answers should not include any unethical, racist, sexist, dangerous, or illegal content. If the question is wrong, or does not make sense, accept it instead of giving the wrong answer.\n
|
| 27 |
+
Question: What is the meaning of life?
|
| 28 |
+
Answer:
|
|
|
|
| 29 |
|
| 30 |
Response:
|
| 31 |
example_title: Philosophy
|
|
|
|
|
|
|
|
|
|
| 32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
inference:
|
| 34 |
parameters:
|
| 35 |
temperature: 0.7
|
|
|
|
| 154 |
|
| 155 |
The parameters I used for inference are:
|
| 156 |
```
|
| 157 |
+
top_k=50
|
| 158 |
+
top_p=0.9
|
| 159 |
+
temperature = 0.7
|
| 160 |
```
|
| 161 |
|
| 162 |
|