Instructions to use KnutJaegersberg/gpt2-chatbot with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use KnutJaegersberg/gpt2-chatbot with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="KnutJaegersberg/gpt2-chatbot")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("KnutJaegersberg/gpt2-chatbot") model = AutoModelForCausalLM.from_pretrained("KnutJaegersberg/gpt2-chatbot", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use KnutJaegersberg/gpt2-chatbot with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "KnutJaegersberg/gpt2-chatbot" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "KnutJaegersberg/gpt2-chatbot", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/KnutJaegersberg/gpt2-chatbot
- SGLang
How to use KnutJaegersberg/gpt2-chatbot 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 "KnutJaegersberg/gpt2-chatbot" \ --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": "KnutJaegersberg/gpt2-chatbot", "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 "KnutJaegersberg/gpt2-chatbot" \ --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": "KnutJaegersberg/gpt2-chatbot", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use KnutJaegersberg/gpt2-chatbot with Docker Model Runner:
docker model run hf.co/KnutJaegersberg/gpt2-chatbot
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,20 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: apache-2.0
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
datasets:
|
| 4 |
+
- KnutJaegersberg/Deita-6k
|
| 5 |
+
---
|
| 6 |
+
|
| 7 |
+
GPT2-XL SFT on Deita dataset to change Sams mind. Supports multi-turn dialogue within the range of its capabilities.
|
| 8 |
+
|
| 9 |
+
Prompt Example:
|
| 10 |
+
```
|
| 11 |
+
### System:
|
| 12 |
+
You are an AI assistant. User will give you a task. Your goal is to complete the task as faithfully as you can. While performing the task think step-by-step and justify your steps.
|
| 13 |
+
### User:
|
| 14 |
+
How do you fine tune a large language model?
|
| 15 |
+
### Assistant:
|
| 16 |
+
```
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
|