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") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- 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 ·
4d1e75b
1
Parent(s): 45e6968
Update README.md
Browse files
README.md
CHANGED
|
@@ -13,20 +13,17 @@ widget:
|
|
| 13 |
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
|
| 14 |
Question: Who is the king of the jungle?
|
| 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 |
example_title: Philosophy
|
| 31 |
- text: >-
|
| 32 |
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
|
|
|
|
| 13 |
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
|
| 14 |
Question: Who is the king of the jungle?
|
| 15 |
Answer:
|
|
|
|
| 16 |
example_title: Knowledge - Animal kingdom
|
| 17 |
|
| 18 |
- text: >-
|
| 19 |
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
|
| 20 |
Question: Who is Kobe Bryant?
|
| 21 |
Answer:
|
|
|
|
| 22 |
example_title: Knowledge - Sports
|
| 23 |
- text: >-
|
| 24 |
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
|
| 25 |
Question: What is the meaning of life?
|
| 26 |
Answer:
|
|
|
|
| 27 |
example_title: Philosophy
|
| 28 |
- text: >-
|
| 29 |
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
|