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 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
Update README.md
Browse files
README.md
CHANGED
|
@@ -10,25 +10,28 @@ library_name: transformers
|
|
| 10 |
pipeline_tag: text-generation
|
| 11 |
widget:
|
| 12 |
- text: >-
|
| 13 |
-
Read the question and give an honest answer. Your answers should not include
|
| 14 |
-
|
| 15 |
-
|
|
|
|
| 16 |
example_title: Knowledge - Animal kingdom
|
| 17 |
-
|
| 18 |
- text: >-
|
| 19 |
-
Read the question and give an honest answer. Your answers should not include
|
| 20 |
-
|
| 21 |
-
|
|
|
|
| 22 |
example_title: Knowledge - Sports
|
| 23 |
- text: >-
|
| 24 |
-
Read the question and give an honest answer. Your answers should not include
|
| 25 |
-
|
| 26 |
-
|
|
|
|
| 27 |
example_title: Philosophy
|
| 28 |
- text: >-
|
| 29 |
-
Read the question and give an honest answer. Your answers should not include
|
| 30 |
-
|
| 31 |
-
|
|
|
|
| 32 |
example_title: Robotics
|
| 33 |
inference:
|
| 34 |
parameters:
|
|
@@ -40,6 +43,8 @@ tags:
|
|
| 40 |
- chemistry
|
| 41 |
- biology
|
| 42 |
- text-generation-inference
|
|
|
|
|
|
|
| 43 |
---
|
| 44 |
|
| 45 |
# Model Card for Model ID
|
|
|
|
| 10 |
pipeline_tag: text-generation
|
| 11 |
widget:
|
| 12 |
- text: >-
|
| 13 |
+
Read the question and give an honest answer. Your answers should not include
|
| 14 |
+
any unethical, racist, sexist, dangerous, or illegal content. If the
|
| 15 |
+
question is wrong, or does not make sense, accept it instead of giving the
|
| 16 |
+
wrong answer.\n Question: Who is the king of the jungle? Answer:
|
| 17 |
example_title: Knowledge - Animal kingdom
|
|
|
|
| 18 |
- text: >-
|
| 19 |
+
Read the question and give an honest answer. Your answers should not include
|
| 20 |
+
any unethical, racist, sexist, dangerous, or illegal content. If the
|
| 21 |
+
question is wrong, or does not make sense, accept it instead of giving the
|
| 22 |
+
wrong answer.\n Question: Who is Kobe Bryant? Answer:
|
| 23 |
example_title: Knowledge - Sports
|
| 24 |
- text: >-
|
| 25 |
+
Read the question and give an honest answer. Your answers should not include
|
| 26 |
+
any unethical, racist, sexist, dangerous, or illegal content. If the
|
| 27 |
+
question is wrong, or does not make sense, accept it instead of giving the
|
| 28 |
+
wrong answer.\n Question: What is the meaning of life? Answer:
|
| 29 |
example_title: Philosophy
|
| 30 |
- text: >-
|
| 31 |
+
Read the question and give an honest answer. Your answers should not include
|
| 32 |
+
any unethical, racist, sexist, dangerous, or illegal content. If the
|
| 33 |
+
question is wrong, or does not make sense, accept it instead of giving the
|
| 34 |
+
wrong answer.\n Question: What role of actuators in robotics? Answer:
|
| 35 |
example_title: Robotics
|
| 36 |
inference:
|
| 37 |
parameters:
|
|
|
|
| 43 |
- chemistry
|
| 44 |
- biology
|
| 45 |
- text-generation-inference
|
| 46 |
+
base_model:
|
| 47 |
+
- openai-community/gpt2
|
| 48 |
---
|
| 49 |
|
| 50 |
# Model Card for Model ID
|